mirror of
https://github.com/khairul169/github-leaderboard.git
synced 2026-09-17 09:53:21 +07:00
feat: update language leaderboard calculation
This commit is contained in:
+9
-1
@@ -1,3 +1,11 @@
|
||||
CREATE TABLE `repository_languages` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`repo_id` integer NOT NULL,
|
||||
`name` text NOT NULL,
|
||||
`percentage` real NOT NULL,
|
||||
FOREIGN KEY (`repo_id`) REFERENCES `repositories`(`id`) ON UPDATE no action ON DELETE no action
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `repositories` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`user_id` integer NOT NULL,
|
||||
@@ -7,7 +15,6 @@ CREATE TABLE `repositories` (
|
||||
`stars` integer NOT NULL,
|
||||
`forks` integer NOT NULL,
|
||||
`last_update` text NOT NULL,
|
||||
`languages` text,
|
||||
`contributors` text,
|
||||
`is_pending` integer DEFAULT false NOT NULL,
|
||||
`is_error` integer DEFAULT false NOT NULL,
|
||||
@@ -34,6 +41,7 @@ CREATE TABLE `users` (
|
||||
`updated_at` text NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `repository_languages_name_idx` ON `repository_languages` (`name`);--> statement-breakpoint
|
||||
CREATE INDEX `repositories_name_idx` ON `repositories` (`name`);--> statement-breakpoint
|
||||
CREATE INDEX `repositories_uri_idx` ON `repositories` (`uri`);--> statement-breakpoint
|
||||
CREATE INDEX `repositories_language_idx` ON `repositories` (`language`);--> statement-breakpoint
|
||||
@@ -1,9 +1,68 @@
|
||||
{
|
||||
"version": "6",
|
||||
"dialect": "sqlite",
|
||||
"id": "13d859a6-4c32-46a6-90e9-19740b2bb13a",
|
||||
"id": "a268ec23-239a-4d86-8830-2f3c1c2110df",
|
||||
"prevId": "00000000-0000-0000-0000-000000000000",
|
||||
"tables": {
|
||||
"repository_languages": {
|
||||
"name": "repository_languages",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "integer",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"repo_id": {
|
||||
"name": "repo_id",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"percentage": {
|
||||
"name": "percentage",
|
||||
"type": "real",
|
||||
"primaryKey": false,
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"repository_languages_name_idx": {
|
||||
"name": "repository_languages_name_idx",
|
||||
"columns": [
|
||||
"name"
|
||||
],
|
||||
"isUnique": false
|
||||
}
|
||||
},
|
||||
"foreignKeys": {
|
||||
"repository_languages_repo_id_repositories_id_fk": {
|
||||
"name": "repository_languages_repo_id_repositories_id_fk",
|
||||
"tableFrom": "repository_languages",
|
||||
"tableTo": "repositories",
|
||||
"columnsFrom": [
|
||||
"repo_id"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "no action",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {}
|
||||
},
|
||||
"repositories": {
|
||||
"name": "repositories",
|
||||
"columns": {
|
||||
@@ -63,13 +122,6 @@
|
||||
"notNull": true,
|
||||
"autoincrement": false
|
||||
},
|
||||
"languages": {
|
||||
"name": "languages",
|
||||
"type": "text",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"autoincrement": false
|
||||
},
|
||||
"contributors": {
|
||||
"name": "contributors",
|
||||
"type": "text",
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
{
|
||||
"idx": 0,
|
||||
"version": "6",
|
||||
"when": 1723210265266,
|
||||
"tag": "0000_young_emma_frost",
|
||||
"when": 1723211354217,
|
||||
"tag": "0000_tough_jubilee",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user