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-extensions.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-extensions.tsBlame77 lines · 2 contributors
45e31d0Claude1/**
2 * Extended database schema — branch protection, status checks,
3 * notifications, organizations, and teams.
4 *
5 * These extend the base schema to add enterprise-grade features.
6 */
7
8import {
9 pgTable,
10 text,
11 timestamp,
12 uuid,
13 boolean,
14 integer,
15 uniqueIndex,
16 index,
17 serial,
18 jsonb,
19} from "drizzle-orm/pg-core";
20import { users, repositories } from "./schema";
21
22// ─── Branch Protection Rules ────────────────────────────────────────────────
23
24
25// ─── Status Checks (CI Integration) ────────────────────────────────────────
26
27
28// ─── Notifications ──────────────────────────────────────────────────────────
29
30
31// ─── Organizations ──────────────────────────────────────────────────────────
32
45ac593ccantynz-alt33/**
34 * Organizations lives in schema.ts — re-exported here so the historical
35 * import path keeps working.
36 *
37 * This file used to declare its OWN pgTable("organizations") with a different
38 * column set: display_name/website/location/is_verified but no `slug` and no
39 * `created_by_id`. Two Drizzle objects, one physical table, irreconcilable
40 * shapes. drizzle.config.ts only includes schema.ts and deploys run
41 * db:migrate (never db:push), so this definition was never migrated — it
42 * described a table that has never existed. Every insert through it wrote
43 * columns Postgres does not have while omitting two NOT NULL columns, which
44 * is why POST /orgs/new could never succeed.
45 *
46 * Migration 0113 adds the four extra columns to the real table so nothing the
47 * create form collects is discarded. Keeping ONE definition is what stops the
48 * two drifting apart again.
49 */
50import {
51 organizations,
52 orgMembers,
53 teams,
54 teamMembers,
55 teamRepos,
56 branchProtection,
57 notifications,
58} from "./schema";
59export {
60 organizations,
61 orgMembers,
62 teams,
63 teamMembers,
64 teamRepos,
65 branchProtection,
66 notifications,
67};
45e31d0Claude68
69
70// ─── Type Exports ───────────────────────────────────────────────────────────
71
72export type BranchProtectionRule = typeof branchProtection.$inferSelect;
73export type Notification = typeof notifications.$inferSelect;
74export type Organization = typeof organizations.$inferSelect;
75export type OrgMember = typeof orgMembers.$inferSelect;
76export type Team = typeof teams.$inferSelect;
77export type TeamMember = typeof teamMembers.$inferSelect;