Skip to content

Commit

Permalink
feat(database): add two fields
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Jul 24, 2024
1 parent dd6d2cc commit a001506
Show file tree
Hide file tree
Showing 9 changed files with 879 additions and 212 deletions.
4 changes: 4 additions & 0 deletions packages/database/drizzle/0005_amused_may_parker.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DROP INDEX IF EXISTS "sort_by_created_at";--> statement-breakpoint
ALTER TABLE "resources" ADD COLUMN "magnet2" text;--> statement-breakpoint
ALTER TABLE "resources" ADD COLUMN "magnet_user" text;--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "sort_by_created_at" ON "resources" USING btree ("created_at" DESC NULLS LAST);
110 changes: 74 additions & 36 deletions packages/database/drizzle/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"id": "be0483f5-b846-4d0b-86dc-95a86593343c",
"prevId": "00000000-0000-0000-0000-000000000000",
"version": "5",
"dialect": "pg",
"version": "7",
"dialect": "postgresql",
"tables": {
"resources": {
"public.resources": {
"name": "resources",
"schema": "",
"columns": {
Expand Down Expand Up @@ -111,69 +109,106 @@
},
"indexes": {
"provider_type_id": {
"name": "provider_type_id",
"columns": [
"provider_type",
"provider_id"
{
"expression": "provider_type",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "provider_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true
"with": {},
"name": "provider_type_id",
"isUnique": true,
"method": "btree",
"concurrently": false
},
"sort_by_created_at": {
"name": "sort_by_created_at",
"columns": [
"created_at"
{
"expression": "created_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false
"with": {},
"name": "sort_by_created_at",
"isUnique": false,
"method": "btree",
"concurrently": false
},
"fansub_index": {
"name": "fansub_index",
"columns": [
"fansub_id"
{
"expression": "fansub_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false
"with": {},
"name": "fansub_index",
"isUnique": false,
"method": "btree",
"concurrently": false
},
"publisher_index": {
"name": "publisher_index",
"columns": [
"publisher_id"
{
"expression": "publisher_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false
"with": {},
"name": "publisher_index",
"isUnique": false,
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"resources_fansub_id_teams_id_fk": {
"name": "resources_fansub_id_teams_id_fk",
"tableFrom": "resources",
"tableTo": "teams",
"schemaTo": "public",
"columnsFrom": [
"fansub_id"
],
"tableTo": "teams",
"schemaTo": "public",
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
"onUpdate": "no action",
"onDelete": "no action"
},
"resources_publisher_id_users_id_fk": {
"name": "resources_publisher_id_users_id_fk",
"tableFrom": "resources",
"tableTo": "users",
"schemaTo": "public",
"columnsFrom": [
"publisher_id"
],
"tableTo": "users",
"schemaTo": "public",
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
"onUpdate": "no action",
"onDelete": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"teams": {
"public.teams": {
"name": "teams",
"schema": "",
"columns": {
Expand Down Expand Up @@ -207,7 +242,7 @@
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"users": {
"public.users": {
"name": "users",
"schema": "",
"columns": {
Expand Down Expand Up @@ -243,18 +278,21 @@
}
},
"enums": {
"resources_provider": {
"public.resources_provider": {
"name": "resources_provider",
"values": {
"dmhy": "dmhy",
"moe": "moe"
}
"schema": "public",
"values": [
"dmhy",
"moe"
]
}
},
"schemas": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
"tables": {},
"columns": {}
},
"id": "be0483f5-b846-4d0b-86dc-95a86593343c",
"prevId": "00000000-0000-0000-0000-000000000000"
}
Loading

0 comments on commit a001506

Please sign in to comment.