Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesPull RequestsActionsSecurityInsightsSettings
✨ AI
More
Blame · Line-by-line history

schema-deploys.ts

Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.

schema-deploys.tsBlame45 lines · 1 contributor
f764c07Claude1/**
2 * Block N3 — Drizzle schema for the platform-deploy timeline table.
3 *
4 * Defined in a SEPARATE module because `src/db/schema.ts` is listed in
5 * §4 LOCKED BLOCKS of BUILD_BIBLE.md ("New tables only via new migration").
6 * The matching migration is `drizzle/0046_platform_deploys.sql`. Import
7 * `platformDeploys` directly from this module.
8 *
9 * Columns mirror the SQL migration 1:1 — keep in sync when superseded by a
10 * follow-up additive migration.
11 */
12
13import {
14 index,
15 integer,
16 pgTable,
17 text,
18 timestamp,
19 uuid,
20} from "drizzle-orm/pg-core";
21
22export const platformDeploys = pgTable(
23 "platform_deploys",
24 {
25 id: uuid("id").primaryKey().defaultRandom(),
26 runId: text("run_id").notNull().unique(),
27 sha: text("sha").notNull(),
28 source: text("source").notNull(),
29 // 'in_progress' | 'succeeded' | 'failed'
30 status: text("status").notNull().default("in_progress"),
31 startedAt: timestamp("started_at", { withTimezone: true })
32 .defaultNow()
33 .notNull(),
34 finishedAt: timestamp("finished_at", { withTimezone: true }),
35 durationMs: integer("duration_ms"),
36 error: text("error"),
37 createdAt: timestamp("created_at", { withTimezone: true })
38 .defaultNow()
39 .notNull(),
40 },
41 (table) => [index("idx_platform_deploys_started").on(table.startedAt)]
42);
43
44export type PlatformDeployRow = typeof platformDeploys.$inferSelect;
45export type NewPlatformDeployRow = typeof platformDeploys.$inferInsert;