Skip to content

Commit

Permalink
feat: update migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
KagChi committed May 30, 2024
1 parent 3f678dc commit fca9a8d
Show file tree
Hide file tree
Showing 8 changed files with 904 additions and 151 deletions.
17 changes: 17 additions & 0 deletions drizzle/0003_sad_saracen.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
CREATE TABLE IF NOT EXISTS "dj" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"guild_id" uuid,
"client_id" text,
"activated_by" text,
"state" boolean DEFAULT false,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp NOT NULL,
"users" text[] DEFAULT '{}'::text[] NOT NULL,
"roles" text[] DEFAULT '{}'::text[] NOT NULL
);
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "dj" ADD CONSTRAINT "dj_guild_id_guild_id_fk" FOREIGN KEY ("guild_id") REFERENCES "public"."guild"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
81 changes: 41 additions & 40 deletions drizzle/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"id": "959948e8-05eb-4590-9c8b-8529b6e798ed",
"prevId": "00000000-0000-0000-0000-000000000000",
"version": "5",
"dialect": "pg",
"version": "6",
"dialect": "postgresql",
"tables": {
"activation_key": {
"public.activation_key": {
"name": "activation_key",
"schema": "",
"columns": {
Expand Down Expand Up @@ -83,34 +81,34 @@
"activation_key_guild_id_guild_id_fk": {
"name": "activation_key_guild_id_guild_id_fk",
"tableFrom": "activation_key",
"tableTo": "guild",
"columnsFrom": [
"guild_id"
],
"tableTo": "guild",
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
"onUpdate": "no action",
"onDelete": "no action"
},
"activation_key_user_id_user_id_fk": {
"name": "activation_key_user_id_user_id_fk",
"tableFrom": "activation_key",
"tableTo": "user",
"columnsFrom": [
"user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
"onUpdate": "no action",
"onDelete": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"crossfade": {
"public.crossfade": {
"name": "crossfade",
"schema": "",
"columns": {
Expand Down Expand Up @@ -165,21 +163,21 @@
"crossfade_guild_id_guild_id_fk": {
"name": "crossfade_guild_id_guild_id_fk",
"tableFrom": "crossfade",
"tableTo": "guild",
"columnsFrom": [
"guild_id"
],
"tableTo": "guild",
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
"onUpdate": "no action",
"onDelete": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"default_volume": {
"public.default_volume": {
"name": "default_volume",
"schema": "",
"columns": {
Expand Down Expand Up @@ -234,21 +232,21 @@
"default_volume_guild_id_guild_id_fk": {
"name": "default_volume_guild_id_guild_id_fk",
"tableFrom": "default_volume",
"tableTo": "guild",
"columnsFrom": [
"guild_id"
],
"tableTo": "guild",
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
"onUpdate": "no action",
"onDelete": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"guild": {
"public.guild": {
"name": "guild",
"schema": "",
"columns": {
Expand Down Expand Up @@ -296,7 +294,7 @@
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"stay_in_vc": {
"public.stay_in_vc": {
"name": "stay_in_vc",
"schema": "",
"columns": {
Expand Down Expand Up @@ -351,21 +349,21 @@
"stay_in_vc_guild_id_guild_id_fk": {
"name": "stay_in_vc_guild_id_guild_id_fk",
"tableFrom": "stay_in_vc",
"tableTo": "guild",
"columnsFrom": [
"guild_id"
],
"tableTo": "guild",
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
"onUpdate": "no action",
"onDelete": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"user": {
"public.user": {
"name": "user",
"schema": "",
"columns": {
Expand Down Expand Up @@ -447,37 +445,40 @@
"uniqueConstraints": {
"user_discord_id_unique": {
"name": "user_discord_id_unique",
"nullsNotDistinct": false,
"columns": [
"discord_id"
]
],
"nullsNotDistinct": false
},
"user_patreon_id_unique": {
"name": "user_patreon_id_unique",
"nullsNotDistinct": false,
"columns": [
"patreon_id"
]
],
"nullsNotDistinct": false
}
}
}
},
"enums": {
"TierType": {
"public.TierType": {
"name": "TierType",
"values": {
"FREE": "FREE",
"SUPPORTER": "SUPPORTER",
"TIER_1": "TIER_1",
"TIER_2": "TIER_2",
"TIER_3": "TIER_3"
}
"schema": "public",
"values": [
"FREE",
"SUPPORTER",
"TIER_1",
"TIER_2",
"TIER_3"
]
}
},
"schemas": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
"tables": {},
"columns": {}
},
"id": "959948e8-05eb-4590-9c8b-8529b6e798ed",
"prevId": "00000000-0000-0000-0000-000000000000"
}
Loading

0 comments on commit fca9a8d

Please sign in to comment.