-
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.
refactor: Change iconUrl to icon, make transaction name required, mak…
…e birthDate optional on registration and deprecate
- Loading branch information
Showing
18 changed files
with
317 additions
and
133 deletions.
There are no files selected for viewing
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
41 changes: 41 additions & 0 deletions
41
src/migrations/1616288112190-changeColumnsAndConstrains.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,41 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
|
||
export class changeColumnsAndConstrains1616288112190 implements MigrationInterface { | ||
name = "changeColumnsAndConstrains1616288112190"; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "debt" | ||
RENAME COLUMN "iconUrl" TO "icon"`); | ||
await queryRunner.query(`ALTER TABLE "category" | ||
RENAME COLUMN "iconUrl" TO "icon"`); | ||
await queryRunner.query(`ALTER TABLE "account" | ||
RENAME COLUMN "iconUrl" TO "icon"`); | ||
await queryRunner.query(`ALTER TABLE "cycle_transaction" | ||
ALTER COLUMN "name" SET NOT NULL`); | ||
await queryRunner.query(`COMMENT ON COLUMN "cycle_transaction"."name" IS NULL`); | ||
await queryRunner.query(`ALTER TABLE "user" | ||
ALTER COLUMN "birthDate" DROP NOT NULL`); | ||
await queryRunner.query(`COMMENT ON COLUMN "user"."birthDate" IS NULL`); | ||
await queryRunner.query(`ALTER TABLE "transaction" | ||
ALTER COLUMN "name" SET NOT NULL`); | ||
await queryRunner.query(`COMMENT ON COLUMN "transaction"."name" IS NULL`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`COMMENT ON COLUMN "transaction"."name" IS NULL`); | ||
await queryRunner.query(`ALTER TABLE "transaction" | ||
ALTER COLUMN "name" DROP NOT NULL`); | ||
await queryRunner.query(`COMMENT ON COLUMN "user"."birthDate" IS NULL`); | ||
await queryRunner.query(`ALTER TABLE "user" | ||
ALTER COLUMN "birthDate" SET NOT NULL`); | ||
await queryRunner.query(`COMMENT ON COLUMN "cycle_transaction"."name" IS NULL`); | ||
await queryRunner.query(`ALTER TABLE "cycle_transaction" | ||
ALTER COLUMN "name" DROP NOT NULL`); | ||
await queryRunner.query(`ALTER TABLE "account" | ||
RENAME COLUMN "icon" TO "iconUrl"`); | ||
await queryRunner.query(`ALTER TABLE "category" | ||
RENAME COLUMN "icon" TO "iconUrl"`); | ||
await queryRunner.query(`ALTER TABLE "debt" | ||
RENAME COLUMN "icon" TO "iconUrl"`); | ||
} | ||
} |
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
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
Oops, something went wrong.