From d24748c1790cf16cfb99fbc8df27f9eb6aa90713 Mon Sep 17 00:00:00 2001 From: im-adithya Date: Tue, 24 Dec 2024 11:42:40 +0530 Subject: [PATCH] chore: make nostr pubkey column not null --- drizzle/0002_cloudy_nitro.sql | 1 - drizzle/0002_green_frightful_four.sql | 1 + drizzle/meta/0002_snapshot.json | 4 ++-- drizzle/meta/_journal.json | 4 ++-- src/db/schema.ts | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 drizzle/0002_cloudy_nitro.sql create mode 100644 drizzle/0002_green_frightful_four.sql diff --git a/drizzle/0002_cloudy_nitro.sql b/drizzle/0002_cloudy_nitro.sql deleted file mode 100644 index 5a37f24..0000000 --- a/drizzle/0002_cloudy_nitro.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "users" ADD COLUMN "nostr_pubkey" text; \ No newline at end of file diff --git a/drizzle/0002_green_frightful_four.sql b/drizzle/0002_green_frightful_four.sql new file mode 100644 index 0000000..84a2bf4 --- /dev/null +++ b/drizzle/0002_green_frightful_four.sql @@ -0,0 +1 @@ +ALTER TABLE "users" ADD COLUMN "nostr_pubkey" text NOT NULL; \ No newline at end of file diff --git a/drizzle/meta/0002_snapshot.json b/drizzle/meta/0002_snapshot.json index b89be8d..4e67679 100644 --- a/drizzle/meta/0002_snapshot.json +++ b/drizzle/meta/0002_snapshot.json @@ -1,5 +1,5 @@ { - "id": "b434562b-7a93-4c5f-992b-480f1ca2ed98", + "id": "cc14ef05-cccd-4838-94d5-31521a8d5625", "prevId": "52607bd8-7a1a-4a34-ad27-91b78733e85c", "version": "7", "dialect": "postgresql", @@ -167,7 +167,7 @@ "name": "nostr_pubkey", "type": "text", "primaryKey": false, - "notNull": false + "notNull": true }, "created_at": { "name": "created_at", diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json index 6a61853..34b1dba 100644 --- a/drizzle/meta/_journal.json +++ b/drizzle/meta/_journal.json @@ -19,8 +19,8 @@ { "idx": 2, "version": "7", - "when": 1735019256440, - "tag": "0002_cloudy_nitro", + "when": 1735020701926, + "tag": "0002_green_frightful_four", "breakpoints": true } ] diff --git a/src/db/schema.ts b/src/db/schema.ts index 88d2bc8..56ac19c 100644 --- a/src/db/schema.ts +++ b/src/db/schema.ts @@ -4,7 +4,7 @@ export const users = pgTable("users", { id: serial("id").primaryKey(), encryptedConnectionSecret: text("connection_secret").notNull(), username: text("username").unique().notNull(), - nostrPubkey: text("nostr_pubkey"), + nostrPubkey: text("nostr_pubkey").notNull(), createdAt: timestamp("created_at").notNull().defaultNow(), });