Skip to content

Commit

Permalink
Merge pull request #8 from neondatabase/feat/add-column-user
Browse files Browse the repository at this point in the history
Add is_subscribed column to user table
  • Loading branch information
m-abdelwahab authored Feb 2, 2024
2 parents b90dccd + f4c1692 commit 6209cdc
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 1 deletion.
1 change: 1 addition & 0 deletions drizzle/0001_ambitious_oracle.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "user" ADD COLUMN "is_subscribed" boolean DEFAULT true;
74 changes: 74 additions & 0 deletions drizzle/meta/0001_snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"id": "bc58f753-3885-4978-b359-4bc7494ea5d0",
"prevId": "82aee2f3-0a69-43a7-ae90-c5b40ac2d1cf",
"version": "5",
"dialect": "pg",
"tables": {
"user": {
"name": "user",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": false
},
"password": {
"name": "password",
"type": "text",
"primaryKey": false,
"notNull": false
},
"role": {
"name": "role",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"is_subscribed": {
"name": "is_subscribed",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": true
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
}
},
"enums": {},
"schemas": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
7 changes: 7 additions & 0 deletions drizzle/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
"when": 1706770281659,
"tag": "0000_goofy_gabe_jones",
"breakpoints": true
},
{
"idx": 1,
"version": "5",
"when": 1706867100457,
"tag": "0001_ambitious_oracle",
"breakpoints": true
}
]
}
3 changes: 2 additions & 1 deletion src/db/schema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { serial, text, timestamp, pgTable } from "drizzle-orm/pg-core";
import { serial, text, timestamp, pgTable, boolean } from "drizzle-orm/pg-core";

export const users = pgTable("user", {
id: serial("id"),
Expand All @@ -8,4 +8,5 @@ export const users = pgTable("user", {
role: text("role").$type<"admin" | "customer">(),
createdAt: timestamp("created_at"),
updatedAt: timestamp("updated_at"),
isSubscribed: boolean("is_subscribed").default(true),
});

0 comments on commit 6209cdc

Please sign in to comment.