mirror of
https://github.com/pieartsy/PluralFlux.git
synced 2026-04-14 20:15:28 +10:00
added migration to populate system with user id data from member table
This commit is contained in:
13
database/migrations/1773749921832-update.ts
Normal file
13
database/migrations/1773749921832-update.ts
Normal 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;`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user