feat: change minmax probability to minmax score
This commit is contained in:
@@ -1,20 +1,35 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class ChangeResultRangeFields1788950646073 implements MigrationInterface {
|
||||
name = 'ChangeResultRangeFields1788950646073'
|
||||
name = 'ChangeResultRangeFields1788950646073';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "result_range" DROP COLUMN "minScore"`);
|
||||
await queryRunner.query(`ALTER TABLE "result_range" DROP COLUMN "maxScore"`);
|
||||
await queryRunner.query(`ALTER TABLE "result_range" ADD "minProbability" integer NOT NULL`);
|
||||
await queryRunner.query(`ALTER TABLE "result_range" ADD "maxProbability" integer NOT NULL`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "result_range" DROP COLUMN "maxProbability"`);
|
||||
await queryRunner.query(`ALTER TABLE "result_range" DROP COLUMN "minProbability"`);
|
||||
await queryRunner.query(`ALTER TABLE "result_range" ADD "maxScore" integer NOT NULL`);
|
||||
await queryRunner.query(`ALTER TABLE "result_range" ADD "minScore" integer NOT NULL`);
|
||||
}
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "result_range" DROP COLUMN "minScore"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "result_range" DROP COLUMN "maxScore"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "result_range" ADD "minProbability" integer NOT NULL`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "result_range" ADD "maxProbability" integer NOT NULL`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "result_range" DROP COLUMN "maxProbability"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "result_range" DROP COLUMN "minProbability"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "result_range" ADD "maxScore" integer NOT NULL`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "result_range" ADD "minScore" integer NOT NULL`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class CalculateByScore1789906979798 implements MigrationInterface {
|
||||
name = 'CalculateByScore1789906979798';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "result_range" DROP COLUMN "minProbability"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "result_range" DROP COLUMN "maxProbability"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "result_range" ADD "minScore" integer NOT NULL`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "result_range" ADD "maxScore" integer NOT NULL`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "result_range" DROP COLUMN "maxScore"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "result_range" DROP COLUMN "minScore"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "result_range" ADD "maxProbability" integer NOT NULL`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "result_range" ADD "minProbability" integer NOT NULL`,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user