resolve #12
This commit is contained in:
parent
f08d1324d0
commit
6a18812e9d
16 changed files with 175 additions and 34 deletions
18
migration/1609948116186-rating.ts
Normal file
18
migration/1609948116186-rating.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import {MigrationInterface, QueryRunner} from 'typeorm';
|
||||
|
||||
export class rating1609948116186 implements MigrationInterface {
|
||||
name = 'rating1609948116186'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query('ALTER TABLE "user" ADD "prevRating" real NOT NULL DEFAULT 0');
|
||||
await queryRunner.query('ALTER TABLE "user" ADD "rating" real NOT NULL DEFAULT 0');
|
||||
await queryRunner.query('ALTER TABLE "user" ADD "bannedFromRanking" boolean NOT NULL DEFAULT false');
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query('ALTER TABLE "user" DROP COLUMN "bannedFromRanking"');
|
||||
await queryRunner.query('ALTER TABLE "user" DROP COLUMN "rating"');
|
||||
await queryRunner.query('ALTER TABLE "user" DROP COLUMN "prevRating"');
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue