Skip to content

Commit

Permalink
fix(database): 🚑 Fixed migrations not running on fresh databases
Browse files Browse the repository at this point in the history
Incorrect SQL data in migrations would cause freshly created database to fail migrations
  • Loading branch information
CPlusPatch committed Apr 14, 2024
1 parent 2e2b91d commit ac3ef0e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -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"]
}
2 changes: 1 addition & 1 deletion drizzle/0000_illegal_living_lightning.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions drizzle/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -1345,8 +1345,7 @@
"name": "sanctions",
"type": "text[]",
"primaryKey": false,
"notNull": false,
"default": "'RRAY['"
"notNull": false
},
"publicKey": {
"name": "publicKey",
Expand Down
2 changes: 1 addition & 1 deletion drizzle/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down

0 comments on commit ac3ef0e

Please sign in to comment.