mirror of
https://github.com/pieartsy/PluralFlux.git
synced 2026-04-17 01:55:27 +10:00
* add migration to delete duplicates that currently exist in the db * added a name attribute for consistency --------- Co-authored-by: Aster Fialla <asterfialla@gmail.com>
18 lines
632 B
TypeScript
18 lines
632 B
TypeScript
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
|
|
export class DeleteDuplicates1772825438973 implements MigrationInterface {
|
|
name= "DeleteDuplicates1772825438973"
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`DELETE
|
|
FROM "Member" a USING "Member" b
|
|
WHERE a.id
|
|
> b.id
|
|
AND a.name = b.name
|
|
AND a.userid = b.userid;`)
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
}
|
|
|
|
}
|