@rudderhq/db 0.2.10-canary.8 → 0.2.10
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/dist/migrations/0080_stale_screwball.sql +3 -0
- package/dist/migrations/meta/0080_snapshot.json +51 -1
- package/dist/migrations/meta/_journal.json +8 -1
- package/dist/schema/organization_resources.d.ts +17 -0
- package/dist/schema/organization_resources.d.ts.map +1 -1
- package/dist/schema/organization_resources.js +7 -1
- package/dist/schema/organization_resources.js.map +1 -1
- package/dist/schema/plugin_entities.d.ts +2 -2
- package/dist/schema/plugin_jobs.d.ts +2 -2
- package/dist/schema/plugin_state.d.ts +2 -2
- package/dist/schema/plugins.d.ts +4 -4
- package/package.json +2 -2
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
ALTER TABLE "organization_resources" ADD COLUMN "source_type" text DEFAULT 'external' NOT NULL;--> statement-breakpoint
|
|
2
|
+
CREATE INDEX "organization_resources_org_source_type_idx" ON "organization_resources" USING btree ("org_id","source_type");--> statement-breakpoint
|
|
3
|
+
CREATE UNIQUE INDEX "organization_resources_org_library_locator_uq" ON "organization_resources" USING btree ("org_id","locator") WHERE "organization_resources"."source_type" = 'library';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "
|
|
2
|
+
"id": "3f6d6bbe-be3c-430f-b39d-33cc3afbe98b",
|
|
3
3
|
"prevId": "f179ced9-8d6e-4831-a4f0-3742b1e96d5c",
|
|
4
4
|
"version": "7",
|
|
5
5
|
"dialect": "postgresql",
|
|
@@ -11447,6 +11447,13 @@
|
|
|
11447
11447
|
"primaryKey": false,
|
|
11448
11448
|
"notNull": true
|
|
11449
11449
|
},
|
|
11450
|
+
"source_type": {
|
|
11451
|
+
"name": "source_type",
|
|
11452
|
+
"type": "text",
|
|
11453
|
+
"primaryKey": false,
|
|
11454
|
+
"notNull": true,
|
|
11455
|
+
"default": "'external'"
|
|
11456
|
+
},
|
|
11450
11457
|
"locator": {
|
|
11451
11458
|
"name": "locator",
|
|
11452
11459
|
"type": "text",
|
|
@@ -11516,6 +11523,49 @@
|
|
|
11516
11523
|
"concurrently": false,
|
|
11517
11524
|
"method": "btree",
|
|
11518
11525
|
"with": {}
|
|
11526
|
+
},
|
|
11527
|
+
"organization_resources_org_source_type_idx": {
|
|
11528
|
+
"name": "organization_resources_org_source_type_idx",
|
|
11529
|
+
"columns": [
|
|
11530
|
+
{
|
|
11531
|
+
"expression": "org_id",
|
|
11532
|
+
"isExpression": false,
|
|
11533
|
+
"asc": true,
|
|
11534
|
+
"nulls": "last"
|
|
11535
|
+
},
|
|
11536
|
+
{
|
|
11537
|
+
"expression": "source_type",
|
|
11538
|
+
"isExpression": false,
|
|
11539
|
+
"asc": true,
|
|
11540
|
+
"nulls": "last"
|
|
11541
|
+
}
|
|
11542
|
+
],
|
|
11543
|
+
"isUnique": false,
|
|
11544
|
+
"concurrently": false,
|
|
11545
|
+
"method": "btree",
|
|
11546
|
+
"with": {}
|
|
11547
|
+
},
|
|
11548
|
+
"organization_resources_org_library_locator_uq": {
|
|
11549
|
+
"name": "organization_resources_org_library_locator_uq",
|
|
11550
|
+
"columns": [
|
|
11551
|
+
{
|
|
11552
|
+
"expression": "org_id",
|
|
11553
|
+
"isExpression": false,
|
|
11554
|
+
"asc": true,
|
|
11555
|
+
"nulls": "last"
|
|
11556
|
+
},
|
|
11557
|
+
{
|
|
11558
|
+
"expression": "locator",
|
|
11559
|
+
"isExpression": false,
|
|
11560
|
+
"asc": true,
|
|
11561
|
+
"nulls": "last"
|
|
11562
|
+
}
|
|
11563
|
+
],
|
|
11564
|
+
"isUnique": true,
|
|
11565
|
+
"where": "\"organization_resources\".\"source_type\" = 'library'",
|
|
11566
|
+
"concurrently": false,
|
|
11567
|
+
"method": "btree",
|
|
11568
|
+
"with": {}
|
|
11519
11569
|
}
|
|
11520
11570
|
},
|
|
11521
11571
|
"foreignKeys": {
|
|
@@ -565,9 +565,16 @@
|
|
|
565
565
|
{
|
|
566
566
|
"idx": 80,
|
|
567
567
|
"version": "7",
|
|
568
|
+
"when": 1779872896181,
|
|
569
|
+
"tag": "0080_stale_screwball",
|
|
570
|
+
"breakpoints": true
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
"idx": 81,
|
|
574
|
+
"version": "7",
|
|
568
575
|
"when": 1780133410736,
|
|
569
576
|
"tag": "0080_curly_flatman",
|
|
570
577
|
"breakpoints": true
|
|
571
578
|
}
|
|
572
579
|
]
|
|
573
|
-
}
|
|
580
|
+
}
|
|
@@ -70,6 +70,23 @@ export declare const organizationResources: import("drizzle-orm/pg-core").PgTabl
|
|
|
70
70
|
identity: undefined;
|
|
71
71
|
generated: undefined;
|
|
72
72
|
}, {}, {}>;
|
|
73
|
+
sourceType: import("drizzle-orm/pg-core").PgColumn<{
|
|
74
|
+
name: "source_type";
|
|
75
|
+
tableName: "organization_resources";
|
|
76
|
+
dataType: "string";
|
|
77
|
+
columnType: "PgText";
|
|
78
|
+
data: string;
|
|
79
|
+
driverParam: string;
|
|
80
|
+
notNull: true;
|
|
81
|
+
hasDefault: true;
|
|
82
|
+
isPrimaryKey: false;
|
|
83
|
+
isAutoincrement: false;
|
|
84
|
+
hasRuntimeDefault: false;
|
|
85
|
+
enumValues: [string, ...string[]];
|
|
86
|
+
baseColumn: never;
|
|
87
|
+
identity: undefined;
|
|
88
|
+
generated: undefined;
|
|
89
|
+
}, {}, {}>;
|
|
73
90
|
locator: import("drizzle-orm/pg-core").PgColumn<{
|
|
74
91
|
name: "locator";
|
|
75
92
|
tableName: "organization_resources";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization_resources.d.ts","sourceRoot":"","sources":["../../src/schema/organization_resources.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"organization_resources.d.ts","sourceRoot":"","sources":["../../src/schema/organization_resources.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBjC,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { sql } from "drizzle-orm";
|
|
2
|
+
import { index, jsonb, pgTable, text, timestamp, uniqueIndex, uuid } from "drizzle-orm/pg-core";
|
|
2
3
|
import { organizations } from "./organizations.js";
|
|
3
4
|
export const organizationResources = pgTable("organization_resources", {
|
|
4
5
|
id: uuid("id").primaryKey().defaultRandom(),
|
|
5
6
|
orgId: uuid("org_id").notNull().references(() => organizations.id, { onDelete: "cascade" }),
|
|
6
7
|
name: text("name").notNull(),
|
|
7
8
|
kind: text("kind").notNull(),
|
|
9
|
+
sourceType: text("source_type").notNull().default("external"),
|
|
8
10
|
locator: text("locator").notNull(),
|
|
9
11
|
description: text("description"),
|
|
10
12
|
metadata: jsonb("metadata").$type(),
|
|
@@ -13,5 +15,9 @@ export const organizationResources = pgTable("organization_resources", {
|
|
|
13
15
|
}, (table) => ({
|
|
14
16
|
orgIdx: index("organization_resources_org_idx").on(table.orgId),
|
|
15
17
|
orgKindIdx: index("organization_resources_org_kind_idx").on(table.orgId, table.kind),
|
|
18
|
+
orgSourceTypeIdx: index("organization_resources_org_source_type_idx").on(table.orgId, table.sourceType),
|
|
19
|
+
orgLibraryLocatorUq: uniqueIndex("organization_resources_org_library_locator_uq")
|
|
20
|
+
.on(table.orgId, table.locator)
|
|
21
|
+
.where(sql `${table.sourceType} = 'library'`),
|
|
16
22
|
}));
|
|
17
23
|
//# sourceMappingURL=organization_resources.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization_resources.js","sourceRoot":"","sources":["../../src/schema/organization_resources.ts"],"names":[],"mappings":"AAAA,OAA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AAC,YAAY,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE;CAClF,EACD,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACV,MAAM,EAAE,KAAK,CAAC,gCAAgC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;IAC/D,UAAU,EAAE,KAAK,CAAC,qCAAqC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC;IACpF,gBAAgB,EAAE,KAAK,CAAC,4CAA4C,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC;IACvG,mBAAmB,EAAE,WAAW,CAAC,+CAA+C,CAAC;SAC9E,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;SAC9B,KAAK,CAAC,GAAG,CAAA,GAAG,KAAK,CAAC,UAAU,cAAc,CAAC;CAC/C,CAAC,CACH,CAAC"}
|
|
@@ -72,7 +72,7 @@ export declare const pluginEntities: import("drizzle-orm/pg-core").PgTableWithCo
|
|
|
72
72
|
tableName: "plugin_entities";
|
|
73
73
|
dataType: "string";
|
|
74
74
|
columnType: "PgText";
|
|
75
|
-
data: "issue" | "
|
|
75
|
+
data: "issue" | "agent" | "project" | "organization" | "goal" | "run" | "instance" | "project_workspace";
|
|
76
76
|
driverParam: string;
|
|
77
77
|
notNull: true;
|
|
78
78
|
hasDefault: false;
|
|
@@ -84,7 +84,7 @@ export declare const pluginEntities: import("drizzle-orm/pg-core").PgTableWithCo
|
|
|
84
84
|
identity: undefined;
|
|
85
85
|
generated: undefined;
|
|
86
86
|
}, {}, {
|
|
87
|
-
$type: "issue" | "
|
|
87
|
+
$type: "issue" | "agent" | "project" | "organization" | "goal" | "run" | "instance" | "project_workspace";
|
|
88
88
|
}>;
|
|
89
89
|
scopeId: import("drizzle-orm/pg-core").PgColumn<{
|
|
90
90
|
name: "scope_id";
|
|
@@ -268,7 +268,7 @@ export declare const pluginJobRuns: import("drizzle-orm/pg-core").PgTableWithCol
|
|
|
268
268
|
tableName: "plugin_job_runs";
|
|
269
269
|
dataType: "string";
|
|
270
270
|
columnType: "PgText";
|
|
271
|
-
data: "pending" | "queued" | "running" | "
|
|
271
|
+
data: "pending" | "queued" | "running" | "cancelled" | "failed" | "succeeded";
|
|
272
272
|
driverParam: string;
|
|
273
273
|
notNull: true;
|
|
274
274
|
hasDefault: true;
|
|
@@ -280,7 +280,7 @@ export declare const pluginJobRuns: import("drizzle-orm/pg-core").PgTableWithCol
|
|
|
280
280
|
identity: undefined;
|
|
281
281
|
generated: undefined;
|
|
282
282
|
}, {}, {
|
|
283
|
-
$type: "pending" | "queued" | "running" | "
|
|
283
|
+
$type: "pending" | "queued" | "running" | "cancelled" | "failed" | "succeeded";
|
|
284
284
|
}>;
|
|
285
285
|
durationMs: import("drizzle-orm/pg-core").PgColumn<{
|
|
286
286
|
name: "duration_ms";
|
|
@@ -64,7 +64,7 @@ export declare const pluginState: import("drizzle-orm/pg-core").PgTableWithColum
|
|
|
64
64
|
tableName: "plugin_state";
|
|
65
65
|
dataType: "string";
|
|
66
66
|
columnType: "PgText";
|
|
67
|
-
data: "issue" | "
|
|
67
|
+
data: "issue" | "agent" | "project" | "organization" | "goal" | "run" | "instance" | "project_workspace";
|
|
68
68
|
driverParam: string;
|
|
69
69
|
notNull: true;
|
|
70
70
|
hasDefault: false;
|
|
@@ -76,7 +76,7 @@ export declare const pluginState: import("drizzle-orm/pg-core").PgTableWithColum
|
|
|
76
76
|
identity: undefined;
|
|
77
77
|
generated: undefined;
|
|
78
78
|
}, {}, {
|
|
79
|
-
$type: "issue" | "
|
|
79
|
+
$type: "issue" | "agent" | "project" | "organization" | "goal" | "run" | "instance" | "project_workspace";
|
|
80
80
|
}>;
|
|
81
81
|
scopeId: import("drizzle-orm/pg-core").PgColumn<{
|
|
82
82
|
name: "scope_id";
|
package/dist/schema/plugins.d.ts
CHANGED
|
@@ -103,7 +103,7 @@ export declare const plugins: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
103
103
|
tableName: "plugins";
|
|
104
104
|
dataType: "json";
|
|
105
105
|
columnType: "PgJsonb";
|
|
106
|
-
data: ("
|
|
106
|
+
data: ("automation" | "connector" | "workspace" | "ui")[];
|
|
107
107
|
driverParam: unknown;
|
|
108
108
|
notNull: true;
|
|
109
109
|
hasDefault: true;
|
|
@@ -115,7 +115,7 @@ export declare const plugins: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
115
115
|
identity: undefined;
|
|
116
116
|
generated: undefined;
|
|
117
117
|
}, {}, {
|
|
118
|
-
$type: ("
|
|
118
|
+
$type: ("automation" | "connector" | "workspace" | "ui")[];
|
|
119
119
|
}>;
|
|
120
120
|
manifestJson: import("drizzle-orm/pg-core").PgColumn<{
|
|
121
121
|
name: "manifest_json";
|
|
@@ -141,7 +141,7 @@ export declare const plugins: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
141
141
|
tableName: "plugins";
|
|
142
142
|
dataType: "string";
|
|
143
143
|
columnType: "PgText";
|
|
144
|
-
data: "error" | "
|
|
144
|
+
data: "error" | "disabled" | "installed" | "ready" | "upgrade_pending" | "uninstalled";
|
|
145
145
|
driverParam: string;
|
|
146
146
|
notNull: true;
|
|
147
147
|
hasDefault: true;
|
|
@@ -153,7 +153,7 @@ export declare const plugins: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
153
153
|
identity: undefined;
|
|
154
154
|
generated: undefined;
|
|
155
155
|
}, {}, {
|
|
156
|
-
$type: "error" | "
|
|
156
|
+
$type: "error" | "disabled" | "installed" | "ready" | "upgrade_pending" | "uninstalled";
|
|
157
157
|
}>;
|
|
158
158
|
installOrder: import("drizzle-orm/pg-core").PgColumn<{
|
|
159
159
|
name: "install_order";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rudderhq/db",
|
|
3
|
-
"version": "0.2.10
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"homepage": "https://github.com/Undertone0809/rudder",
|
|
6
6
|
"bugs": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"seed": "tsx src/seed.ts"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@rudderhq/shared": "0.2.10
|
|
54
|
+
"@rudderhq/shared": "0.2.10",
|
|
55
55
|
"drizzle-orm": "^0.38.4",
|
|
56
56
|
"embedded-postgres": "18.1.0-beta.16",
|
|
57
57
|
"postgres": "^3.4.8"
|