28 lines
1.1 KiB
TypeScript
28 lines
1.1 KiB
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
export class tokentypes1662882569739 implements MigrationInterface {
|
|
name = 'tokentypes1662882569739';
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(
|
|
`ALTER TABLE \`user_token\` ADD \`nonce\` text NULL`,
|
|
);
|
|
await queryRunner.query(
|
|
`ALTER TABLE \`o_auth2_token\` ADD \`nonce\` text NULL`,
|
|
);
|
|
await queryRunner.query(
|
|
`ALTER TABLE \`user_token\` CHANGE \`type\` \`type\` enum ('generic', 'activation', 'deactivation', 'password', 'login', 'gdpr', 'totp', 'public_key', 'recovery') NOT NULL`,
|
|
);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(
|
|
`ALTER TABLE \`user_token\` CHANGE \`type\` \`type\` enum ('generic', 'activation', 'deactivation', 'password', 'login', 'gdpr', 'totp', 'recovery') NOT NULL`,
|
|
);
|
|
await queryRunner.query(`ALTER TABLE \`user_token\` DROP COLUMN \`nonce\``);
|
|
await queryRunner.query(
|
|
`ALTER TABLE \`o_auth2_token\` DROP COLUMN \`nonce\``,
|
|
);
|
|
}
|
|
}
|