2022-04-14 23:11:35 -07:00
|
|
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
2023-01-24 01:55:20 -08:00
|
|
|
import { getTablePrefix } from '@db/utils/migrationHelpers';
|
2022-04-14 23:11:35 -07:00
|
|
|
|
|
|
|
export class LowerCaseUserEmail1648740597343 implements MigrationInterface {
|
|
|
|
name = 'LowerCaseUserEmail1648740597343';
|
|
|
|
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
2023-01-24 01:55:20 -08:00
|
|
|
const tablePrefix = getTablePrefix();
|
2022-04-14 23:11:35 -07:00
|
|
|
await queryRunner.query(`
|
2023-01-24 01:55:20 -08:00
|
|
|
UPDATE "${tablePrefix}user"
|
2022-04-14 23:11:35 -07:00
|
|
|
SET email = LOWER(email);
|
|
|
|
`);
|
|
|
|
}
|
|
|
|
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {}
|
|
|
|
}
|