Add project revision foundation
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { integer, sqliteTable, text, unique } from "drizzle-orm/sqlite-core";
|
||||
import { projects } from "./projects.js";
|
||||
|
||||
export const projectRevisions = sqliteTable(
|
||||
"project_revisions",
|
||||
{
|
||||
id: text("id").primaryKey(),
|
||||
projectId: text("project_id")
|
||||
.notNull()
|
||||
.references(() => projects.id, { onDelete: "cascade" }),
|
||||
revisionNumber: integer("revision_number").notNull(),
|
||||
createdAtIso: text("created_at_iso").notNull(),
|
||||
actorId: text("actor_id"),
|
||||
source: text("source").notNull(),
|
||||
description: text("description"),
|
||||
},
|
||||
(table) => [
|
||||
unique("project_revisions_project_number_unique").on(
|
||||
table.projectId,
|
||||
table.revisionNumber
|
||||
),
|
||||
]
|
||||
);
|
||||
Reference in New Issue
Block a user