From ac3ef0ea062c4663dfd6bdc36befc0905b9a6c46 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Sun, 14 Apr 2024 13:41:11 -1000 Subject: [PATCH] fix(database): :ambulance: Fixed migrations not running on fresh databases Incorrect SQL data in migrations would cause freshly created database to fail migrations --- .vscode/settings.json | 3 ++- drizzle/0000_illegal_living_lightning.sql | 2 +- drizzle/meta/0000_snapshot.json | 3 +-- drizzle/schema.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 758b85e9..fe347821 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "typescript.tsdk": "node_modules/typescript/lib", "jest.jestCommandLine": "/home/jessew/.bun/bin/bun test", - "jest.rootPath": "." + "jest.rootPath": ".", + "conventionalCommits.scopes": ["database"] } diff --git a/drizzle/0000_illegal_living_lightning.sql b/drizzle/0000_illegal_living_lightning.sql index 73d62bb5..daff93e5 100644 --- a/drizzle/0000_illegal_living_lightning.sql +++ b/drizzle/0000_illegal_living_lightning.sql @@ -181,7 +181,7 @@ CREATE TABLE IF NOT EXISTS "User" ( "isBot" boolean DEFAULT false NOT NULL, "isLocked" boolean DEFAULT false NOT NULL, "isDiscoverable" boolean DEFAULT false NOT NULL, - "sanctions" text[] DEFAULT 'RRAY[', + "sanctions" text[], "publicKey" text NOT NULL, "privateKey" text, "instanceId" uuid, diff --git a/drizzle/meta/0000_snapshot.json b/drizzle/meta/0000_snapshot.json index ebb3a289..693b64a0 100644 --- a/drizzle/meta/0000_snapshot.json +++ b/drizzle/meta/0000_snapshot.json @@ -1345,8 +1345,7 @@ "name": "sanctions", "type": "text[]", "primaryKey": false, - "notNull": false, - "default": "'RRAY['" + "notNull": false }, "publicKey": { "name": "publicKey", diff --git a/drizzle/schema.ts b/drizzle/schema.ts index b4f4d1b6..82ec6fae 100644 --- a/drizzle/schema.ts +++ b/drizzle/schema.ts @@ -308,7 +308,7 @@ export const user = pgTable( isBot: boolean("is_bot").default(false).notNull(), isLocked: boolean("is_locked").default(false).notNull(), isDiscoverable: boolean("is_discoverable").default(false).notNull(), - sanctions: text("sanctions").default("RRAY[").array(), + sanctions: text("sanctions").array(), publicKey: text("public_key").notNull(), privateKey: text("private_key"), instanceId: uuid("instanceId").references(() => instance.id, {