@storyshelf/db-sqlite 0.3.2 → 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.
- package/README.md +29 -3
- package/dist/better-sqlite3.d.mts +29 -0
- package/dist/better-sqlite3.mjs +116 -0
- package/dist/better-sqlite3.mjs.map +1 -0
- package/dist/bun-sqlite.d.mts +30 -0
- package/dist/bun-sqlite.mjs +120 -0
- package/dist/bun-sqlite.mjs.map +1 -0
- package/dist/d1.d.mts +38 -0
- package/dist/d1.mjs +108 -0
- package/dist/d1.mjs.map +1 -0
- package/dist/ddl.d.mts +14 -0
- package/dist/ddl.mjs +342 -0
- package/dist/ddl.mjs.map +1 -0
- package/dist/drizzle-factory.d.mts +19 -0
- package/dist/drizzle-factory.mjs +121 -0
- package/dist/drizzle-factory.mjs.map +1 -0
- package/dist/index.mjs +102 -36
- package/dist/index.mjs.map +1 -1
- package/dist/schema/baseline.d.mts +204 -0
- package/dist/schema/baseline.mjs +23 -0
- package/dist/schema/baseline.mjs.map +1 -0
- package/dist/schema/build.d.mts +405 -0
- package/dist/schema/build.mjs +33 -0
- package/dist/schema/build.mjs.map +1 -0
- package/dist/schema/capture-attempt.d.mts +482 -0
- package/dist/schema/capture-attempt.mjs +40 -0
- package/dist/schema/capture-attempt.mjs.map +1 -0
- package/dist/schema/comment.d.mts +215 -0
- package/dist/schema/comment.mjs +26 -0
- package/dist/schema/comment.mjs.map +1 -0
- package/dist/schema/content-refs.d.mts +95 -0
- package/dist/schema/content-refs.mjs +16 -0
- package/dist/schema/content-refs.mjs.map +1 -0
- package/dist/schema/label.d.mts +288 -0
- package/dist/schema/label.mjs +30 -0
- package/dist/schema/label.mjs.map +1 -0
- package/dist/schema/member.d.mts +140 -0
- package/dist/schema/member.mjs +20 -0
- package/dist/schema/member.mjs.map +1 -0
- package/dist/schema/notification.d.mts +344 -0
- package/dist/schema/notification.mjs +33 -0
- package/dist/schema/notification.mjs.map +1 -0
- package/dist/schema/project-group-mapping.d.mts +119 -0
- package/dist/schema/project-group-mapping.mjs +18 -0
- package/dist/schema/project-group-mapping.mjs.map +1 -0
- package/dist/schema/project.d.mts +358 -0
- package/dist/schema/project.mjs +29 -0
- package/dist/schema/project.mjs.map +1 -0
- package/dist/schema/snapshot.d.mts +487 -0
- package/dist/schema/snapshot.mjs +38 -0
- package/dist/schema/snapshot.mjs.map +1 -0
- package/dist/schema/status-config.d.mts +157 -0
- package/dist/schema/status-config.mjs +20 -0
- package/dist/schema/status-config.mjs.map +1 -0
- package/dist/schema/token.d.mts +157 -0
- package/dist/schema/token.mjs +21 -0
- package/dist/schema/token.mjs.map +1 -0
- package/dist/schema/user-invite.d.mts +137 -0
- package/dist/schema/user-invite.mjs +19 -0
- package/dist/schema/user-invite.mjs.map +1 -0
- package/dist/schema/user.d.mts +238 -0
- package/dist/schema/user.mjs +23 -0
- package/dist/schema/user.mjs.map +1 -0
- package/dist/schema/webhook.d.mts +157 -0
- package/dist/schema/webhook.mjs +20 -0
- package/dist/schema/webhook.mjs.map +1 -0
- package/dist/schema.d.mts +47 -0
- package/dist/schema.mjs +46 -0
- package/dist/schema.mjs.map +1 -0
- package/dist/turso.d.mts +32 -0
- package/dist/turso.mjs +134 -0
- package/dist/turso.mjs.map +1 -0
- package/package.json +66 -10
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { BuildStatus } from "@storyshelf/core/types";
|
|
4
|
+
//#region src/schema/build.d.ts
|
|
5
|
+
/** Narrow `builds` table definition. */
|
|
6
|
+
declare const builds: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
7
|
+
name: "builds";
|
|
8
|
+
schema: undefined;
|
|
9
|
+
columns: {
|
|
10
|
+
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
11
|
+
name: "id";
|
|
12
|
+
tableName: "builds";
|
|
13
|
+
dataType: "string";
|
|
14
|
+
columnType: "SQLiteText";
|
|
15
|
+
data: string;
|
|
16
|
+
driverParam: string;
|
|
17
|
+
notNull: true;
|
|
18
|
+
hasDefault: false;
|
|
19
|
+
isPrimaryKey: true;
|
|
20
|
+
isAutoincrement: false;
|
|
21
|
+
hasRuntimeDefault: false;
|
|
22
|
+
enumValues: [string, ...string[]];
|
|
23
|
+
baseColumn: never;
|
|
24
|
+
identity: undefined;
|
|
25
|
+
generated: undefined;
|
|
26
|
+
}, {}, {
|
|
27
|
+
length: number | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
projectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
30
|
+
name: "project_id";
|
|
31
|
+
tableName: "builds";
|
|
32
|
+
dataType: "string";
|
|
33
|
+
columnType: "SQLiteText";
|
|
34
|
+
data: string;
|
|
35
|
+
driverParam: string;
|
|
36
|
+
notNull: true;
|
|
37
|
+
hasDefault: false;
|
|
38
|
+
isPrimaryKey: false;
|
|
39
|
+
isAutoincrement: false;
|
|
40
|
+
hasRuntimeDefault: false;
|
|
41
|
+
enumValues: [string, ...string[]];
|
|
42
|
+
baseColumn: never;
|
|
43
|
+
identity: undefined;
|
|
44
|
+
generated: undefined;
|
|
45
|
+
}, {}, {
|
|
46
|
+
length: number | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
gitSha: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
49
|
+
name: "git_sha";
|
|
50
|
+
tableName: "builds";
|
|
51
|
+
dataType: "string";
|
|
52
|
+
columnType: "SQLiteText";
|
|
53
|
+
data: string;
|
|
54
|
+
driverParam: string;
|
|
55
|
+
notNull: true;
|
|
56
|
+
hasDefault: false;
|
|
57
|
+
isPrimaryKey: false;
|
|
58
|
+
isAutoincrement: false;
|
|
59
|
+
hasRuntimeDefault: false;
|
|
60
|
+
enumValues: [string, ...string[]];
|
|
61
|
+
baseColumn: never;
|
|
62
|
+
identity: undefined;
|
|
63
|
+
generated: undefined;
|
|
64
|
+
}, {}, {
|
|
65
|
+
length: number | undefined;
|
|
66
|
+
}>;
|
|
67
|
+
gitBranch: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
68
|
+
name: "git_branch";
|
|
69
|
+
tableName: "builds";
|
|
70
|
+
dataType: "string";
|
|
71
|
+
columnType: "SQLiteText";
|
|
72
|
+
data: string;
|
|
73
|
+
driverParam: string;
|
|
74
|
+
notNull: true;
|
|
75
|
+
hasDefault: false;
|
|
76
|
+
isPrimaryKey: false;
|
|
77
|
+
isAutoincrement: false;
|
|
78
|
+
hasRuntimeDefault: false;
|
|
79
|
+
enumValues: [string, ...string[]];
|
|
80
|
+
baseColumn: never;
|
|
81
|
+
identity: undefined;
|
|
82
|
+
generated: undefined;
|
|
83
|
+
}, {}, {
|
|
84
|
+
length: number | undefined;
|
|
85
|
+
}>;
|
|
86
|
+
isDefault: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
87
|
+
name: "is_default";
|
|
88
|
+
tableName: "builds";
|
|
89
|
+
dataType: "boolean";
|
|
90
|
+
columnType: "SQLiteBoolean";
|
|
91
|
+
data: boolean;
|
|
92
|
+
driverParam: number;
|
|
93
|
+
notNull: true;
|
|
94
|
+
hasDefault: true;
|
|
95
|
+
isPrimaryKey: false;
|
|
96
|
+
isAutoincrement: false;
|
|
97
|
+
hasRuntimeDefault: false;
|
|
98
|
+
enumValues: undefined;
|
|
99
|
+
baseColumn: never;
|
|
100
|
+
identity: undefined;
|
|
101
|
+
generated: undefined;
|
|
102
|
+
}, {}, {}>;
|
|
103
|
+
authorEmail: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
104
|
+
name: "author_email";
|
|
105
|
+
tableName: "builds";
|
|
106
|
+
dataType: "string";
|
|
107
|
+
columnType: "SQLiteText";
|
|
108
|
+
data: string;
|
|
109
|
+
driverParam: string;
|
|
110
|
+
notNull: false;
|
|
111
|
+
hasDefault: false;
|
|
112
|
+
isPrimaryKey: false;
|
|
113
|
+
isAutoincrement: false;
|
|
114
|
+
hasRuntimeDefault: false;
|
|
115
|
+
enumValues: [string, ...string[]];
|
|
116
|
+
baseColumn: never;
|
|
117
|
+
identity: undefined;
|
|
118
|
+
generated: undefined;
|
|
119
|
+
}, {}, {
|
|
120
|
+
length: number | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
authorName: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
123
|
+
name: "author_name";
|
|
124
|
+
tableName: "builds";
|
|
125
|
+
dataType: "string";
|
|
126
|
+
columnType: "SQLiteText";
|
|
127
|
+
data: string;
|
|
128
|
+
driverParam: string;
|
|
129
|
+
notNull: false;
|
|
130
|
+
hasDefault: false;
|
|
131
|
+
isPrimaryKey: false;
|
|
132
|
+
isAutoincrement: false;
|
|
133
|
+
hasRuntimeDefault: false;
|
|
134
|
+
enumValues: [string, ...string[]];
|
|
135
|
+
baseColumn: never;
|
|
136
|
+
identity: undefined;
|
|
137
|
+
generated: undefined;
|
|
138
|
+
}, {}, {
|
|
139
|
+
length: number | undefined;
|
|
140
|
+
}>;
|
|
141
|
+
message: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
142
|
+
name: "message";
|
|
143
|
+
tableName: "builds";
|
|
144
|
+
dataType: "string";
|
|
145
|
+
columnType: "SQLiteText";
|
|
146
|
+
data: string;
|
|
147
|
+
driverParam: string;
|
|
148
|
+
notNull: false;
|
|
149
|
+
hasDefault: false;
|
|
150
|
+
isPrimaryKey: false;
|
|
151
|
+
isAutoincrement: false;
|
|
152
|
+
hasRuntimeDefault: false;
|
|
153
|
+
enumValues: [string, ...string[]];
|
|
154
|
+
baseColumn: never;
|
|
155
|
+
identity: undefined;
|
|
156
|
+
generated: undefined;
|
|
157
|
+
}, {}, {
|
|
158
|
+
length: number | undefined;
|
|
159
|
+
}>;
|
|
160
|
+
public: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
161
|
+
name: "public";
|
|
162
|
+
tableName: "builds";
|
|
163
|
+
dataType: "boolean";
|
|
164
|
+
columnType: "SQLiteBoolean";
|
|
165
|
+
data: boolean;
|
|
166
|
+
driverParam: number;
|
|
167
|
+
notNull: true;
|
|
168
|
+
hasDefault: true;
|
|
169
|
+
isPrimaryKey: false;
|
|
170
|
+
isAutoincrement: false;
|
|
171
|
+
hasRuntimeDefault: false;
|
|
172
|
+
enumValues: undefined;
|
|
173
|
+
baseColumn: never;
|
|
174
|
+
identity: undefined;
|
|
175
|
+
generated: undefined;
|
|
176
|
+
}, {}, {}>;
|
|
177
|
+
status: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
178
|
+
name: "status";
|
|
179
|
+
tableName: "builds";
|
|
180
|
+
dataType: "string";
|
|
181
|
+
columnType: "SQLiteText";
|
|
182
|
+
data: "approved" | "capturing" | "comparing" | "failed" | "pending" | "rejected" | "reviewing";
|
|
183
|
+
driverParam: string;
|
|
184
|
+
notNull: true;
|
|
185
|
+
hasDefault: true;
|
|
186
|
+
isPrimaryKey: false;
|
|
187
|
+
isAutoincrement: false;
|
|
188
|
+
hasRuntimeDefault: false;
|
|
189
|
+
enumValues: [string, ...string[]];
|
|
190
|
+
baseColumn: never;
|
|
191
|
+
identity: undefined;
|
|
192
|
+
generated: undefined;
|
|
193
|
+
}, {}, {
|
|
194
|
+
length: number | undefined;
|
|
195
|
+
$type: "approved" | "capturing" | "comparing" | "failed" | "pending" | "rejected" | "reviewing";
|
|
196
|
+
}>;
|
|
197
|
+
snapshotCount: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
198
|
+
name: "snapshot_count";
|
|
199
|
+
tableName: "builds";
|
|
200
|
+
dataType: "number";
|
|
201
|
+
columnType: "SQLiteInteger";
|
|
202
|
+
data: number;
|
|
203
|
+
driverParam: number;
|
|
204
|
+
notNull: true;
|
|
205
|
+
hasDefault: true;
|
|
206
|
+
isPrimaryKey: false;
|
|
207
|
+
isAutoincrement: false;
|
|
208
|
+
hasRuntimeDefault: false;
|
|
209
|
+
enumValues: undefined;
|
|
210
|
+
baseColumn: never;
|
|
211
|
+
identity: undefined;
|
|
212
|
+
generated: undefined;
|
|
213
|
+
}, {}, {}>;
|
|
214
|
+
changedCount: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
215
|
+
name: "changed_count";
|
|
216
|
+
tableName: "builds";
|
|
217
|
+
dataType: "number";
|
|
218
|
+
columnType: "SQLiteInteger";
|
|
219
|
+
data: number;
|
|
220
|
+
driverParam: number;
|
|
221
|
+
notNull: true;
|
|
222
|
+
hasDefault: true;
|
|
223
|
+
isPrimaryKey: false;
|
|
224
|
+
isAutoincrement: false;
|
|
225
|
+
hasRuntimeDefault: false;
|
|
226
|
+
enumValues: undefined;
|
|
227
|
+
baseColumn: never;
|
|
228
|
+
identity: undefined;
|
|
229
|
+
generated: undefined;
|
|
230
|
+
}, {}, {}>;
|
|
231
|
+
approvedCount: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
232
|
+
name: "approved_count";
|
|
233
|
+
tableName: "builds";
|
|
234
|
+
dataType: "number";
|
|
235
|
+
columnType: "SQLiteInteger";
|
|
236
|
+
data: number;
|
|
237
|
+
driverParam: number;
|
|
238
|
+
notNull: true;
|
|
239
|
+
hasDefault: true;
|
|
240
|
+
isPrimaryKey: false;
|
|
241
|
+
isAutoincrement: false;
|
|
242
|
+
hasRuntimeDefault: false;
|
|
243
|
+
enumValues: undefined;
|
|
244
|
+
baseColumn: never;
|
|
245
|
+
identity: undefined;
|
|
246
|
+
generated: undefined;
|
|
247
|
+
}, {}, {}>;
|
|
248
|
+
rejectedCount: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
249
|
+
name: "rejected_count";
|
|
250
|
+
tableName: "builds";
|
|
251
|
+
dataType: "number";
|
|
252
|
+
columnType: "SQLiteInteger";
|
|
253
|
+
data: number;
|
|
254
|
+
driverParam: number;
|
|
255
|
+
notNull: true;
|
|
256
|
+
hasDefault: true;
|
|
257
|
+
isPrimaryKey: false;
|
|
258
|
+
isAutoincrement: false;
|
|
259
|
+
hasRuntimeDefault: false;
|
|
260
|
+
enumValues: undefined;
|
|
261
|
+
baseColumn: never;
|
|
262
|
+
identity: undefined;
|
|
263
|
+
generated: undefined;
|
|
264
|
+
}, {}, {}>;
|
|
265
|
+
affectedOnly: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
266
|
+
name: "affected_only";
|
|
267
|
+
tableName: "builds";
|
|
268
|
+
dataType: "boolean";
|
|
269
|
+
columnType: "SQLiteBoolean";
|
|
270
|
+
data: boolean;
|
|
271
|
+
driverParam: number;
|
|
272
|
+
notNull: true;
|
|
273
|
+
hasDefault: true;
|
|
274
|
+
isPrimaryKey: false;
|
|
275
|
+
isAutoincrement: false;
|
|
276
|
+
hasRuntimeDefault: false;
|
|
277
|
+
enumValues: undefined;
|
|
278
|
+
baseColumn: never;
|
|
279
|
+
identity: undefined;
|
|
280
|
+
generated: undefined;
|
|
281
|
+
}, {}, {}>;
|
|
282
|
+
baselineSha: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
283
|
+
name: "baseline_sha";
|
|
284
|
+
tableName: "builds";
|
|
285
|
+
dataType: "string";
|
|
286
|
+
columnType: "SQLiteText";
|
|
287
|
+
data: string;
|
|
288
|
+
driverParam: string;
|
|
289
|
+
notNull: false;
|
|
290
|
+
hasDefault: false;
|
|
291
|
+
isPrimaryKey: false;
|
|
292
|
+
isAutoincrement: false;
|
|
293
|
+
hasRuntimeDefault: false;
|
|
294
|
+
enumValues: [string, ...string[]];
|
|
295
|
+
baseColumn: never;
|
|
296
|
+
identity: undefined;
|
|
297
|
+
generated: undefined;
|
|
298
|
+
}, {}, {
|
|
299
|
+
length: number | undefined;
|
|
300
|
+
}>;
|
|
301
|
+
changedFiles: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
302
|
+
name: "changed_files";
|
|
303
|
+
tableName: "builds";
|
|
304
|
+
dataType: "string";
|
|
305
|
+
columnType: "SQLiteText";
|
|
306
|
+
data: string;
|
|
307
|
+
driverParam: string;
|
|
308
|
+
notNull: false;
|
|
309
|
+
hasDefault: false;
|
|
310
|
+
isPrimaryKey: false;
|
|
311
|
+
isAutoincrement: false;
|
|
312
|
+
hasRuntimeDefault: false;
|
|
313
|
+
enumValues: [string, ...string[]];
|
|
314
|
+
baseColumn: never;
|
|
315
|
+
identity: undefined;
|
|
316
|
+
generated: undefined;
|
|
317
|
+
}, {}, {
|
|
318
|
+
length: number | undefined;
|
|
319
|
+
}>;
|
|
320
|
+
affectedImportPaths: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
321
|
+
name: "affected_import_paths";
|
|
322
|
+
tableName: "builds";
|
|
323
|
+
dataType: "string";
|
|
324
|
+
columnType: "SQLiteText";
|
|
325
|
+
data: string;
|
|
326
|
+
driverParam: string;
|
|
327
|
+
notNull: false;
|
|
328
|
+
hasDefault: false;
|
|
329
|
+
isPrimaryKey: false;
|
|
330
|
+
isAutoincrement: false;
|
|
331
|
+
hasRuntimeDefault: false;
|
|
332
|
+
enumValues: [string, ...string[]];
|
|
333
|
+
baseColumn: never;
|
|
334
|
+
identity: undefined;
|
|
335
|
+
generated: undefined;
|
|
336
|
+
}, {}, {
|
|
337
|
+
length: number | undefined;
|
|
338
|
+
}>;
|
|
339
|
+
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
340
|
+
name: "created_at";
|
|
341
|
+
tableName: "builds";
|
|
342
|
+
dataType: "string";
|
|
343
|
+
columnType: "SQLiteText";
|
|
344
|
+
data: string;
|
|
345
|
+
driverParam: string;
|
|
346
|
+
notNull: true;
|
|
347
|
+
hasDefault: false;
|
|
348
|
+
isPrimaryKey: false;
|
|
349
|
+
isAutoincrement: false;
|
|
350
|
+
hasRuntimeDefault: false;
|
|
351
|
+
enumValues: [string, ...string[]];
|
|
352
|
+
baseColumn: never;
|
|
353
|
+
identity: undefined;
|
|
354
|
+
generated: undefined;
|
|
355
|
+
}, {}, {
|
|
356
|
+
length: number | undefined;
|
|
357
|
+
}>;
|
|
358
|
+
updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
359
|
+
name: "updated_at";
|
|
360
|
+
tableName: "builds";
|
|
361
|
+
dataType: "string";
|
|
362
|
+
columnType: "SQLiteText";
|
|
363
|
+
data: string;
|
|
364
|
+
driverParam: string;
|
|
365
|
+
notNull: true;
|
|
366
|
+
hasDefault: false;
|
|
367
|
+
isPrimaryKey: false;
|
|
368
|
+
isAutoincrement: false;
|
|
369
|
+
hasRuntimeDefault: false;
|
|
370
|
+
enumValues: [string, ...string[]];
|
|
371
|
+
baseColumn: never;
|
|
372
|
+
identity: undefined;
|
|
373
|
+
generated: undefined;
|
|
374
|
+
}, {}, {
|
|
375
|
+
length: number | undefined;
|
|
376
|
+
}>;
|
|
377
|
+
};
|
|
378
|
+
dialect: 'sqlite';
|
|
379
|
+
}>;
|
|
380
|
+
/** A build row. */
|
|
381
|
+
interface Build {
|
|
382
|
+
id: string;
|
|
383
|
+
projectId: string;
|
|
384
|
+
gitSha: string;
|
|
385
|
+
gitBranch: string;
|
|
386
|
+
isDefault: boolean;
|
|
387
|
+
authorEmail: string | null;
|
|
388
|
+
authorName: string | null;
|
|
389
|
+
message: string | null;
|
|
390
|
+
public: boolean;
|
|
391
|
+
status: BuildStatus;
|
|
392
|
+
snapshotCount: number;
|
|
393
|
+
changedCount: number;
|
|
394
|
+
approvedCount: number;
|
|
395
|
+
rejectedCount: number;
|
|
396
|
+
affectedOnly: boolean;
|
|
397
|
+
baselineSha: string | null;
|
|
398
|
+
changedFiles: string | null;
|
|
399
|
+
affectedImportPaths: string | null;
|
|
400
|
+
createdAt: string;
|
|
401
|
+
updatedAt: string;
|
|
402
|
+
}
|
|
403
|
+
//#endregion
|
|
404
|
+
export { Build, builds };
|
|
405
|
+
//# sourceMappingURL=build.d.mts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { projects } from "./project.mjs";
|
|
5
|
+
import { index, integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
|
|
6
|
+
//#region src/schema/build.ts
|
|
7
|
+
/** Narrow `builds` table definition. */
|
|
8
|
+
const builds = sqliteTable("builds", {
|
|
9
|
+
id: text("id").primaryKey(),
|
|
10
|
+
projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
11
|
+
gitSha: text("git_sha").notNull(),
|
|
12
|
+
gitBranch: text("git_branch").notNull(),
|
|
13
|
+
isDefault: integer("is_default", { mode: "boolean" }).notNull().default(false),
|
|
14
|
+
authorEmail: text("author_email"),
|
|
15
|
+
authorName: text("author_name"),
|
|
16
|
+
message: text("message"),
|
|
17
|
+
public: integer("public", { mode: "boolean" }).notNull().default(false),
|
|
18
|
+
status: text("status").$type().notNull().default("pending"),
|
|
19
|
+
snapshotCount: integer("snapshot_count").notNull().default(0),
|
|
20
|
+
changedCount: integer("changed_count").notNull().default(0),
|
|
21
|
+
approvedCount: integer("approved_count").notNull().default(0),
|
|
22
|
+
rejectedCount: integer("rejected_count").notNull().default(0),
|
|
23
|
+
affectedOnly: integer("affected_only", { mode: "boolean" }).notNull().default(true),
|
|
24
|
+
baselineSha: text("baseline_sha"),
|
|
25
|
+
changedFiles: text("changed_files"),
|
|
26
|
+
affectedImportPaths: text("affected_import_paths"),
|
|
27
|
+
createdAt: text("created_at").notNull(),
|
|
28
|
+
updatedAt: text("updated_at").notNull()
|
|
29
|
+
}, (t) => [index("builds_project_gitsha_idx").on(t.projectId, t.gitSha), index("builds_git_branch_idx").on(t.gitBranch)]);
|
|
30
|
+
//#endregion
|
|
31
|
+
export { builds };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=build.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.mjs","names":[],"sources":["../../src/schema/build.ts"],"sourcesContent":["import type { BuildStatus } from \"@storyshelf/core/types\";\nimport { index, integer, sqliteTable, text } from \"drizzle-orm/sqlite-core\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `builds` table definition. */\nexport const builds = sqliteTable(\n \"builds\",\n {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n gitSha: text(\"git_sha\").notNull(),\n gitBranch: text(\"git_branch\").notNull(),\n isDefault: integer(\"is_default\", { mode: \"boolean\" }).notNull().default(false),\n authorEmail: text(\"author_email\"),\n authorName: text(\"author_name\"),\n message: text(\"message\"),\n public: integer(\"public\", { mode: \"boolean\" }).notNull().default(false),\n status: text(\"status\").$type<BuildStatus>().notNull().default(\"pending\"),\n snapshotCount: integer(\"snapshot_count\").notNull().default(0),\n changedCount: integer(\"changed_count\").notNull().default(0),\n approvedCount: integer(\"approved_count\").notNull().default(0),\n rejectedCount: integer(\"rejected_count\").notNull().default(0),\n affectedOnly: integer(\"affected_only\", { mode: \"boolean\" }).notNull().default(true),\n baselineSha: text(\"baseline_sha\"),\n changedFiles: text(\"changed_files\"),\n affectedImportPaths: text(\"affected_import_paths\"),\n createdAt: text(\"created_at\").notNull(),\n updatedAt: text(\"updated_at\").notNull(),\n },\n (t) => [\n index(\"builds_project_gitsha_idx\").on(t.projectId, t.gitSha),\n index(\"builds_git_branch_idx\").on(t.gitBranch),\n ],\n);\n\n/** A build row. */\nexport interface Build {\n id: string;\n projectId: string;\n gitSha: string;\n gitBranch: string;\n isDefault: boolean;\n authorEmail: string | null;\n authorName: string | null;\n message: string | null;\n public: boolean;\n status: BuildStatus;\n snapshotCount: number;\n changedCount: number;\n approvedCount: number;\n rejectedCount: number;\n affectedOnly: boolean;\n baselineSha: string | null;\n changedFiles: string | null;\n affectedImportPaths: string | null;\n createdAt: string;\n updatedAt: string;\n}\n"],"mappings":";;;;;;;AAKA,MAAa,SAAS,YACpB,UACA;CACE,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,QAAQ,KAAK,SAAS,CAAC,CAAC,QAAQ;CAChC,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;CACtC,WAAW,QAAQ,cAAc,EAAE,MAAM,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CAC7E,aAAa,KAAK,cAAc;CAChC,YAAY,KAAK,aAAa;CAC9B,SAAS,KAAK,SAAS;CACvB,QAAQ,QAAQ,UAAU,EAAE,MAAM,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CACtE,QAAQ,KAAK,QAAQ,CAAC,CAAC,MAAmB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,SAAS;CACvE,eAAe,QAAQ,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CAC5D,cAAc,QAAQ,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CAC1D,eAAe,QAAQ,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CAC5D,eAAe,QAAQ,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CAC5D,cAAc,QAAQ,iBAAiB,EAAE,MAAM,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,IAAI;CAClF,aAAa,KAAK,cAAc;CAChC,cAAc,KAAK,eAAe;CAClC,qBAAqB,KAAK,uBAAuB;CACjD,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;CACtC,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,IACC,MAAM,CACL,MAAM,2BAA2B,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,GAC3D,MAAM,uBAAuB,CAAC,CAAC,GAAG,EAAE,SAAS,CAC/C,CACF"}
|