added migration to populate system with user id data from member table

This commit is contained in:
Aster Fialla
2026-03-17 09:17:43 -04:00
parent ff4dba3dfd
commit ee4dca2ae3

View File

@@ -0,0 +1,13 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class Update1773749921832 implements MigrationInterface {
name = 'Update1773749921832'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`INSERT INTO "System" ("userid") SELECT DISTINCT "userid" FROM "Member";`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DELETE from "System" USING "Member" WHERE "System".userid = "Member".userid;`);
}
}