Skip to content

Instantly share code, notes, and snippets.

@songthamtung
Last active December 18, 2019 03:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save songthamtung/6bd077edc2605c8a388c5d0cca116804 to your computer and use it in GitHub Desktop.
Save songthamtung/6bd077edc2605c8a388c5d0cca116804 to your computer and use it in GitHub Desktop.
{TIMESTAMP}-AddCityColumnToCompany.ts
import {MigrationInterface, QueryRunner} from "typeorm";
export class AddCityColumnToCompany1576405409745 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<any> {
await queryRunner.query("ALTER TABLE `company` ADD `city` varchar(255) NOT NULL");
}
public async down(queryRunner: QueryRunner): Promise<any> {
await queryRunner.query("ALTER TABLE `company` DROP COLUMN `city`");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment