Skip to content

Commit 4554a8c

Browse files
committed
refactor: update user model to include is_verified field and adjust migration files
1 parent 0c69a1a commit 4554a8c

5 files changed

Lines changed: 13 additions & 11 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ CREATE TABLE "articles" (
1313
"excerpt" varchar,
1414
"body" text,
1515
"cover_image" jsonb,
16-
"is_published" boolean DEFAULT false,
1716
"published_at" timestamp,
1817
"approved_at" timestamp,
1918
"delete_scheduled_at" timestamp,
@@ -115,6 +114,7 @@ CREATE TABLE "users" (
115114
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
116115
"name" varchar NOT NULL,
117116
"username" varchar NOT NULL,
117+
"is_verified" boolean DEFAULT false,
118118
"email" varchar,
119119
"profile_photo_url" varchar,
120120
"profile_photo" json,

migrations/meta/0000_snapshot.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"id": "5197c085-a8e5-4f28-a7eb-cb01556496ff",
2+
"id": "062fd6f0-8554-4577-83ed-31e3d3559a47",
33
"prevId": "00000000-0000-0000-0000-000000000000",
44
"version": "7",
55
"dialect": "postgresql",
@@ -116,13 +116,6 @@
116116
"primaryKey": false,
117117
"notNull": false
118118
},
119-
"is_published": {
120-
"name": "is_published",
121-
"type": "boolean",
122-
"primaryKey": false,
123-
"notNull": false,
124-
"default": false
125-
},
126119
"published_at": {
127120
"name": "published_at",
128121
"type": "timestamp",
@@ -844,6 +837,13 @@
844837
"primaryKey": false,
845838
"notNull": true
846839
},
840+
"is_verified": {
841+
"name": "is_verified",
842+
"type": "boolean",
843+
"primaryKey": false,
844+
"notNull": false,
845+
"default": false
846+
},
847847
"email": {
848848
"name": "email",
849849
"type": "varchar",

migrations/meta/_journal.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
{
66
"idx": 0,
77
"version": "7",
8-
"when": 1750444319407,
9-
"tag": "0000_uneven_snowbird",
8+
"when": 1750838403284,
9+
"tag": "0000_tan_human_robot",
1010
"breakpoints": true
1111
}
1212
]

src/backend/models/domain-models.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export interface User {
22
id: string;
33
name: string;
44
username: string;
5+
is_verified?: boolean;
56
email: string;
67
profile_photo?: IServerFile | null;
78
education: string;

src/backend/persistence/schemas.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const usersTable = pgTable("users", {
1515
id: uuid("id").defaultRandom().primaryKey(),
1616
name: varchar("name").notNull(),
1717
username: varchar("username").notNull(),
18+
is_verified: boolean("is_verified").default(false),
1819
email: varchar("email"),
1920
profile_photo_url: varchar("profile_photo_url"),
2021
profile_photo: json("profile_photo").$type<IServerFile>(),

0 commit comments

Comments
 (0)