-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from bancodobrasil/feat/add-new-fields
Feat/add new fields
- Loading branch information
Showing
5 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
migrations/1675881556357-AddDateAndEnabledFieldsToMenuItems.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
|
||
export class AddDateAndEnabledFieldsToMenuItems1675881556357 implements MigrationInterface { | ||
name = 'AddDateAndEnabledFieldsToMenuItems1675881556357' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE \`menu_items\` ADD \`enabled\` tinyint NOT NULL`); | ||
await queryRunner.query(`ALTER TABLE \`menu_items\` ADD \`start_publication\` datetime NULL`); | ||
await queryRunner.query(`ALTER TABLE \`menu_items\` ADD \`end_publication\` datetime NULL`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE \`menu_items\` DROP COLUMN \`end_publication\``); | ||
await queryRunner.query(`ALTER TABLE \`menu_items\` DROP COLUMN \`start_publication\``); | ||
await queryRunner.query(`ALTER TABLE \`menu_items\` DROP COLUMN \`enabled\``); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters