mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 19:11:13 +00:00
* 🚧 lowercasing email * ✅ add tests for case insensitive email * 🐘 add migration to lowercase email * 🚚 rename migration * 🐛 fix package.lock * 🐛 fix double import * 📋 add todo
18 lines
508 B
TypeScript
18 lines
508 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
import config = require('../../../../config');
|
|
|
|
export class LowerCaseUserEmail1648740597343 implements MigrationInterface {
|
|
name = 'LowerCaseUserEmail1648740597343';
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
const tablePrefix = config.get('database.tablePrefix');
|
|
|
|
await queryRunner.query(`
|
|
UPDATE ${tablePrefix}user
|
|
SET email = LOWER(email);
|
|
`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {}
|
|
}
|