@storyshelf/db-postgres 0.0.0-stage → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +18 -2
  3. package/dist/ddl.d.mts +8 -0
  4. package/dist/ddl.mjs +321 -0
  5. package/dist/ddl.mjs.map +1 -0
  6. package/dist/drizzle-factory-pg.mjs +77 -0
  7. package/dist/drizzle-factory-pg.mjs.map +1 -0
  8. package/dist/drizzle-factory.mjs +42 -0
  9. package/dist/drizzle-factory.mjs.map +1 -0
  10. package/dist/index.d.mts +50 -0
  11. package/dist/index.mjs +51 -0
  12. package/dist/index.mjs.map +1 -0
  13. package/dist/migrate.mjs +91 -0
  14. package/dist/migrate.mjs.map +1 -0
  15. package/dist/neon-http.d.mts +27 -0
  16. package/dist/neon-http.mjs +66 -0
  17. package/dist/neon-http.mjs.map +1 -0
  18. package/dist/neon.d.mts +29 -0
  19. package/dist/neon.mjs +59 -0
  20. package/dist/neon.mjs.map +1 -0
  21. package/dist/pg.d.mts +33 -0
  22. package/dist/pg.mjs +56 -0
  23. package/dist/pg.mjs.map +1 -0
  24. package/dist/pglite.d.mts +28 -0
  25. package/dist/pglite.mjs +54 -0
  26. package/dist/pglite.mjs.map +1 -0
  27. package/dist/schema/baseline.d.mts +197 -0
  28. package/dist/schema/baseline.mjs +29 -0
  29. package/dist/schema/baseline.mjs.map +1 -0
  30. package/dist/schema/build.d.mts +380 -0
  31. package/dist/schema/build.mjs +39 -0
  32. package/dist/schema/build.mjs.map +1 -0
  33. package/dist/schema/capture-attempt.d.mts +445 -0
  34. package/dist/schema/capture-attempt.mjs +58 -0
  35. package/dist/schema/capture-attempt.mjs.map +1 -0
  36. package/dist/schema/comment.d.mts +197 -0
  37. package/dist/schema/comment.mjs +32 -0
  38. package/dist/schema/comment.mjs.map +1 -0
  39. package/dist/schema/content-refs.d.mts +89 -0
  40. package/dist/schema/content-refs.mjs +22 -0
  41. package/dist/schema/content-refs.mjs.map +1 -0
  42. package/dist/schema/label.d.mts +262 -0
  43. package/dist/schema/label.mjs +36 -0
  44. package/dist/schema/label.mjs.map +1 -0
  45. package/dist/schema/member.d.mts +129 -0
  46. package/dist/schema/member.mjs +23 -0
  47. package/dist/schema/member.mjs.map +1 -0
  48. package/dist/schema/notification.d.mts +316 -0
  49. package/dist/schema/notification.mjs +42 -0
  50. package/dist/schema/notification.mjs.map +1 -0
  51. package/dist/schema/project-group-mapping.d.mts +110 -0
  52. package/dist/schema/project-group-mapping.mjs +21 -0
  53. package/dist/schema/project-group-mapping.mjs.map +1 -0
  54. package/dist/schema/project.d.mts +337 -0
  55. package/dist/schema/project.mjs +35 -0
  56. package/dist/schema/project.mjs.map +1 -0
  57. package/dist/schema/snapshot.d.mts +452 -0
  58. package/dist/schema/snapshot.mjs +47 -0
  59. package/dist/schema/snapshot.mjs.map +1 -0
  60. package/dist/schema/status-config.d.mts +143 -0
  61. package/dist/schema/status-config.mjs +26 -0
  62. package/dist/schema/status-config.mjs.map +1 -0
  63. package/dist/schema/token.d.mts +143 -0
  64. package/dist/schema/token.mjs +27 -0
  65. package/dist/schema/token.mjs.map +1 -0
  66. package/dist/schema/user-invite.d.mts +125 -0
  67. package/dist/schema/user-invite.mjs +28 -0
  68. package/dist/schema/user-invite.mjs.map +1 -0
  69. package/dist/schema/user.d.mts +146 -0
  70. package/dist/schema/user.mjs +25 -0
  71. package/dist/schema/user.mjs.map +1 -0
  72. package/dist/schema/webhook.d.mts +143 -0
  73. package/dist/schema/webhook.mjs +26 -0
  74. package/dist/schema/webhook.mjs.map +1 -0
  75. package/dist/schema.d.mts +47 -0
  76. package/dist/schema.mjs +46 -0
  77. package/dist/schema.mjs.map +1 -0
  78. package/dist/vercel.d.mts +26 -0
  79. package/dist/vercel.mjs +48 -0
  80. package/dist/vercel.mjs.map +1 -0
  81. package/package.json +134 -4
@@ -0,0 +1,197 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ //#region src/schema/comment.d.ts
4
+ /** Narrow `comments` table definition. */
5
+ declare const comments: import("drizzle-orm/pg-core").PgTableWithColumns<{
6
+ name: "comments";
7
+ schema: undefined;
8
+ columns: {
9
+ id: import("drizzle-orm/pg-core").PgColumn<{
10
+ name: "id";
11
+ tableName: "comments";
12
+ dataType: "string";
13
+ columnType: "PgText";
14
+ data: string;
15
+ driverParam: string;
16
+ notNull: true;
17
+ hasDefault: false;
18
+ isPrimaryKey: true;
19
+ isAutoincrement: false;
20
+ hasRuntimeDefault: false;
21
+ enumValues: [string, ...string[]];
22
+ baseColumn: never;
23
+ identity: undefined;
24
+ generated: undefined;
25
+ }, {}, {}>;
26
+ projectId: import("drizzle-orm/pg-core").PgColumn<{
27
+ name: "project_id";
28
+ tableName: "comments";
29
+ dataType: "string";
30
+ columnType: "PgText";
31
+ data: string;
32
+ driverParam: string;
33
+ notNull: true;
34
+ hasDefault: false;
35
+ isPrimaryKey: false;
36
+ isAutoincrement: false;
37
+ hasRuntimeDefault: false;
38
+ enumValues: [string, ...string[]];
39
+ baseColumn: never;
40
+ identity: undefined;
41
+ generated: undefined;
42
+ }, {}, {}>;
43
+ buildId: import("drizzle-orm/pg-core").PgColumn<{
44
+ name: "build_id";
45
+ tableName: "comments";
46
+ dataType: "string";
47
+ columnType: "PgText";
48
+ data: string;
49
+ driverParam: string;
50
+ notNull: true;
51
+ hasDefault: false;
52
+ isPrimaryKey: false;
53
+ isAutoincrement: false;
54
+ hasRuntimeDefault: false;
55
+ enumValues: [string, ...string[]];
56
+ baseColumn: never;
57
+ identity: undefined;
58
+ generated: undefined;
59
+ }, {}, {}>;
60
+ snapshotId: import("drizzle-orm/pg-core").PgColumn<{
61
+ name: "snapshot_id";
62
+ tableName: "comments";
63
+ dataType: "string";
64
+ columnType: "PgText";
65
+ data: string;
66
+ driverParam: string;
67
+ notNull: false;
68
+ hasDefault: false;
69
+ isPrimaryKey: false;
70
+ isAutoincrement: false;
71
+ hasRuntimeDefault: false;
72
+ enumValues: [string, ...string[]];
73
+ baseColumn: never;
74
+ identity: undefined;
75
+ generated: undefined;
76
+ }, {}, {}>;
77
+ userId: import("drizzle-orm/pg-core").PgColumn<{
78
+ name: "user_id";
79
+ tableName: "comments";
80
+ dataType: "string";
81
+ columnType: "PgText";
82
+ data: string;
83
+ driverParam: string;
84
+ notNull: false;
85
+ hasDefault: false;
86
+ isPrimaryKey: false;
87
+ isAutoincrement: false;
88
+ hasRuntimeDefault: false;
89
+ enumValues: [string, ...string[]];
90
+ baseColumn: never;
91
+ identity: undefined;
92
+ generated: undefined;
93
+ }, {}, {}>;
94
+ body: import("drizzle-orm/pg-core").PgColumn<{
95
+ name: "body";
96
+ tableName: "comments";
97
+ dataType: "string";
98
+ columnType: "PgText";
99
+ data: string;
100
+ driverParam: string;
101
+ notNull: true;
102
+ hasDefault: false;
103
+ isPrimaryKey: false;
104
+ isAutoincrement: false;
105
+ hasRuntimeDefault: false;
106
+ enumValues: [string, ...string[]];
107
+ baseColumn: never;
108
+ identity: undefined;
109
+ generated: undefined;
110
+ }, {}, {}>;
111
+ parentId: import("drizzle-orm/pg-core").PgColumn<{
112
+ name: "parent_id";
113
+ tableName: "comments";
114
+ dataType: "string";
115
+ columnType: "PgText";
116
+ data: string;
117
+ driverParam: string;
118
+ notNull: false;
119
+ hasDefault: false;
120
+ isPrimaryKey: false;
121
+ isAutoincrement: false;
122
+ hasRuntimeDefault: false;
123
+ enumValues: [string, ...string[]];
124
+ baseColumn: never;
125
+ identity: undefined;
126
+ generated: undefined;
127
+ }, {}, {}>;
128
+ resolved: import("drizzle-orm/pg-core").PgColumn<{
129
+ name: "resolved";
130
+ tableName: "comments";
131
+ dataType: "boolean";
132
+ columnType: "PgBoolean";
133
+ data: boolean;
134
+ driverParam: boolean;
135
+ notNull: true;
136
+ hasDefault: true;
137
+ isPrimaryKey: false;
138
+ isAutoincrement: false;
139
+ hasRuntimeDefault: false;
140
+ enumValues: undefined;
141
+ baseColumn: never;
142
+ identity: undefined;
143
+ generated: undefined;
144
+ }, {}, {}>;
145
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
146
+ name: "created_at";
147
+ tableName: "comments";
148
+ dataType: "string";
149
+ columnType: "PgTimestampString";
150
+ data: string;
151
+ driverParam: string;
152
+ notNull: true;
153
+ hasDefault: false;
154
+ isPrimaryKey: false;
155
+ isAutoincrement: false;
156
+ hasRuntimeDefault: false;
157
+ enumValues: undefined;
158
+ baseColumn: never;
159
+ identity: undefined;
160
+ generated: undefined;
161
+ }, {}, {}>;
162
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
163
+ name: "updated_at";
164
+ tableName: "comments";
165
+ dataType: "string";
166
+ columnType: "PgTimestampString";
167
+ data: string;
168
+ driverParam: string;
169
+ notNull: true;
170
+ hasDefault: false;
171
+ isPrimaryKey: false;
172
+ isAutoincrement: false;
173
+ hasRuntimeDefault: false;
174
+ enumValues: undefined;
175
+ baseColumn: never;
176
+ identity: undefined;
177
+ generated: undefined;
178
+ }, {}, {}>;
179
+ };
180
+ dialect: 'pg';
181
+ }>;
182
+ /** A comment row. */
183
+ interface Comment {
184
+ id: string;
185
+ projectId: string;
186
+ buildId: string;
187
+ snapshotId: string | null;
188
+ userId: string | null;
189
+ body: string;
190
+ parentId: string | null;
191
+ resolved: boolean;
192
+ createdAt: string;
193
+ updatedAt: string;
194
+ }
195
+ //#endregion
196
+ export { Comment, comments };
197
+ //# sourceMappingURL=comment.d.mts.map
@@ -0,0 +1,32 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { projects } from "./project.mjs";
5
+ import { builds } from "./build.mjs";
6
+ import { snapshots } from "./snapshot.mjs";
7
+ import { users } from "./user.mjs";
8
+ import { boolean, index, pgTable, text, timestamp } from "drizzle-orm/pg-core";
9
+ //#region src/schema/comment.ts
10
+ /** Narrow `comments` table definition. */
11
+ const comments = pgTable("comments", {
12
+ id: text("id").primaryKey(),
13
+ projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
14
+ buildId: text("build_id").notNull().references(() => builds.id, { onDelete: "cascade" }),
15
+ snapshotId: text("snapshot_id").references(() => snapshots.id, { onDelete: "cascade" }),
16
+ userId: text("user_id").references(() => users.id, { onDelete: "cascade" }),
17
+ body: text("body").notNull(),
18
+ parentId: text("parent_id"),
19
+ resolved: boolean("resolved").notNull().default(false),
20
+ createdAt: timestamp("created_at", {
21
+ withTimezone: true,
22
+ mode: "string"
23
+ }).notNull(),
24
+ updatedAt: timestamp("updated_at", {
25
+ withTimezone: true,
26
+ mode: "string"
27
+ }).notNull()
28
+ }, (t) => [index("comments_build_id_idx").on(t.buildId)]);
29
+ //#endregion
30
+ export { comments };
31
+
32
+ //# sourceMappingURL=comment.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment.mjs","names":[],"sources":["../../src/schema/comment.ts"],"sourcesContent":["import { boolean, index, pgTable, text, timestamp } from \"drizzle-orm/pg-core\";\nimport { builds } from \"./build.ts\";\nimport { projects } from \"./project.ts\";\nimport { snapshots } from \"./snapshot.ts\";\nimport { users } from \"./user.ts\";\n\n/** Narrow `comments` table definition. */\nexport const comments = pgTable(\n \"comments\",\n {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n buildId: text(\"build_id\")\n .notNull()\n .references(() => builds.id, { onDelete: \"cascade\" }),\n snapshotId: text(\"snapshot_id\").references(() => snapshots.id, { onDelete: \"cascade\" }),\n userId: text(\"user_id\").references(() => users.id, { onDelete: \"cascade\" }),\n body: text(\"body\").notNull(),\n parentId: text(\"parent_id\"),\n resolved: boolean(\"resolved\").notNull().default(false),\n createdAt: timestamp(\"created_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n updatedAt: timestamp(\"updated_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n },\n (t) => [index(\"comments_build_id_idx\").on(t.buildId)],\n);\n\n/** A comment row. */\nexport interface Comment {\n id: string;\n projectId: string;\n buildId: string;\n snapshotId: string | null;\n userId: string | null;\n body: string;\n parentId: string | null;\n resolved: boolean;\n createdAt: string;\n updatedAt: string;\n}\n"],"mappings":";;;;;;;;;;AAOA,MAAa,WAAW,QACtB,YACA;CACE,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,SAAS,KAAK,UAAU,CAAC,CACtB,QAAQ,CAAC,CACT,iBAAiB,OAAO,IAAI,EAAE,UAAU,UAAU,CAAC;CACtD,YAAY,KAAK,aAAa,CAAC,CAAC,iBAAiB,UAAU,IAAI,EAAE,UAAU,UAAU,CAAC;CACtF,QAAQ,KAAK,SAAS,CAAC,CAAC,iBAAiB,MAAM,IAAI,EAAE,UAAU,UAAU,CAAC;CAC1E,MAAM,KAAK,MAAM,CAAC,CAAC,QAAQ;CAC3B,UAAU,KAAK,WAAW;CAC1B,UAAU,QAAQ,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CACrD,WAAW,UAAU,cAAc;EAAE,cAAc;EAAM,MAAM;CAAS,CAAC,CAAC,CAAC,QAAQ;CACnF,WAAW,UAAU,cAAc;EAAE,cAAc;EAAM,MAAM;CAAS,CAAC,CAAC,CAAC,QAAQ;AACrF,IACC,MAAM,CAAC,MAAM,uBAAuB,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CACtD"}
@@ -0,0 +1,89 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ //#region src/schema/content-refs.d.ts
4
+ /** Content-addressed storage refs for deduplicated Storybook assets. */
5
+ declare const contentRefs: import("drizzle-orm/pg-core").PgTableWithColumns<{
6
+ name: "content_refs";
7
+ schema: undefined;
8
+ columns: {
9
+ hash: import("drizzle-orm/pg-core").PgColumn<{
10
+ name: "hash";
11
+ tableName: "content_refs";
12
+ dataType: "string";
13
+ columnType: "PgText";
14
+ data: string;
15
+ driverParam: string;
16
+ notNull: true;
17
+ hasDefault: false;
18
+ isPrimaryKey: true;
19
+ isAutoincrement: false;
20
+ hasRuntimeDefault: false;
21
+ enumValues: [string, ...string[]];
22
+ baseColumn: never;
23
+ identity: undefined;
24
+ generated: undefined;
25
+ }, {}, {}>;
26
+ refCount: import("drizzle-orm/pg-core").PgColumn<{
27
+ name: "ref_count";
28
+ tableName: "content_refs";
29
+ dataType: "number";
30
+ columnType: "PgInteger";
31
+ data: number;
32
+ driverParam: string | number;
33
+ notNull: true;
34
+ hasDefault: true;
35
+ isPrimaryKey: false;
36
+ isAutoincrement: false;
37
+ hasRuntimeDefault: false;
38
+ enumValues: undefined;
39
+ baseColumn: never;
40
+ identity: undefined;
41
+ generated: undefined;
42
+ }, {}, {}>;
43
+ lastSeenAt: import("drizzle-orm/pg-core").PgColumn<{
44
+ name: "last_seen_at";
45
+ tableName: "content_refs";
46
+ dataType: "string";
47
+ columnType: "PgTimestampString";
48
+ data: string;
49
+ driverParam: string;
50
+ notNull: true;
51
+ hasDefault: false;
52
+ isPrimaryKey: false;
53
+ isAutoincrement: false;
54
+ hasRuntimeDefault: false;
55
+ enumValues: undefined;
56
+ baseColumn: never;
57
+ identity: undefined;
58
+ generated: undefined;
59
+ }, {}, {}>;
60
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
61
+ name: "created_at";
62
+ tableName: "content_refs";
63
+ dataType: "string";
64
+ columnType: "PgTimestampString";
65
+ data: string;
66
+ driverParam: string;
67
+ notNull: true;
68
+ hasDefault: false;
69
+ isPrimaryKey: false;
70
+ isAutoincrement: false;
71
+ hasRuntimeDefault: false;
72
+ enumValues: undefined;
73
+ baseColumn: never;
74
+ identity: undefined;
75
+ generated: undefined;
76
+ }, {}, {}>;
77
+ };
78
+ dialect: 'pg';
79
+ }>;
80
+ /** Content ref row. */
81
+ interface ContentRef {
82
+ hash: string;
83
+ refCount: number;
84
+ lastSeenAt: string;
85
+ createdAt: string;
86
+ }
87
+ //#endregion
88
+ export { ContentRef, contentRefs };
89
+ //# sourceMappingURL=content-refs.d.mts.map
@@ -0,0 +1,22 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { integer, pgTable, text, timestamp } from "drizzle-orm/pg-core";
5
+ //#region src/schema/content-refs.ts
6
+ /** Content-addressed storage refs for deduplicated Storybook assets. */
7
+ const contentRefs = pgTable("content_refs", {
8
+ hash: text("hash").primaryKey(),
9
+ refCount: integer("ref_count").notNull().default(1),
10
+ lastSeenAt: timestamp("last_seen_at", {
11
+ withTimezone: true,
12
+ mode: "string"
13
+ }).notNull(),
14
+ createdAt: timestamp("created_at", {
15
+ withTimezone: true,
16
+ mode: "string"
17
+ }).notNull()
18
+ });
19
+ //#endregion
20
+ export { contentRefs };
21
+
22
+ //# sourceMappingURL=content-refs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-refs.mjs","names":[],"sources":["../../src/schema/content-refs.ts"],"sourcesContent":["import { integer, pgTable, text, timestamp } from \"drizzle-orm/pg-core\";\n\n/** Content-addressed storage refs for deduplicated Storybook assets. */\nexport const contentRefs = pgTable(\"content_refs\", {\n hash: text(\"hash\").primaryKey(),\n refCount: integer(\"ref_count\").notNull().default(1),\n lastSeenAt: timestamp(\"last_seen_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n createdAt: timestamp(\"created_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n});\n\n/** Content ref row. */\nexport interface ContentRef {\n hash: string;\n refCount: number;\n lastSeenAt: string;\n createdAt: string;\n}\n"],"mappings":";;;;;;AAGA,MAAa,cAAc,QAAQ,gBAAgB;CACjD,MAAM,KAAK,MAAM,CAAC,CAAC,WAAW;CAC9B,UAAU,QAAQ,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CAClD,YAAY,UAAU,gBAAgB;EAAE,cAAc;EAAM,MAAM;CAAS,CAAC,CAAC,CAAC,QAAQ;CACtF,WAAW,UAAU,cAAc;EAAE,cAAc;EAAM,MAAM;CAAS,CAAC,CAAC,CAAC,QAAQ;AACrF,CAAC"}
@@ -0,0 +1,262 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ //#region src/schema/label.d.ts
4
+ /** Narrow `label_types` table definition. */
5
+ declare const labelTypes: import("drizzle-orm/pg-core").PgTableWithColumns<{
6
+ name: "label_types";
7
+ schema: undefined;
8
+ columns: {
9
+ id: import("drizzle-orm/pg-core").PgColumn<{
10
+ name: "id";
11
+ tableName: "label_types";
12
+ dataType: "string";
13
+ columnType: "PgText";
14
+ data: string;
15
+ driverParam: string;
16
+ notNull: true;
17
+ hasDefault: false;
18
+ isPrimaryKey: true;
19
+ isAutoincrement: false;
20
+ hasRuntimeDefault: false;
21
+ enumValues: [string, ...string[]];
22
+ baseColumn: never;
23
+ identity: undefined;
24
+ generated: undefined;
25
+ }, {}, {}>;
26
+ projectId: import("drizzle-orm/pg-core").PgColumn<{
27
+ name: "project_id";
28
+ tableName: "label_types";
29
+ dataType: "string";
30
+ columnType: "PgText";
31
+ data: string;
32
+ driverParam: string;
33
+ notNull: true;
34
+ hasDefault: false;
35
+ isPrimaryKey: false;
36
+ isAutoincrement: false;
37
+ hasRuntimeDefault: false;
38
+ enumValues: [string, ...string[]];
39
+ baseColumn: never;
40
+ identity: undefined;
41
+ generated: undefined;
42
+ }, {}, {}>;
43
+ key: import("drizzle-orm/pg-core").PgColumn<{
44
+ name: "key";
45
+ tableName: "label_types";
46
+ dataType: "string";
47
+ columnType: "PgText";
48
+ data: string;
49
+ driverParam: string;
50
+ notNull: true;
51
+ hasDefault: false;
52
+ isPrimaryKey: false;
53
+ isAutoincrement: false;
54
+ hasRuntimeDefault: false;
55
+ enumValues: [string, ...string[]];
56
+ baseColumn: never;
57
+ identity: undefined;
58
+ generated: undefined;
59
+ }, {}, {}>;
60
+ name: import("drizzle-orm/pg-core").PgColumn<{
61
+ name: "name";
62
+ tableName: "label_types";
63
+ dataType: "string";
64
+ columnType: "PgText";
65
+ data: string;
66
+ driverParam: string;
67
+ notNull: true;
68
+ hasDefault: false;
69
+ isPrimaryKey: false;
70
+ isAutoincrement: false;
71
+ hasRuntimeDefault: false;
72
+ enumValues: [string, ...string[]];
73
+ baseColumn: never;
74
+ identity: undefined;
75
+ generated: undefined;
76
+ }, {}, {}>;
77
+ linkTemplate: import("drizzle-orm/pg-core").PgColumn<{
78
+ name: "link_template";
79
+ tableName: "label_types";
80
+ dataType: "string";
81
+ columnType: "PgText";
82
+ data: string;
83
+ driverParam: string;
84
+ notNull: false;
85
+ hasDefault: false;
86
+ isPrimaryKey: false;
87
+ isAutoincrement: false;
88
+ hasRuntimeDefault: false;
89
+ enumValues: [string, ...string[]];
90
+ baseColumn: never;
91
+ identity: undefined;
92
+ generated: undefined;
93
+ }, {}, {}>;
94
+ color: import("drizzle-orm/pg-core").PgColumn<{
95
+ name: "color";
96
+ tableName: "label_types";
97
+ dataType: "string";
98
+ columnType: "PgText";
99
+ data: string;
100
+ driverParam: string;
101
+ notNull: false;
102
+ hasDefault: false;
103
+ isPrimaryKey: false;
104
+ isAutoincrement: false;
105
+ hasRuntimeDefault: false;
106
+ enumValues: [string, ...string[]];
107
+ baseColumn: never;
108
+ identity: undefined;
109
+ generated: undefined;
110
+ }, {}, {}>;
111
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
112
+ name: "created_at";
113
+ tableName: "label_types";
114
+ dataType: "string";
115
+ columnType: "PgTimestampString";
116
+ data: string;
117
+ driverParam: string;
118
+ notNull: true;
119
+ hasDefault: false;
120
+ isPrimaryKey: false;
121
+ isAutoincrement: false;
122
+ hasRuntimeDefault: false;
123
+ enumValues: undefined;
124
+ baseColumn: never;
125
+ identity: undefined;
126
+ generated: undefined;
127
+ }, {}, {}>;
128
+ };
129
+ dialect: 'pg';
130
+ }>;
131
+ /** Narrow `build_labels` table definition. */
132
+ declare const buildLabels: import("drizzle-orm/pg-core").PgTableWithColumns<{
133
+ name: "build_labels";
134
+ schema: undefined;
135
+ columns: {
136
+ id: import("drizzle-orm/pg-core").PgColumn<{
137
+ name: "id";
138
+ tableName: "build_labels";
139
+ dataType: "string";
140
+ columnType: "PgText";
141
+ data: string;
142
+ driverParam: string;
143
+ notNull: true;
144
+ hasDefault: false;
145
+ isPrimaryKey: true;
146
+ isAutoincrement: false;
147
+ hasRuntimeDefault: false;
148
+ enumValues: [string, ...string[]];
149
+ baseColumn: never;
150
+ identity: undefined;
151
+ generated: undefined;
152
+ }, {}, {}>;
153
+ projectId: import("drizzle-orm/pg-core").PgColumn<{
154
+ name: "project_id";
155
+ tableName: "build_labels";
156
+ dataType: "string";
157
+ columnType: "PgText";
158
+ data: string;
159
+ driverParam: string;
160
+ notNull: true;
161
+ hasDefault: false;
162
+ isPrimaryKey: false;
163
+ isAutoincrement: false;
164
+ hasRuntimeDefault: false;
165
+ enumValues: [string, ...string[]];
166
+ baseColumn: never;
167
+ identity: undefined;
168
+ generated: undefined;
169
+ }, {}, {}>;
170
+ buildId: import("drizzle-orm/pg-core").PgColumn<{
171
+ name: "build_id";
172
+ tableName: "build_labels";
173
+ dataType: "string";
174
+ columnType: "PgText";
175
+ data: string;
176
+ driverParam: string;
177
+ notNull: true;
178
+ hasDefault: false;
179
+ isPrimaryKey: false;
180
+ isAutoincrement: false;
181
+ hasRuntimeDefault: false;
182
+ enumValues: [string, ...string[]];
183
+ baseColumn: never;
184
+ identity: undefined;
185
+ generated: undefined;
186
+ }, {}, {}>;
187
+ typeKey: import("drizzle-orm/pg-core").PgColumn<{
188
+ name: "type_key";
189
+ tableName: "build_labels";
190
+ dataType: "string";
191
+ columnType: "PgText";
192
+ data: string;
193
+ driverParam: string;
194
+ notNull: true;
195
+ hasDefault: false;
196
+ isPrimaryKey: false;
197
+ isAutoincrement: false;
198
+ hasRuntimeDefault: false;
199
+ enumValues: [string, ...string[]];
200
+ baseColumn: never;
201
+ identity: undefined;
202
+ generated: undefined;
203
+ }, {}, {}>;
204
+ value: import("drizzle-orm/pg-core").PgColumn<{
205
+ name: "value";
206
+ tableName: "build_labels";
207
+ dataType: "string";
208
+ columnType: "PgText";
209
+ data: string;
210
+ driverParam: string;
211
+ notNull: true;
212
+ hasDefault: false;
213
+ isPrimaryKey: false;
214
+ isAutoincrement: false;
215
+ hasRuntimeDefault: false;
216
+ enumValues: [string, ...string[]];
217
+ baseColumn: never;
218
+ identity: undefined;
219
+ generated: undefined;
220
+ }, {}, {}>;
221
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
222
+ name: "created_at";
223
+ tableName: "build_labels";
224
+ dataType: "string";
225
+ columnType: "PgTimestampString";
226
+ data: string;
227
+ driverParam: string;
228
+ notNull: true;
229
+ hasDefault: false;
230
+ isPrimaryKey: false;
231
+ isAutoincrement: false;
232
+ hasRuntimeDefault: false;
233
+ enumValues: undefined;
234
+ baseColumn: never;
235
+ identity: undefined;
236
+ generated: undefined;
237
+ }, {}, {}>;
238
+ };
239
+ dialect: 'pg';
240
+ }>;
241
+ /** A label-type row. */
242
+ interface LabelType {
243
+ id: string;
244
+ projectId: string;
245
+ key: string;
246
+ name: string;
247
+ linkTemplate: string | null;
248
+ color: string | null;
249
+ createdAt: string;
250
+ }
251
+ /** A build-label row. */
252
+ interface BuildLabel {
253
+ id: string;
254
+ projectId: string;
255
+ buildId: string;
256
+ typeKey: string;
257
+ value: string;
258
+ createdAt: string;
259
+ }
260
+ //#endregion
261
+ export { BuildLabel, LabelType, buildLabels, labelTypes };
262
+ //# sourceMappingURL=label.d.mts.map
@@ -0,0 +1,36 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { projects } from "./project.mjs";
5
+ import { builds } from "./build.mjs";
6
+ import { pgTable, text, timestamp, uniqueIndex } from "drizzle-orm/pg-core";
7
+ //#region src/schema/label.ts
8
+ /** Narrow `label_types` table definition. */
9
+ const labelTypes = pgTable("label_types", {
10
+ id: text("id").primaryKey(),
11
+ projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
12
+ key: text("key").notNull(),
13
+ name: text("name").notNull(),
14
+ linkTemplate: text("link_template"),
15
+ color: text("color"),
16
+ createdAt: timestamp("created_at", {
17
+ withTimezone: true,
18
+ mode: "string"
19
+ }).notNull()
20
+ }, (t) => [uniqueIndex("label_types_project_key_idx").on(t.projectId, t.key)]);
21
+ /** Narrow `build_labels` table definition. */
22
+ const buildLabels = pgTable("build_labels", {
23
+ id: text("id").primaryKey(),
24
+ projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
25
+ buildId: text("build_id").notNull().references(() => builds.id, { onDelete: "cascade" }),
26
+ typeKey: text("type_key").notNull(),
27
+ value: text("value").notNull(),
28
+ createdAt: timestamp("created_at", {
29
+ withTimezone: true,
30
+ mode: "string"
31
+ }).notNull()
32
+ }, (t) => [uniqueIndex("build_labels_build_type_value_idx").on(t.buildId, t.typeKey, t.value)]);
33
+ //#endregion
34
+ export { buildLabels, labelTypes };
35
+
36
+ //# sourceMappingURL=label.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"label.mjs","names":[],"sources":["../../src/schema/label.ts"],"sourcesContent":["import { pgTable, text, timestamp, uniqueIndex } from \"drizzle-orm/pg-core\";\nimport { builds } from \"./build.ts\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `label_types` table definition. */\nexport const labelTypes = pgTable(\n \"label_types\",\n {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n key: text(\"key\").notNull(),\n name: text(\"name\").notNull(),\n linkTemplate: text(\"link_template\"),\n color: text(\"color\"),\n createdAt: timestamp(\"created_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n },\n (t) => [uniqueIndex(\"label_types_project_key_idx\").on(t.projectId, t.key)],\n);\n\n/** Narrow `build_labels` table definition. */\nexport const buildLabels = pgTable(\n \"build_labels\",\n {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n buildId: text(\"build_id\")\n .notNull()\n .references(() => builds.id, { onDelete: \"cascade\" }),\n typeKey: text(\"type_key\").notNull(),\n value: text(\"value\").notNull(),\n createdAt: timestamp(\"created_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n },\n (t) => [uniqueIndex(\"build_labels_build_type_value_idx\").on(t.buildId, t.typeKey, t.value)],\n);\n\n/** A label-type row. */\nexport interface LabelType {\n id: string;\n projectId: string;\n key: string;\n name: string;\n linkTemplate: string | null;\n color: string | null;\n createdAt: string;\n}\n\n/** A build-label row. */\nexport interface BuildLabel {\n id: string;\n projectId: string;\n buildId: string;\n typeKey: string;\n value: string;\n createdAt: string;\n}\n"],"mappings":";;;;;;;;AAKA,MAAa,aAAa,QACxB,eACA;CACE,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,KAAK,KAAK,KAAK,CAAC,CAAC,QAAQ;CACzB,MAAM,KAAK,MAAM,CAAC,CAAC,QAAQ;CAC3B,cAAc,KAAK,eAAe;CAClC,OAAO,KAAK,OAAO;CACnB,WAAW,UAAU,cAAc;EAAE,cAAc;EAAM,MAAM;CAAS,CAAC,CAAC,CAAC,QAAQ;AACrF,IACC,MAAM,CAAC,YAAY,6BAA6B,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,CAAC,CAC3E;;AAGA,MAAa,cAAc,QACzB,gBACA;CACE,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,SAAS,KAAK,UAAU,CAAC,CACtB,QAAQ,CAAC,CACT,iBAAiB,OAAO,IAAI,EAAE,UAAU,UAAU,CAAC;CACtD,SAAS,KAAK,UAAU,CAAC,CAAC,QAAQ;CAClC,OAAO,KAAK,OAAO,CAAC,CAAC,QAAQ;CAC7B,WAAW,UAAU,cAAc;EAAE,cAAc;EAAM,MAAM;CAAS,CAAC,CAAC,CAAC,QAAQ;AACrF,IACC,MAAM,CAAC,YAAY,mCAAmC,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAC5F"}