Merge pull request #2327 from automatisch/folder-id-for-flows

feat: Add folderId column to the flow model
This commit is contained in:
Ömer Faruk Aydın
2025-02-03 19:48:33 +01:00
committed by GitHub
3 changed files with 20 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
export async function up(knex) {
await knex.schema.table('flows', (table) => {
table.uuid('folder_id').references('id').inTable('folders').index();
});
}
export async function down(knex) {
await knex.schema.table('flows', (table) => {
table.dropIndex('folder_id');
table.dropColumn('folder_id');
});
}

View File

@@ -12,6 +12,13 @@ exports[`Flow model > jsonSchema should have correct validations 1`] = `
"deletedAt": {
"type": "string",
},
"folderId": {
"format": "uuid",
"type": [
"string",
"null",
],
},
"id": {
"format": "uuid",
"type": "string",

View File

@@ -28,6 +28,7 @@ class Flow extends Base {
id: { type: 'string', format: 'uuid' },
name: { type: 'string', minLength: 1 },
userId: { type: 'string', format: 'uuid' },
folderId: { type: ['string', 'null'], format: 'uuid' },
remoteWebhookId: { type: 'string' },
active: { type: 'boolean' },
publishedAt: { type: 'string' },