From 648e434ee1e82fc47297367b5eb419387bbfb045 Mon Sep 17 00:00:00 2001 From: KagChi Date: Sun, 18 Feb 2024 12:48:07 +0700 Subject: [PATCH] fix: properly generate schema --- ...tic_wonder_man.sql => 0000_futuristic_mole_man.sql} | 4 ++-- packages/kanao-schema/drizzle/meta/0000_snapshot.json | 10 +++++----- packages/kanao-schema/drizzle/meta/_journal.json | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) rename packages/kanao-schema/drizzle/{0000_exotic_wonder_man.sql => 0000_futuristic_mole_man.sql} (98%) diff --git a/packages/kanao-schema/drizzle/0000_exotic_wonder_man.sql b/packages/kanao-schema/drizzle/0000_futuristic_mole_man.sql similarity index 98% rename from packages/kanao-schema/drizzle/0000_exotic_wonder_man.sql rename to packages/kanao-schema/drizzle/0000_futuristic_mole_man.sql index 5e2944ce..22e4404a 100644 --- a/packages/kanao-schema/drizzle/0000_exotic_wonder_man.sql +++ b/packages/kanao-schema/drizzle/0000_futuristic_mole_man.sql @@ -120,7 +120,7 @@ CREATE TABLE IF NOT EXISTS "channels_overwrite" ( --> statement-breakpoint CREATE TABLE IF NOT EXISTS "voice_states" ( "member_id" text NOT NULL, - "guild_id" text, + "guild_id" text NOT NULL, "channel_id" text NOT NULL, "session_id" text, "deaf" boolean, @@ -131,7 +131,7 @@ CREATE TABLE IF NOT EXISTS "voice_states" ( "self_video" boolean, "suppress" boolean, "request_to_speak_timestamp" text, - CONSTRAINT "voice_states_member_id_channel_id" PRIMARY KEY("member_id","channel_id") + CONSTRAINT "voice_states_member_id_guild_id" PRIMARY KEY("member_id","guild_id") ); --> statement-breakpoint CREATE TABLE IF NOT EXISTS "messages" ( diff --git a/packages/kanao-schema/drizzle/meta/0000_snapshot.json b/packages/kanao-schema/drizzle/meta/0000_snapshot.json index 51f84dfd..6c303477 100644 --- a/packages/kanao-schema/drizzle/meta/0000_snapshot.json +++ b/packages/kanao-schema/drizzle/meta/0000_snapshot.json @@ -1,5 +1,5 @@ { - "id": "ab759bda-c256-4fc6-b4ea-de791bf064ec", + "id": "dff2f68c-be88-4c13-ad05-ff82a69b0db6", "prevId": "00000000-0000-0000-0000-000000000000", "version": "5", "dialect": "pg", @@ -781,7 +781,7 @@ "name": "guild_id", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true }, "channel_id": { "name": "channel_id", @@ -887,11 +887,11 @@ } }, "compositePrimaryKeys": { - "voice_states_member_id_channel_id": { - "name": "voice_states_member_id_channel_id", + "voice_states_member_id_guild_id": { + "name": "voice_states_member_id_guild_id", "columns": [ "member_id", - "channel_id" + "guild_id" ] } }, diff --git a/packages/kanao-schema/drizzle/meta/_journal.json b/packages/kanao-schema/drizzle/meta/_journal.json index ec0effd7..0baa9f23 100644 --- a/packages/kanao-schema/drizzle/meta/_journal.json +++ b/packages/kanao-schema/drizzle/meta/_journal.json @@ -5,8 +5,8 @@ { "idx": 0, "version": "5", - "when": 1708234742737, - "tag": "0000_exotic_wonder_man", + "when": 1708235263010, + "tag": "0000_futuristic_mole_man", "breakpoints": true } ]