@storyshelf/db-mysql 0.6.2 → 0.8.0
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 +36 -0
- package/dist/ddl.d.mts +1 -3
- package/dist/ddl.mjs +391 -141
- package/dist/ddl.mjs.map +1 -1
- package/dist/drizzle-factory-mysql.mjs +15 -8
- package/dist/drizzle-factory-mysql.mjs.map +1 -1
- package/dist/drizzle-factory.mjs +1 -2
- package/dist/foreign-keys.mjs +338 -0
- package/dist/foreign-keys.mjs.map +1 -0
- package/dist/index.d.mts +0 -2
- package/dist/index.mjs +11 -7
- package/dist/index.mjs.map +1 -1
- package/dist/migrate.mjs +349 -73
- package/dist/migrate.mjs.map +1 -1
- package/dist/planetscale.d.mts +0 -2
- package/dist/planetscale.mjs +1 -2
- package/dist/schema/baseline.d.mts +89 -19
- package/dist/schema/baseline.mjs +8 -4
- package/dist/schema/baseline.mjs.map +1 -1
- package/dist/schema/{status-config.d.mts → build-component.d.mts} +47 -42
- package/dist/schema/build-component.mjs +25 -0
- package/dist/schema/build-component.mjs.map +1 -0
- package/dist/schema/build-review.d.mts +116 -0
- package/dist/schema/build-review.mjs +23 -0
- package/dist/schema/build-review.mjs.map +1 -0
- package/dist/schema/build.d.mts +65 -31
- package/dist/schema/build.mjs +6 -3
- package/dist/schema/build.mjs.map +1 -1
- package/dist/schema/capture-attempt.d.mts +43 -45
- package/dist/schema/capture-attempt.mjs +3 -3
- package/dist/schema/capture-attempt.mjs.map +1 -1
- package/dist/schema/capture-job.d.mts +328 -0
- package/dist/schema/capture-job.mjs +56 -0
- package/dist/schema/capture-job.mjs.map +1 -0
- package/dist/schema/capture-shard.d.mts +255 -0
- package/dist/schema/capture-shard.mjs +40 -0
- package/dist/schema/capture-shard.mjs.map +1 -0
- package/dist/schema/comment.d.mts +35 -19
- package/dist/schema/comment.mjs +6 -5
- package/dist/schema/comment.mjs.map +1 -1
- package/dist/schema/connection.d.mts +171 -0
- package/dist/schema/connection.mjs +35 -0
- package/dist/schema/connection.mjs.map +1 -0
- package/dist/schema/content-refs.d.mts +11 -13
- package/dist/schema/content-refs.mjs +3 -3
- package/dist/schema/content-refs.mjs.map +1 -1
- package/dist/schema/datetime.mjs +46 -0
- package/dist/schema/datetime.mjs.map +1 -0
- package/dist/schema/design.d.mts +587 -0
- package/dist/schema/design.mjs +73 -0
- package/dist/schema/design.mjs.map +1 -0
- package/dist/schema/insight.d.mts +631 -0
- package/dist/schema/insight.mjs +68 -0
- package/dist/schema/insight.mjs.map +1 -0
- package/dist/schema/label.d.mts +21 -23
- package/dist/schema/label.mjs +3 -3
- package/dist/schema/label.mjs.map +1 -1
- package/dist/schema/member.d.mts +10 -12
- package/dist/schema/member.mjs +3 -3
- package/dist/schema/member.mjs.map +1 -1
- package/dist/schema/notification.d.mts +63 -29
- package/dist/schema/notification.mjs +8 -3
- package/dist/schema/notification.mjs.map +1 -1
- package/dist/schema/project-group-mapping.d.mts +9 -11
- package/dist/schema/project-group-mapping.mjs +3 -3
- package/dist/schema/project-group-mapping.mjs.map +1 -1
- package/dist/schema/project.d.mts +149 -25
- package/dist/schema/project.mjs +11 -4
- package/dist/schema/project.mjs.map +1 -1
- package/dist/schema/site-setting.d.mts +97 -0
- package/dist/schema/site-setting.mjs +23 -0
- package/dist/schema/site-setting.mjs.map +1 -0
- package/dist/schema/snapshot.d.mts +195 -35
- package/dist/schema/snapshot.mjs +17 -4
- package/dist/schema/snapshot.mjs.map +1 -1
- package/dist/schema/token.d.mts +14 -16
- package/dist/schema/token.mjs +3 -3
- package/dist/schema/token.mjs.map +1 -1
- package/dist/schema/usage.d.mts +265 -0
- package/dist/schema/usage.mjs +36 -0
- package/dist/schema/usage.mjs.map +1 -0
- package/dist/schema/user-invite.d.mts +16 -18
- package/dist/schema/user-invite.mjs +3 -3
- package/dist/schema/user-invite.mjs.map +1 -1
- package/dist/schema/user.d.mts +88 -16
- package/dist/schema/user.mjs +8 -4
- package/dist/schema/user.mjs.map +1 -1
- package/dist/schema/webhook.d.mts +14 -16
- package/dist/schema/webhook.mjs +3 -3
- package/dist/schema/webhook.mjs.map +1 -1
- package/dist/schema.d.mts +24 -5
- package/dist/schema.mjs +26 -6
- package/dist/schema.mjs.map +1 -1
- package/dist/tidb.d.mts +0 -2
- package/dist/tidb.mjs +1 -2
- package/package.json +7 -7
- package/dist/schema/status-config.mjs +0 -26
- package/dist/schema/status-config.mjs.map +0 -1
package/dist/schema/build.d.mts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { BuildStatus } from "@storyshelf/core/types";
|
|
4
|
-
//#region src/schema/build.d.ts
|
|
5
4
|
/** Narrow `builds` table definition. */
|
|
6
|
-
declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
5
|
+
declare const builds: import("drizzle-orm/mysql-core/table.js").MySqlTableWithColumns<{
|
|
7
6
|
name: "builds";
|
|
8
7
|
schema: undefined;
|
|
9
8
|
columns: {
|
|
10
|
-
id: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
9
|
+
id: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
11
10
|
name: "id";
|
|
12
11
|
tableName: "builds";
|
|
13
12
|
dataType: "string";
|
|
@@ -24,7 +23,7 @@ declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
24
23
|
identity: undefined;
|
|
25
24
|
generated: undefined;
|
|
26
25
|
}, {}, {}>;
|
|
27
|
-
projectId: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
26
|
+
projectId: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
28
27
|
name: "project_id";
|
|
29
28
|
tableName: "builds";
|
|
30
29
|
dataType: "string";
|
|
@@ -41,7 +40,7 @@ declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
41
40
|
identity: undefined;
|
|
42
41
|
generated: undefined;
|
|
43
42
|
}, {}, {}>;
|
|
44
|
-
gitSha: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
43
|
+
gitSha: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
45
44
|
name: "git_sha";
|
|
46
45
|
tableName: "builds";
|
|
47
46
|
dataType: "string";
|
|
@@ -58,7 +57,7 @@ declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
58
57
|
identity: undefined;
|
|
59
58
|
generated: undefined;
|
|
60
59
|
}, {}, {}>;
|
|
61
|
-
gitBranch: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
60
|
+
gitBranch: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
62
61
|
name: "git_branch";
|
|
63
62
|
tableName: "builds";
|
|
64
63
|
dataType: "string";
|
|
@@ -75,7 +74,7 @@ declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
75
74
|
identity: undefined;
|
|
76
75
|
generated: undefined;
|
|
77
76
|
}, {}, {}>;
|
|
78
|
-
isDefault: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
77
|
+
isDefault: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
79
78
|
name: "is_default";
|
|
80
79
|
tableName: "builds";
|
|
81
80
|
dataType: "boolean";
|
|
@@ -92,7 +91,7 @@ declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
92
91
|
identity: undefined;
|
|
93
92
|
generated: undefined;
|
|
94
93
|
}, {}, {}>;
|
|
95
|
-
authorEmail: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
94
|
+
authorEmail: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
96
95
|
name: "author_email";
|
|
97
96
|
tableName: "builds";
|
|
98
97
|
dataType: "string";
|
|
@@ -109,7 +108,7 @@ declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
109
108
|
identity: undefined;
|
|
110
109
|
generated: undefined;
|
|
111
110
|
}, {}, {}>;
|
|
112
|
-
authorName: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
111
|
+
authorName: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
113
112
|
name: "author_name";
|
|
114
113
|
tableName: "builds";
|
|
115
114
|
dataType: "string";
|
|
@@ -126,7 +125,7 @@ declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
126
125
|
identity: undefined;
|
|
127
126
|
generated: undefined;
|
|
128
127
|
}, {}, {}>;
|
|
129
|
-
message: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
128
|
+
message: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
130
129
|
name: "message";
|
|
131
130
|
tableName: "builds";
|
|
132
131
|
dataType: "string";
|
|
@@ -143,7 +142,7 @@ declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
143
142
|
identity: undefined;
|
|
144
143
|
generated: undefined;
|
|
145
144
|
}, {}, {}>;
|
|
146
|
-
public: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
145
|
+
public: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
147
146
|
name: "public";
|
|
148
147
|
tableName: "builds";
|
|
149
148
|
dataType: "boolean";
|
|
@@ -160,12 +159,12 @@ declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
160
159
|
identity: undefined;
|
|
161
160
|
generated: undefined;
|
|
162
161
|
}, {}, {}>;
|
|
163
|
-
status: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
162
|
+
status: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
164
163
|
name: "status";
|
|
165
164
|
tableName: "builds";
|
|
166
165
|
dataType: "string";
|
|
167
166
|
columnType: "MySqlText";
|
|
168
|
-
data: "approved" | "capturing" | "comparing" | "failed" | "pending" | "rejected" | "reviewing";
|
|
167
|
+
data: "approved" | "cancelled" | "capturing" | "comparing" | "failed" | "pending" | "rejected" | "reviewing";
|
|
169
168
|
driverParam: string;
|
|
170
169
|
notNull: true;
|
|
171
170
|
hasDefault: true;
|
|
@@ -177,9 +176,9 @@ declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
177
176
|
identity: undefined;
|
|
178
177
|
generated: undefined;
|
|
179
178
|
}, {}, {
|
|
180
|
-
$type: "approved" | "capturing" | "comparing" | "failed" | "pending" | "rejected" | "reviewing";
|
|
179
|
+
$type: "approved" | "cancelled" | "capturing" | "comparing" | "failed" | "pending" | "rejected" | "reviewing";
|
|
181
180
|
}>;
|
|
182
|
-
snapshotCount: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
181
|
+
snapshotCount: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
183
182
|
name: "snapshot_count";
|
|
184
183
|
tableName: "builds";
|
|
185
184
|
dataType: "number";
|
|
@@ -196,7 +195,7 @@ declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
196
195
|
identity: undefined;
|
|
197
196
|
generated: undefined;
|
|
198
197
|
}, {}, {}>;
|
|
199
|
-
changedCount: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
198
|
+
changedCount: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
200
199
|
name: "changed_count";
|
|
201
200
|
tableName: "builds";
|
|
202
201
|
dataType: "number";
|
|
@@ -213,7 +212,7 @@ declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
213
212
|
identity: undefined;
|
|
214
213
|
generated: undefined;
|
|
215
214
|
}, {}, {}>;
|
|
216
|
-
approvedCount: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
215
|
+
approvedCount: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
217
216
|
name: "approved_count";
|
|
218
217
|
tableName: "builds";
|
|
219
218
|
dataType: "number";
|
|
@@ -230,7 +229,7 @@ declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
230
229
|
identity: undefined;
|
|
231
230
|
generated: undefined;
|
|
232
231
|
}, {}, {}>;
|
|
233
|
-
rejectedCount: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
232
|
+
rejectedCount: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
234
233
|
name: "rejected_count";
|
|
235
234
|
tableName: "builds";
|
|
236
235
|
dataType: "number";
|
|
@@ -247,7 +246,24 @@ declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
247
246
|
identity: undefined;
|
|
248
247
|
generated: undefined;
|
|
249
248
|
}, {}, {}>;
|
|
250
|
-
|
|
249
|
+
inheritedCount: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
250
|
+
name: "inherited_count";
|
|
251
|
+
tableName: "builds";
|
|
252
|
+
dataType: "number";
|
|
253
|
+
columnType: "MySqlInt";
|
|
254
|
+
data: number;
|
|
255
|
+
driverParam: string | number;
|
|
256
|
+
notNull: true;
|
|
257
|
+
hasDefault: true;
|
|
258
|
+
isPrimaryKey: false;
|
|
259
|
+
isAutoincrement: false;
|
|
260
|
+
hasRuntimeDefault: false;
|
|
261
|
+
enumValues: undefined;
|
|
262
|
+
baseColumn: never;
|
|
263
|
+
identity: undefined;
|
|
264
|
+
generated: undefined;
|
|
265
|
+
}, {}, {}>;
|
|
266
|
+
affectedOnly: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
251
267
|
name: "affected_only";
|
|
252
268
|
tableName: "builds";
|
|
253
269
|
dataType: "boolean";
|
|
@@ -264,7 +280,7 @@ declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
264
280
|
identity: undefined;
|
|
265
281
|
generated: undefined;
|
|
266
282
|
}, {}, {}>;
|
|
267
|
-
baselineSha: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
283
|
+
baselineSha: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
268
284
|
name: "baseline_sha";
|
|
269
285
|
tableName: "builds";
|
|
270
286
|
dataType: "string";
|
|
@@ -281,7 +297,7 @@ declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
281
297
|
identity: undefined;
|
|
282
298
|
generated: undefined;
|
|
283
299
|
}, {}, {}>;
|
|
284
|
-
changedFiles: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
300
|
+
changedFiles: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
285
301
|
name: "changed_files";
|
|
286
302
|
tableName: "builds";
|
|
287
303
|
dataType: "string";
|
|
@@ -298,7 +314,7 @@ declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
298
314
|
identity: undefined;
|
|
299
315
|
generated: undefined;
|
|
300
316
|
}, {}, {}>;
|
|
301
|
-
affectedImportPaths: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
317
|
+
affectedImportPaths: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
302
318
|
name: "affected_import_paths";
|
|
303
319
|
tableName: "builds";
|
|
304
320
|
dataType: "string";
|
|
@@ -315,13 +331,30 @@ declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
315
331
|
identity: undefined;
|
|
316
332
|
generated: undefined;
|
|
317
333
|
}, {}, {}>;
|
|
318
|
-
|
|
319
|
-
name: "
|
|
334
|
+
testResults: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
335
|
+
name: "test_results";
|
|
320
336
|
tableName: "builds";
|
|
321
337
|
dataType: "string";
|
|
322
|
-
columnType: "
|
|
338
|
+
columnType: "MySqlText";
|
|
323
339
|
data: string;
|
|
324
|
-
driverParam: string
|
|
340
|
+
driverParam: string;
|
|
341
|
+
notNull: false;
|
|
342
|
+
hasDefault: false;
|
|
343
|
+
isPrimaryKey: false;
|
|
344
|
+
isAutoincrement: false;
|
|
345
|
+
hasRuntimeDefault: false;
|
|
346
|
+
enumValues: [string, ...string[]];
|
|
347
|
+
baseColumn: never;
|
|
348
|
+
identity: undefined;
|
|
349
|
+
generated: undefined;
|
|
350
|
+
}, {}, {}>;
|
|
351
|
+
createdAt: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
352
|
+
name: "created_at";
|
|
353
|
+
tableName: "builds";
|
|
354
|
+
dataType: "custom";
|
|
355
|
+
columnType: "MySqlCustomColumn";
|
|
356
|
+
data: string;
|
|
357
|
+
driverParam: string;
|
|
325
358
|
notNull: true;
|
|
326
359
|
hasDefault: false;
|
|
327
360
|
isPrimaryKey: false;
|
|
@@ -332,13 +365,13 @@ declare const builds: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
332
365
|
identity: undefined;
|
|
333
366
|
generated: undefined;
|
|
334
367
|
}, {}, {}>;
|
|
335
|
-
updatedAt: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
368
|
+
updatedAt: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
336
369
|
name: "updated_at";
|
|
337
370
|
tableName: "builds";
|
|
338
|
-
dataType: "
|
|
339
|
-
columnType: "
|
|
371
|
+
dataType: "custom";
|
|
372
|
+
columnType: "MySqlCustomColumn";
|
|
340
373
|
data: string;
|
|
341
|
-
driverParam: string
|
|
374
|
+
driverParam: string;
|
|
342
375
|
notNull: true;
|
|
343
376
|
hasDefault: false;
|
|
344
377
|
isPrimaryKey: false;
|
|
@@ -368,13 +401,14 @@ interface Build {
|
|
|
368
401
|
changedCount: number;
|
|
369
402
|
approvedCount: number;
|
|
370
403
|
rejectedCount: number;
|
|
404
|
+
inheritedCount: number;
|
|
371
405
|
affectedOnly: boolean;
|
|
372
406
|
baselineSha: string | null;
|
|
373
407
|
changedFiles: string | null;
|
|
374
408
|
affectedImportPaths: string | null;
|
|
409
|
+
testResults: string | null;
|
|
375
410
|
createdAt: string;
|
|
376
411
|
updatedAt: string;
|
|
377
412
|
}
|
|
378
|
-
//#endregion
|
|
379
413
|
export { Build, builds };
|
|
380
414
|
//# sourceMappingURL=build.d.mts.map
|
package/dist/schema/build.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import "node:path";
|
|
2
2
|
import "node:url";
|
|
3
3
|
import.meta.url;
|
|
4
|
+
import { datetime } from "./datetime.mjs";
|
|
4
5
|
import { projects } from "./project.mjs";
|
|
5
|
-
import { boolean,
|
|
6
|
-
|
|
6
|
+
import { boolean, index, int, mysqlTable, text } from "drizzle-orm/mysql-core";
|
|
7
|
+
// src/schema/build.ts
|
|
7
8
|
/** Narrow `builds` table definition. */
|
|
8
9
|
const builds = mysqlTable("builds", {
|
|
9
10
|
id: text("id").primaryKey(),
|
|
@@ -20,10 +21,13 @@ const builds = mysqlTable("builds", {
|
|
|
20
21
|
changedCount: int("changed_count").notNull().default(0),
|
|
21
22
|
approvedCount: int("approved_count").notNull().default(0),
|
|
22
23
|
rejectedCount: int("rejected_count").notNull().default(0),
|
|
24
|
+
/** Snapshots inherited from the baseline without rendering (affected capture). */
|
|
25
|
+
inheritedCount: int("inherited_count").notNull().default(0),
|
|
23
26
|
affectedOnly: boolean("affected_only").notNull().default(true),
|
|
24
27
|
baselineSha: text("baseline_sha"),
|
|
25
28
|
changedFiles: text("changed_files"),
|
|
26
29
|
affectedImportPaths: text("affected_import_paths"),
|
|
30
|
+
testResults: text("test_results"),
|
|
27
31
|
createdAt: datetime("created_at", {
|
|
28
32
|
mode: "string",
|
|
29
33
|
fsp: 3
|
|
@@ -33,7 +37,6 @@ const builds = mysqlTable("builds", {
|
|
|
33
37
|
fsp: 3
|
|
34
38
|
}).notNull()
|
|
35
39
|
}, (t) => [index("builds_project_gitsha_idx").on(t.projectId, t.gitSha), index("builds_git_branch_idx").on(t.gitBranch)]);
|
|
36
|
-
//#endregion
|
|
37
40
|
export { builds };
|
|
38
41
|
|
|
39
42
|
//# sourceMappingURL=build.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.mjs","names":[],"sources":["../../src/schema/build.ts"],"sourcesContent":["import type { BuildStatus } from \"@storyshelf/core/types\";\nimport { boolean, index, int, mysqlTable, text
|
|
1
|
+
{"version":3,"file":"build.mjs","names":[],"sources":["../../src/schema/build.ts"],"sourcesContent":["import type { BuildStatus } from \"@storyshelf/core/types\";\nimport { boolean, index, int, mysqlTable, text } from \"drizzle-orm/mysql-core\";\nimport { datetime } from \"./datetime.ts\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `builds` table definition. */\nexport const builds = mysqlTable(\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: boolean(\"is_default\").notNull().default(false),\n authorEmail: text(\"author_email\"),\n authorName: text(\"author_name\"),\n message: text(\"message\"),\n public: boolean(\"public\").notNull().default(false),\n status: text(\"status\").$type<BuildStatus>().notNull().default(\"pending\"),\n snapshotCount: int(\"snapshot_count\").notNull().default(0),\n changedCount: int(\"changed_count\").notNull().default(0),\n approvedCount: int(\"approved_count\").notNull().default(0),\n rejectedCount: int(\"rejected_count\").notNull().default(0),\n /** Snapshots inherited from the baseline without rendering (affected capture). */\n inheritedCount: int(\"inherited_count\").notNull().default(0),\n affectedOnly: boolean(\"affected_only\").notNull().default(true),\n baselineSha: text(\"baseline_sha\"),\n changedFiles: text(\"changed_files\"),\n affectedImportPaths: text(\"affected_import_paths\"),\n testResults: text(\"test_results\"),\n createdAt: datetime(\"created_at\", { mode: \"string\", fsp: 3 }).notNull(),\n updatedAt: datetime(\"updated_at\", { mode: \"string\", fsp: 3 }).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 inheritedCount: number;\n affectedOnly: boolean;\n baselineSha: string | null;\n changedFiles: string | null;\n affectedImportPaths: string | null;\n testResults: string | null;\n createdAt: string;\n updatedAt: string;\n}\n"],"mappings":";;;;;;;;AAMA,MAAa,SAAS,WACpB,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,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CACxD,aAAa,KAAK,cAAc;CAChC,YAAY,KAAK,aAAa;CAC9B,SAAS,KAAK,SAAS;CACvB,QAAQ,QAAQ,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CACjD,QAAQ,KAAK,QAAQ,CAAC,CAAC,MAAmB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,SAAS;CACvE,eAAe,IAAI,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CACxD,cAAc,IAAI,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CACtD,eAAe,IAAI,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CACxD,eAAe,IAAI,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;;CAExD,gBAAgB,IAAI,iBAAiB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CAC1D,cAAc,QAAQ,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,IAAI;CAC7D,aAAa,KAAK,cAAc;CAChC,cAAc,KAAK,eAAe;CAClC,qBAAqB,KAAK,uBAAuB;CACjD,aAAa,KAAK,cAAc;CAChC,WAAW,SAAS,cAAc;EAAE,MAAM;EAAU,KAAK;CAAE,CAAC,CAAC,CAAC,QAAQ;CACtE,WAAW,SAAS,cAAc;EAAE,MAAM;EAAU,KAAK;CAAE,CAAC,CAAC,CAAC,QAAQ;AACxE,IACC,MAAM,CACL,MAAM,2BAA2B,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,GAC3D,MAAM,uBAAuB,CAAC,CAAC,GAAG,EAAE,SAAS,CAC/C,CACF"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { JobStatus } from "@storyshelf/core/adapter/capture-queue";
|
|
4
|
-
//#region src/schema/capture-attempt.d.ts
|
|
5
4
|
/** Narrow `capture_attempts` table definition: one row per build capture run. */
|
|
6
|
-
declare const captureAttempts: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
5
|
+
declare const captureAttempts: import("drizzle-orm/mysql-core/table.js").MySqlTableWithColumns<{
|
|
7
6
|
name: "capture_attempts";
|
|
8
7
|
schema: undefined;
|
|
9
8
|
columns: {
|
|
10
|
-
id: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
9
|
+
id: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
11
10
|
name: "id";
|
|
12
11
|
tableName: "capture_attempts";
|
|
13
12
|
dataType: "string";
|
|
@@ -24,7 +23,7 @@ declare const captureAttempts: import("drizzle-orm/mysql-core").MySqlTableWithCo
|
|
|
24
23
|
identity: undefined;
|
|
25
24
|
generated: undefined;
|
|
26
25
|
}, {}, {}>;
|
|
27
|
-
projectId: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
26
|
+
projectId: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
28
27
|
name: "project_id";
|
|
29
28
|
tableName: "capture_attempts";
|
|
30
29
|
dataType: "string";
|
|
@@ -41,7 +40,7 @@ declare const captureAttempts: import("drizzle-orm/mysql-core").MySqlTableWithCo
|
|
|
41
40
|
identity: undefined;
|
|
42
41
|
generated: undefined;
|
|
43
42
|
}, {}, {}>;
|
|
44
|
-
buildId: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
43
|
+
buildId: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
45
44
|
name: "build_id";
|
|
46
45
|
tableName: "capture_attempts";
|
|
47
46
|
dataType: "string";
|
|
@@ -58,7 +57,7 @@ declare const captureAttempts: import("drizzle-orm/mysql-core").MySqlTableWithCo
|
|
|
58
57
|
identity: undefined;
|
|
59
58
|
generated: undefined;
|
|
60
59
|
}, {}, {}>;
|
|
61
|
-
attemptNo: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
60
|
+
attemptNo: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
62
61
|
name: "attempt_no";
|
|
63
62
|
tableName: "capture_attempts";
|
|
64
63
|
dataType: "number";
|
|
@@ -75,7 +74,7 @@ declare const captureAttempts: import("drizzle-orm/mysql-core").MySqlTableWithCo
|
|
|
75
74
|
identity: undefined;
|
|
76
75
|
generated: undefined;
|
|
77
76
|
}, {}, {}>;
|
|
78
|
-
status: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
77
|
+
status: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
79
78
|
name: "status";
|
|
80
79
|
tableName: "capture_attempts";
|
|
81
80
|
dataType: "string";
|
|
@@ -94,7 +93,7 @@ declare const captureAttempts: import("drizzle-orm/mysql-core").MySqlTableWithCo
|
|
|
94
93
|
}, {}, {
|
|
95
94
|
$type: JobStatus;
|
|
96
95
|
}>;
|
|
97
|
-
error: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
96
|
+
error: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
98
97
|
name: "error";
|
|
99
98
|
tableName: "capture_attempts";
|
|
100
99
|
dataType: "string";
|
|
@@ -111,7 +110,7 @@ declare const captureAttempts: import("drizzle-orm/mysql-core").MySqlTableWithCo
|
|
|
111
110
|
identity: undefined;
|
|
112
111
|
generated: undefined;
|
|
113
112
|
}, {}, {}>;
|
|
114
|
-
reqId: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
113
|
+
reqId: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
115
114
|
name: "req_id";
|
|
116
115
|
tableName: "capture_attempts";
|
|
117
116
|
dataType: "string";
|
|
@@ -128,7 +127,7 @@ declare const captureAttempts: import("drizzle-orm/mysql-core").MySqlTableWithCo
|
|
|
128
127
|
identity: undefined;
|
|
129
128
|
generated: undefined;
|
|
130
129
|
}, {}, {}>;
|
|
131
|
-
storyCount: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
130
|
+
storyCount: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
132
131
|
name: "story_count";
|
|
133
132
|
tableName: "capture_attempts";
|
|
134
133
|
dataType: "number";
|
|
@@ -145,7 +144,7 @@ declare const captureAttempts: import("drizzle-orm/mysql-core").MySqlTableWithCo
|
|
|
145
144
|
identity: undefined;
|
|
146
145
|
generated: undefined;
|
|
147
146
|
}, {}, {}>;
|
|
148
|
-
failedCount: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
147
|
+
failedCount: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
149
148
|
name: "failed_count";
|
|
150
149
|
tableName: "capture_attempts";
|
|
151
150
|
dataType: "number";
|
|
@@ -162,13 +161,13 @@ declare const captureAttempts: import("drizzle-orm/mysql-core").MySqlTableWithCo
|
|
|
162
161
|
identity: undefined;
|
|
163
162
|
generated: undefined;
|
|
164
163
|
}, {}, {}>;
|
|
165
|
-
queuedAt: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
164
|
+
queuedAt: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
166
165
|
name: "queued_at";
|
|
167
166
|
tableName: "capture_attempts";
|
|
168
|
-
dataType: "
|
|
169
|
-
columnType: "
|
|
167
|
+
dataType: "custom";
|
|
168
|
+
columnType: "MySqlCustomColumn";
|
|
170
169
|
data: string;
|
|
171
|
-
driverParam: string
|
|
170
|
+
driverParam: string;
|
|
172
171
|
notNull: true;
|
|
173
172
|
hasDefault: false;
|
|
174
173
|
isPrimaryKey: false;
|
|
@@ -179,13 +178,13 @@ declare const captureAttempts: import("drizzle-orm/mysql-core").MySqlTableWithCo
|
|
|
179
178
|
identity: undefined;
|
|
180
179
|
generated: undefined;
|
|
181
180
|
}, {}, {}>;
|
|
182
|
-
startedAt: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
181
|
+
startedAt: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
183
182
|
name: "started_at";
|
|
184
183
|
tableName: "capture_attempts";
|
|
185
|
-
dataType: "
|
|
186
|
-
columnType: "
|
|
184
|
+
dataType: "custom";
|
|
185
|
+
columnType: "MySqlCustomColumn";
|
|
187
186
|
data: string;
|
|
188
|
-
driverParam: string
|
|
187
|
+
driverParam: string;
|
|
189
188
|
notNull: false;
|
|
190
189
|
hasDefault: false;
|
|
191
190
|
isPrimaryKey: false;
|
|
@@ -196,13 +195,13 @@ declare const captureAttempts: import("drizzle-orm/mysql-core").MySqlTableWithCo
|
|
|
196
195
|
identity: undefined;
|
|
197
196
|
generated: undefined;
|
|
198
197
|
}, {}, {}>;
|
|
199
|
-
finishedAt: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
198
|
+
finishedAt: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
200
199
|
name: "finished_at";
|
|
201
200
|
tableName: "capture_attempts";
|
|
202
|
-
dataType: "
|
|
203
|
-
columnType: "
|
|
201
|
+
dataType: "custom";
|
|
202
|
+
columnType: "MySqlCustomColumn";
|
|
204
203
|
data: string;
|
|
205
|
-
driverParam: string
|
|
204
|
+
driverParam: string;
|
|
206
205
|
notNull: false;
|
|
207
206
|
hasDefault: false;
|
|
208
207
|
isPrimaryKey: false;
|
|
@@ -213,13 +212,13 @@ declare const captureAttempts: import("drizzle-orm/mysql-core").MySqlTableWithCo
|
|
|
213
212
|
identity: undefined;
|
|
214
213
|
generated: undefined;
|
|
215
214
|
}, {}, {}>;
|
|
216
|
-
createdAt: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
215
|
+
createdAt: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
217
216
|
name: "created_at";
|
|
218
217
|
tableName: "capture_attempts";
|
|
219
|
-
dataType: "
|
|
220
|
-
columnType: "
|
|
218
|
+
dataType: "custom";
|
|
219
|
+
columnType: "MySqlCustomColumn";
|
|
221
220
|
data: string;
|
|
222
|
-
driverParam: string
|
|
221
|
+
driverParam: string;
|
|
223
222
|
notNull: true;
|
|
224
223
|
hasDefault: false;
|
|
225
224
|
isPrimaryKey: false;
|
|
@@ -230,13 +229,13 @@ declare const captureAttempts: import("drizzle-orm/mysql-core").MySqlTableWithCo
|
|
|
230
229
|
identity: undefined;
|
|
231
230
|
generated: undefined;
|
|
232
231
|
}, {}, {}>;
|
|
233
|
-
updatedAt: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
232
|
+
updatedAt: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
234
233
|
name: "updated_at";
|
|
235
234
|
tableName: "capture_attempts";
|
|
236
|
-
dataType: "
|
|
237
|
-
columnType: "
|
|
235
|
+
dataType: "custom";
|
|
236
|
+
columnType: "MySqlCustomColumn";
|
|
238
237
|
data: string;
|
|
239
|
-
driverParam: string
|
|
238
|
+
driverParam: string;
|
|
240
239
|
notNull: true;
|
|
241
240
|
hasDefault: false;
|
|
242
241
|
isPrimaryKey: false;
|
|
@@ -251,11 +250,11 @@ declare const captureAttempts: import("drizzle-orm/mysql-core").MySqlTableWithCo
|
|
|
251
250
|
dialect: 'mysql';
|
|
252
251
|
}>;
|
|
253
252
|
/** Narrow `capture_logs` table definition: every log line of an attempt. */
|
|
254
|
-
declare const captureLogs: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
253
|
+
declare const captureLogs: import("drizzle-orm/mysql-core/table.js").MySqlTableWithColumns<{
|
|
255
254
|
name: "capture_logs";
|
|
256
255
|
schema: undefined;
|
|
257
256
|
columns: {
|
|
258
|
-
id: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
257
|
+
id: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
259
258
|
name: "id";
|
|
260
259
|
tableName: "capture_logs";
|
|
261
260
|
dataType: "string";
|
|
@@ -272,7 +271,7 @@ declare const captureLogs: import("drizzle-orm/mysql-core").MySqlTableWithColumn
|
|
|
272
271
|
identity: undefined;
|
|
273
272
|
generated: undefined;
|
|
274
273
|
}, {}, {}>;
|
|
275
|
-
projectId: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
274
|
+
projectId: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
276
275
|
name: "project_id";
|
|
277
276
|
tableName: "capture_logs";
|
|
278
277
|
dataType: "string";
|
|
@@ -289,7 +288,7 @@ declare const captureLogs: import("drizzle-orm/mysql-core").MySqlTableWithColumn
|
|
|
289
288
|
identity: undefined;
|
|
290
289
|
generated: undefined;
|
|
291
290
|
}, {}, {}>;
|
|
292
|
-
buildId: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
291
|
+
buildId: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
293
292
|
name: "build_id";
|
|
294
293
|
tableName: "capture_logs";
|
|
295
294
|
dataType: "string";
|
|
@@ -306,7 +305,7 @@ declare const captureLogs: import("drizzle-orm/mysql-core").MySqlTableWithColumn
|
|
|
306
305
|
identity: undefined;
|
|
307
306
|
generated: undefined;
|
|
308
307
|
}, {}, {}>;
|
|
309
|
-
attemptId: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
308
|
+
attemptId: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
310
309
|
name: "attempt_id";
|
|
311
310
|
tableName: "capture_logs";
|
|
312
311
|
dataType: "string";
|
|
@@ -323,7 +322,7 @@ declare const captureLogs: import("drizzle-orm/mysql-core").MySqlTableWithColumn
|
|
|
323
322
|
identity: undefined;
|
|
324
323
|
generated: undefined;
|
|
325
324
|
}, {}, {}>;
|
|
326
|
-
seq: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
325
|
+
seq: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
327
326
|
name: "seq";
|
|
328
327
|
tableName: "capture_logs";
|
|
329
328
|
dataType: "number";
|
|
@@ -340,7 +339,7 @@ declare const captureLogs: import("drizzle-orm/mysql-core").MySqlTableWithColumn
|
|
|
340
339
|
identity: undefined;
|
|
341
340
|
generated: undefined;
|
|
342
341
|
}, {}, {}>;
|
|
343
|
-
level: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
342
|
+
level: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
344
343
|
name: "level";
|
|
345
344
|
tableName: "capture_logs";
|
|
346
345
|
dataType: "string";
|
|
@@ -357,7 +356,7 @@ declare const captureLogs: import("drizzle-orm/mysql-core").MySqlTableWithColumn
|
|
|
357
356
|
identity: undefined;
|
|
358
357
|
generated: undefined;
|
|
359
358
|
}, {}, {}>;
|
|
360
|
-
message: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
359
|
+
message: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
361
360
|
name: "message";
|
|
362
361
|
tableName: "capture_logs";
|
|
363
362
|
dataType: "string";
|
|
@@ -374,7 +373,7 @@ declare const captureLogs: import("drizzle-orm/mysql-core").MySqlTableWithColumn
|
|
|
374
373
|
identity: undefined;
|
|
375
374
|
generated: undefined;
|
|
376
375
|
}, {}, {}>;
|
|
377
|
-
fields: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
376
|
+
fields: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
378
377
|
name: "fields";
|
|
379
378
|
tableName: "capture_logs";
|
|
380
379
|
dataType: "string";
|
|
@@ -391,13 +390,13 @@ declare const captureLogs: import("drizzle-orm/mysql-core").MySqlTableWithColumn
|
|
|
391
390
|
identity: undefined;
|
|
392
391
|
generated: undefined;
|
|
393
392
|
}, {}, {}>;
|
|
394
|
-
createdAt: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
393
|
+
createdAt: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
395
394
|
name: "created_at";
|
|
396
395
|
tableName: "capture_logs";
|
|
397
|
-
dataType: "
|
|
398
|
-
columnType: "
|
|
396
|
+
dataType: "custom";
|
|
397
|
+
columnType: "MySqlCustomColumn";
|
|
399
398
|
data: string;
|
|
400
|
-
driverParam: string
|
|
399
|
+
driverParam: string;
|
|
401
400
|
notNull: true;
|
|
402
401
|
hasDefault: false;
|
|
403
402
|
isPrimaryKey: false;
|
|
@@ -440,6 +439,5 @@ interface CaptureLog {
|
|
|
440
439
|
fields: string | null;
|
|
441
440
|
createdAt: string;
|
|
442
441
|
}
|
|
443
|
-
//#endregion
|
|
444
442
|
export { CaptureAttempt, CaptureLog, captureAttempts, captureLogs };
|
|
445
443
|
//# sourceMappingURL=capture-attempt.d.mts.map
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "node:path";
|
|
2
2
|
import "node:url";
|
|
3
3
|
import.meta.url;
|
|
4
|
+
import { datetime } from "./datetime.mjs";
|
|
4
5
|
import { projects } from "./project.mjs";
|
|
5
6
|
import { builds } from "./build.mjs";
|
|
6
|
-
import {
|
|
7
|
-
|
|
7
|
+
import { index, int, mysqlTable, text, uniqueIndex } from "drizzle-orm/mysql-core";
|
|
8
|
+
// src/schema/capture-attempt.ts
|
|
8
9
|
/** Narrow `capture_attempts` table definition: one row per build capture run. */
|
|
9
10
|
const captureAttempts = mysqlTable("capture_attempts", {
|
|
10
11
|
id: text("id").primaryKey(),
|
|
@@ -52,7 +53,6 @@ const captureLogs = mysqlTable("capture_logs", {
|
|
|
52
53
|
fsp: 3
|
|
53
54
|
}).notNull()
|
|
54
55
|
}, (t) => [index("capture_logs_attempt_seq_idx").on(t.attemptId, t.seq)]);
|
|
55
|
-
//#endregion
|
|
56
56
|
export { captureAttempts, captureLogs };
|
|
57
57
|
|
|
58
58
|
//# sourceMappingURL=capture-attempt.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture-attempt.mjs","names":[],"sources":["../../src/schema/capture-attempt.ts"],"sourcesContent":["import type { JobStatus } from \"@storyshelf/core/adapter/capture-queue\";\nimport { index, int, mysqlTable, text,
|
|
1
|
+
{"version":3,"file":"capture-attempt.mjs","names":[],"sources":["../../src/schema/capture-attempt.ts"],"sourcesContent":["import type { JobStatus } from \"@storyshelf/core/adapter/capture-queue\";\nimport { index, int, mysqlTable, text, uniqueIndex } from \"drizzle-orm/mysql-core\";\nimport { builds } from \"./build.ts\";\nimport { datetime } from \"./datetime.ts\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `capture_attempts` table definition: one row per build capture run. */\nexport const captureAttempts = mysqlTable(\n \"capture_attempts\",\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 attemptNo: int(\"attempt_no\").notNull(),\n status: text(\"status\").$type<JobStatus>().notNull().default(\"queued\"),\n error: text(\"error\"),\n reqId: text(\"req_id\"),\n storyCount: int(\"story_count\").notNull().default(0),\n failedCount: int(\"failed_count\").notNull().default(0),\n queuedAt: datetime(\"queued_at\", { mode: \"string\", fsp: 3 }).notNull(),\n startedAt: datetime(\"started_at\", { mode: \"string\", fsp: 3 }),\n finishedAt: datetime(\"finished_at\", { mode: \"string\", fsp: 3 }),\n createdAt: datetime(\"created_at\", { mode: \"string\", fsp: 3 }).notNull(),\n updatedAt: datetime(\"updated_at\", { mode: \"string\", fsp: 3 }).notNull(),\n },\n (t) => [\n uniqueIndex(\"capture_attempts_build_no_idx\").on(t.buildId, t.attemptNo),\n index(\"capture_attempts_build_id_idx\").on(t.buildId),\n ],\n);\n\n/** Narrow `capture_logs` table definition: every log line of an attempt. */\nexport const captureLogs = mysqlTable(\n \"capture_logs\",\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 attemptId: text(\"attempt_id\")\n .notNull()\n .references(() => captureAttempts.id, { onDelete: \"cascade\" }),\n seq: int(\"seq\").notNull(),\n level: text(\"level\").notNull().default(\"info\"),\n message: text(\"message\").notNull(),\n fields: text(\"fields\"),\n createdAt: datetime(\"created_at\", { mode: \"string\", fsp: 3 }).notNull(),\n },\n (t) => [index(\"capture_logs_attempt_seq_idx\").on(t.attemptId, t.seq)],\n);\n\n/** A capture attempt row. */\nexport interface CaptureAttempt {\n id: string;\n projectId: string;\n buildId: string;\n attemptNo: number;\n status: JobStatus;\n error: string | null;\n reqId: string | null;\n storyCount: number;\n failedCount: number;\n queuedAt: string;\n startedAt: string | null;\n finishedAt: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\n/** A capture log line row. */\nexport interface CaptureLog {\n id: string;\n projectId: string;\n buildId: string;\n attemptId: string;\n seq: number;\n level: string;\n message: string;\n fields: string | null;\n createdAt: string;\n}\n"],"mappings":";;;;;;;;;AAOA,MAAa,kBAAkB,WAC7B,oBACA;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,WAAW,IAAI,YAAY,CAAC,CAAC,QAAQ;CACrC,QAAQ,KAAK,QAAQ,CAAC,CAAC,MAAiB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,QAAQ;CACpE,OAAO,KAAK,OAAO;CACnB,OAAO,KAAK,QAAQ;CACpB,YAAY,IAAI,aAAa,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CAClD,aAAa,IAAI,cAAc,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CACpD,UAAU,SAAS,aAAa;EAAE,MAAM;EAAU,KAAK;CAAE,CAAC,CAAC,CAAC,QAAQ;CACpE,WAAW,SAAS,cAAc;EAAE,MAAM;EAAU,KAAK;CAAE,CAAC;CAC5D,YAAY,SAAS,eAAe;EAAE,MAAM;EAAU,KAAK;CAAE,CAAC;CAC9D,WAAW,SAAS,cAAc;EAAE,MAAM;EAAU,KAAK;CAAE,CAAC,CAAC,CAAC,QAAQ;CACtE,WAAW,SAAS,cAAc;EAAE,MAAM;EAAU,KAAK;CAAE,CAAC,CAAC,CAAC,QAAQ;AACxE,IACC,MAAM,CACL,YAAY,+BAA+B,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,SAAS,GACtE,MAAM,+BAA+B,CAAC,CAAC,GAAG,EAAE,OAAO,CACrD,CACF;;AAGA,MAAa,cAAc,WACzB,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,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,gBAAgB,IAAI,EAAE,UAAU,UAAU,CAAC;CAC/D,KAAK,IAAI,KAAK,CAAC,CAAC,QAAQ;CACxB,OAAO,KAAK,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,MAAM;CAC7C,SAAS,KAAK,SAAS,CAAC,CAAC,QAAQ;CACjC,QAAQ,KAAK,QAAQ;CACrB,WAAW,SAAS,cAAc;EAAE,MAAM;EAAU,KAAK;CAAE,CAAC,CAAC,CAAC,QAAQ;AACxE,IACC,MAAM,CAAC,MAAM,8BAA8B,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,CAAC,CACtE"}
|