-
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 #100 from cuappdev/filter
Filter
- Loading branch information
Showing
13 changed files
with
303 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {MigrationInterface, QueryRunner} from "typeorm"; | ||
|
||
export class updatecategories1731271779741 implements MigrationInterface { | ||
name = 'updatecategories1731271779741' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "Post" RENAME COLUMN "categories" TO "category"`); | ||
await queryRunner.query(`ALTER TABLE "Post" DROP COLUMN "category"`); | ||
await queryRunner.query(`ALTER TABLE "Post" ADD "category" character varying`); | ||
await queryRunner.query(`UPDATE "Post" SET "category" = 'Other' WHERE "category" IS NULL`); | ||
await queryRunner.query(`ALTER TABLE "Post" ALTER COLUMN "category" SET NOT NULL`); | ||
await queryRunner.query(`ALTER TABLE "Post" ALTER COLUMN "original_price" TYPE numeric`); | ||
await queryRunner.query(`ALTER TABLE "Post" ALTER COLUMN "altered_price" TYPE numeric`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "Post" ALTER COLUMN "altered_price" TYPE numeric`); | ||
await queryRunner.query(`ALTER TABLE "Post" ALTER COLUMN "original_price" TYPE numeric`); | ||
await queryRunner.query(`ALTER TABLE "Post" DROP COLUMN "category"`); | ||
await queryRunner.query(`ALTER TABLE "Post" ADD "category" text array NOT NULL`); | ||
await queryRunner.query(`ALTER TABLE "Post" RENAME COLUMN "category" TO "categories"`); | ||
} | ||
|
||
} |
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,20 @@ | ||
import {MigrationInterface, QueryRunner} from "typeorm"; | ||
|
||
export class addconditiontoposts1732146942548 implements MigrationInterface { | ||
name = 'addconditiontoposts1732146942548' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "Post" ADD "condition" character varying`); | ||
await queryRunner.query(`UPDATE "Post" SET "condition" = 'NEW' WHERE "condition" IS NULL`); | ||
await queryRunner.query(`ALTER TABLE "Post" ALTER COLUMN "condition" SET NOT NULL`); | ||
await queryRunner.query(`ALTER TABLE "Post" ALTER COLUMN "original_price" TYPE numeric`); | ||
await queryRunner.query(`ALTER TABLE "Post" ALTER COLUMN "altered_price" TYPE numeric`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "Post" ALTER COLUMN "altered_price" TYPE numeric`); | ||
await queryRunner.query(`ALTER TABLE "Post" ALTER COLUMN "original_price" TYPE numeric`); | ||
await queryRunner.query(`ALTER TABLE "Post" DROP COLUMN "condition"`); | ||
} | ||
|
||
} |
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.