Delete duplicate members migration (#33)

* 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>
This commit is contained in:
2026-03-06 16:43:44 -05:00
committed by GitHub
parent 14ef1581c1
commit 8446559bfb

View File

@@ -0,0 +1,17 @@
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> {
}
}