3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-23 17:45:03 +00:00

add script

This commit is contained in:
metal 2021-09-25 09:14:17 +00:00 committed by GitHub
parent c84d1a0be1
commit 8e15da95d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,21 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class ExpandCounterTriggerConditionFields1632560756499 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<any> {
// INT(11) -> INT(32)
await queryRunner.query(`
ALTER TABLE \`counter_triggers\`
CHANGE COLUMN \`comparison_value\` \`comparison_value\` INT(32) NOT NULL AFTER \`comparison_op\`,
CHANGE COLUMN \`reverse_comparison_value\` \`reverse_comparison_value\` INT(32) NOT NULL AFTER \`reverse_comparison_op\`
`);
}
public async down(queryRunner: QueryRunner): Promise<any> {
// INT(32) -> INT(11)
await queryRunner.query(`
ALTER TABLE \`counter_triggers\`
CHANGE COLUMN \`comparison_value\` \`comparison_value\` INT(11) NOT NULL AFTER \`comparison_op\`,
CHANGE COLUMN \`reverse_comparison_value\` \`reverse_comparison_value\` INT(11) NOT NULL AFTER \`reverse_comparison_op\`
`);
}
}