@dbos-inc/dbos-sdk 0.8.61-preview → 0.8.67-preview.g1cdd64bc60
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/schemas/user_db_schema.d.ts +1 -0
- package/dist/schemas/user_db_schema.d.ts.map +1 -1
- package/dist/schemas/user_db_schema.js +4 -1
- package/dist/schemas/user_db_schema.js.map +1 -1
- package/dist/src/dbos-executor.d.ts +6 -2
- package/dist/src/dbos-executor.d.ts.map +1 -1
- package/dist/src/dbos-executor.js +18 -21
- package/dist/src/dbos-executor.js.map +1 -1
- package/dist/src/dbos-runtime/migrate.js +1 -0
- package/dist/src/dbos-runtime/migrate.js.map +1 -1
- package/dist/src/error.d.ts +3 -0
- package/dist/src/error.d.ts.map +1 -1
- package/dist/src/error.js +8 -1
- package/dist/src/error.js.map +1 -1
- package/dist/src/system_database.d.ts.map +1 -1
- package/dist/src/system_database.js +32 -8
- package/dist/src/system_database.js.map +1 -1
- package/dist/src/user_database.d.ts.map +1 -1
- package/dist/src/user_database.js +4 -0
- package/dist/src/user_database.js.map +1 -1
- package/dist/src/workflow.d.ts +4 -3
- package/dist/src/workflow.d.ts.map +1 -1
- package/dist/src/workflow.js +11 -6
- package/dist/src/workflow.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/migrations/20240205223925_foreign_keys.js +45 -0
- package/package.json +1 -1
@@ -0,0 +1,45 @@
|
|
1
|
+
/**
|
2
|
+
* @param { import("knex").Knex } knex
|
3
|
+
* @returns { Promise<void> }
|
4
|
+
*/
|
5
|
+
exports.up = function(knex) {
|
6
|
+
return knex.schema.withSchema('dbos')
|
7
|
+
.alterTable('workflow_status', function(table) {
|
8
|
+
table.index('created_at');
|
9
|
+
})
|
10
|
+
.alterTable('operation_outputs', function(table) {
|
11
|
+
table.foreign('workflow_uuid').references('workflow_uuid').inTable('dbos.workflow_status').onDelete('CASCADE').onUpdate('CASCADE');
|
12
|
+
})
|
13
|
+
.alterTable('workflow_inputs', function(table) {
|
14
|
+
table.foreign('workflow_uuid').references('workflow_uuid').inTable('dbos.workflow_status').onDelete('CASCADE').onUpdate('CASCADE');
|
15
|
+
})
|
16
|
+
.alterTable('notifications', function(table) {
|
17
|
+
table.foreign('destination_uuid').references('workflow_uuid').inTable('dbos.workflow_status').onDelete('CASCADE').onUpdate('CASCADE');
|
18
|
+
})
|
19
|
+
.alterTable('workflow_events', function(table) {
|
20
|
+
table.foreign('workflow_uuid').references('workflow_uuid').inTable('dbos.workflow_status').onDelete('CASCADE').onUpdate('CASCADE');
|
21
|
+
});
|
22
|
+
};
|
23
|
+
|
24
|
+
/**
|
25
|
+
* @param { import("knex").Knex } knex
|
26
|
+
* @returns { Promise<void> }
|
27
|
+
*/
|
28
|
+
exports.down = function(knex) {
|
29
|
+
return knex.schema.withSchema('dbos')
|
30
|
+
.alterTable('workflow_status', function(table) {
|
31
|
+
table.dropIndex('created_at');
|
32
|
+
})
|
33
|
+
.alterTable('operation_outputs', function(table) {
|
34
|
+
table.dropForeign('workflow_uuid');
|
35
|
+
})
|
36
|
+
.alterTable('workflow_inputs', function(table) {
|
37
|
+
table.dropForeign('workflow_uuid');
|
38
|
+
})
|
39
|
+
.alterTable('notifications', function(table) {
|
40
|
+
table.dropForeign('destination_uuid');
|
41
|
+
})
|
42
|
+
.alterTable('workflow_events', function(table) {
|
43
|
+
table.dropForeign('workflow_uuid');
|
44
|
+
});
|
45
|
+
};
|