use correct db type
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
import { relations } from "drizzle-orm";
|
||||
import { integer, pgEnum, pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
||||
import {
|
||||
integer,
|
||||
pgEnum,
|
||||
pgTable,
|
||||
text,
|
||||
timestamp,
|
||||
uuid,
|
||||
} from "drizzle-orm/pg-core";
|
||||
import { user } from "./auth";
|
||||
import { id, timestamps } from "./shared";
|
||||
|
||||
@@ -7,7 +14,7 @@ export const visibility = pgEnum("visibility", ["private", "public"]);
|
||||
|
||||
export const timeline = pgTable("timeline", {
|
||||
...id,
|
||||
ownerId: text("owner_id")
|
||||
ownerId: uuid("owner_id")
|
||||
.notNull()
|
||||
.references(() => user.id, { onDelete: "cascade" }),
|
||||
title: text("title").notNull(),
|
||||
@@ -19,7 +26,7 @@ export const timelineGroup = pgTable("timeline_group", {
|
||||
...id,
|
||||
title: text("title").notNull(),
|
||||
sortOrder: integer().notNull().default(0),
|
||||
timelineId: text("timeline_id")
|
||||
timelineId: uuid("timeline_id")
|
||||
.notNull()
|
||||
.references(() => timeline.id, { onDelete: "cascade" }),
|
||||
...timestamps,
|
||||
@@ -27,7 +34,7 @@ export const timelineGroup = pgTable("timeline_group", {
|
||||
|
||||
export const timelineItem = pgTable("timeline_item", {
|
||||
...id,
|
||||
timelineGroupId: text("timeline_group_id")
|
||||
timelineGroupId: uuid("timeline_group_id")
|
||||
.notNull()
|
||||
.references(() => timelineGroup.id, { onDelete: "cascade" }),
|
||||
title: text("title").notNull(),
|
||||
|
||||
Reference in New Issue
Block a user