1
0
Fork 0
mirror of https://github.com/n8n-io/n8n.git synced 2025-03-05 20:50:17 -08:00

fix(core): Fix RemoveResetPasswordColumns migration for sqlite (no-changelog) ()

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2023-07-26 09:39:15 +02:00 committed by GitHub
parent fc7aa8bd66
commit 1438a737b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 10 deletions

View file

@ -3,27 +3,24 @@ import { TableColumn } from 'typeorm';
export class RemoveResetPasswordColumns1690000000030 implements ReversibleMigration { export class RemoveResetPasswordColumns1690000000030 implements ReversibleMigration {
async up({ queryRunner, tablePrefix }: MigrationContext) { async up({ queryRunner, tablePrefix }: MigrationContext) {
await queryRunner.dropColumn(`${tablePrefix}user`, 'resetPasswordToken'); await queryRunner.dropColumns(`${tablePrefix}user`, [
await queryRunner.dropColumn(`${tablePrefix}user`, 'resetPasswordTokenExpiration'); 'resetPasswordToken',
'resetPasswordTokenExpiration',
]);
} }
async down({ queryRunner, tablePrefix }: MigrationContext) { async down({ queryRunner, tablePrefix }: MigrationContext) {
await queryRunner.addColumn( await queryRunner.addColumns(`${tablePrefix}user`, [
`${tablePrefix}user`,
new TableColumn({ new TableColumn({
name: 'resetPasswordToken', name: 'resetPasswordToken',
type: 'varchar', type: 'varchar',
isNullable: true, isNullable: true,
}), }),
);
await queryRunner.addColumn(
`${tablePrefix}user`,
new TableColumn({ new TableColumn({
name: 'resetPasswordTokenExpiration', name: 'resetPasswordTokenExpiration',
type: 'int', type: 'int',
isNullable: true, isNullable: true,
}), }),
); ]);
} }
} }

View file

@ -0,0 +1,5 @@
import { RemoveResetPasswordColumns1690000000030 as BaseMigration } from '../common/1690000000030-RemoveResetPasswordColumns';
export class RemoveResetPasswordColumns1690000000030 extends BaseMigration {
transaction = false as const;
}

View file

@ -39,7 +39,7 @@ import { MigrateIntegerKeysToString1690000000002 } from './1690000000002-Migrate
import { SeparateExecutionData1690000000010 } from './1690000000010-SeparateExecutionData'; import { SeparateExecutionData1690000000010 } from './1690000000010-SeparateExecutionData';
import { RemoveSkipOwnerSetup1681134145997 } from './1681134145997-RemoveSkipOwnerSetup'; import { RemoveSkipOwnerSetup1681134145997 } from './1681134145997-RemoveSkipOwnerSetup';
import { FixMissingIndicesFromStringIdMigration1690000000020 } from './1690000000020-FixMissingIndicesFromStringIdMigration'; import { FixMissingIndicesFromStringIdMigration1690000000020 } from './1690000000020-FixMissingIndicesFromStringIdMigration';
import { RemoveResetPasswordColumns1690000000030 } from '../common/1690000000030-RemoveResetPasswordColumns'; import { RemoveResetPasswordColumns1690000000030 } from './1690000000030-RemoveResetPasswordColumns';
const sqliteMigrations: Migration[] = [ const sqliteMigrations: Migration[] = [
InitialMigration1588102412422, InitialMigration1588102412422,