Add Drizzle ORM with shared db package (#10)
This commit is contained in:
parent
6a3e566438
commit
9deda5f125
13 changed files with 783 additions and 109 deletions
19
packages/db/src/schema/planner.ts
Normal file
19
packages/db/src/schema/planner.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { pgSchema, text, timestamp, boolean, customType } from "drizzle-orm/pg-core";
|
||||
|
||||
const bytea = customType<{ data: Buffer }>({
|
||||
dataType() {
|
||||
return "bytea";
|
||||
},
|
||||
});
|
||||
|
||||
export const plannerSchema = pgSchema("planner");
|
||||
|
||||
export const sessions = plannerSchema.table("sessions", {
|
||||
id: text("id").primaryKey(),
|
||||
yjsState: bytea("yjs_state"),
|
||||
callbackUrl: text("callback_url"),
|
||||
callbackToken: text("callback_token"),
|
||||
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
||||
lastActivity: timestamp("last_activity", { withTimezone: true }).notNull().defaultNow(),
|
||||
closed: boolean("closed").notNull().default(false),
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue