Files
n8n-enterprise-unlocked/packages/cli/src/databases/migrations/sqlite/1663755770892-CreateWorkflowsUserRole.ts
T
कारतोफ्फेलस्क्रिप्ट™ ab9835126e refactor(core): Use @/databases/ instead of @db/ (no-changelog) (#10573)
2024-08-27 17:24:20 +02:00

18 lines
551 B
TypeScript

import type { MigrationContext, ReversibleMigration } from '@/databases/types';
export class CreateWorkflowsEditorRole1663755770892 implements ReversibleMigration {
async up({ queryRunner, tablePrefix }: MigrationContext) {
await queryRunner.query(`
INSERT INTO "${tablePrefix}role" (name, scope)
VALUES ("editor", "workflow")
ON CONFLICT DO NOTHING;
`);
}
async down({ queryRunner, tablePrefix }: MigrationContext) {
await queryRunner.query(`
DELETE FROM "${tablePrefix}role" WHERE name='user' AND scope='workflow';
`);
}
}