Added migration needed for OIDC

This commit is contained in:
Alex Tran 2022-11-18 23:22:27 -06:00
parent 8bc64be77b
commit 6ed072f67b
No known key found for this signature in database
GPG Key ID: E4954BC787B85C8A

View File

@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class UpdateUserTableForOIDC1668835311083 implements MigrationInterface {
name = 'UpdateUserTableForOIDC1668835311083'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "users" ALTER COLUMN "password" SET DEFAULT ''`);
await queryRunner.query(`ALTER TABLE "users" ALTER COLUMN "salt" SET DEFAULT ''`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "users" ALTER COLUMN "salt" DROP DEFAULT`);
await queryRunner.query(`ALTER TABLE "users" ALTER COLUMN "password" DROP DEFAULT`);
}
}