import { MigrationInterface, QueryRunner, TableColumn } from "typeorm";

export class AddTitleColumnToRecipeTable1759053089684 implements MigrationInterface {

    public async up(queryRunner: QueryRunner): Promise<void> {
        // At title column with not null constraint
        await queryRunner.addColumn(
                    "recipe",
                    new TableColumn({
                            name: "title",
                            type: "varchar",
                            isNullable: false
                        }));
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        // Remove title column
        await queryRunner.dropColumn("recipe", "title");
    }

}
