Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
feat(#33)-set-up-static-questions
Browse files Browse the repository at this point in the history
fixed migration
  • Loading branch information
Nazar Rudenko committed Apr 16, 2019
1 parent 553abbe commit 4956760
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/src/migration/1555336867562-AskedQuestion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import {MigrationInterface, QueryRunner} from 'typeorm';
export class AskedQuestion1555336867562 implements MigrationInterface {

public async up(queryRunner: QueryRunner): Promise<any> {
await queryRunner.query(`ALTER TABLE "asked_question" ALTER COLUMN "generated_question" RENAME TO "question"`);
await queryRunner.query(`ALTER TABLE "asked_question" ALTER COLUMN "generated_answer" RENAME TO "answer"`);
await queryRunner.query("ALTER TABLE `asked_question` CHANGE `generated_question` `question` varchar(255) NOT NULL");
await queryRunner.query("ALTER TABLE `asked_question` DROP COLUMN `answer`");
}

public async down(queryRunner: QueryRunner): Promise<any> {
await queryRunner.query(`ALTER TABLE "asked_question" ALTER COLUMN "question" RENAME TO "generated_question"`);
await queryRunner.query(`ALTER TABLE "asked_question" ALTER COLUMN "answer" RENAME TO "generated_answer"`);
await queryRunner.query("ALTER TABLE `asked_question` CHANGE `question` `generated_question` varchar(255) NOT NULL");
await queryRunner.query("ALTER TABLE `asked_question` ADD `generated_answer` varchar(255) NOT NULL");
}

}

0 comments on commit 4956760

Please sign in to comment.