mirror of
https://github.com/pieartsy/PluralFlux.git
synced 2026-04-14 20:15:28 +10:00
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> {
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|