-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update mentee application status with revoke status (#148)
Well Done 🚀
- Loading branch information
1 parent
dba439b
commit 7a7aae3
Showing
20 changed files
with
184 additions
and
114 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ node_modules/ | |
dist/ | ||
.idea | ||
uploads/ | ||
certificates/ |
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
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,49 @@ | ||
import { type MigrationInterface, type QueryRunner } from 'typeorm' | ||
|
||
export class AddNewApplicationStates1722749907154 | ||
implements MigrationInterface | ||
{ | ||
name = 'AddNewApplicationStates1722749907154' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TYPE "public"."mentee_state_enum" RENAME TO "mentee_state_enum_old"` | ||
) | ||
await queryRunner.query( | ||
`CREATE TYPE "public"."mentee_state_enum" AS ENUM('pending', 'rejected', 'approved', 'completed', 'revoked')` | ||
) | ||
await queryRunner.query( | ||
`ALTER TABLE "mentee" ALTER COLUMN "state" DROP DEFAULT` | ||
) | ||
await queryRunner.query( | ||
`ALTER TABLE "mentee" ALTER COLUMN "state" TYPE "public"."mentee_state_enum" USING "state"::"text"::"public"."mentee_state_enum"` | ||
) | ||
await queryRunner.query( | ||
`ALTER TABLE "mentee" ALTER COLUMN "state" SET DEFAULT 'pending'` | ||
) | ||
await queryRunner.query(`DROP TYPE "public"."mentee_state_enum_old"`) | ||
await queryRunner.query(`ALTER TABLE "mentee" DROP COLUMN "certificate_id"`) | ||
await queryRunner.query(`ALTER TABLE "mentee" ADD "certificate_id" uuid`) | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "mentee" DROP COLUMN "certificate_id"`) | ||
await queryRunner.query(`ALTER TABLE "mentee" ADD "certificate_id" bigint`) | ||
await queryRunner.query( | ||
`CREATE TYPE "public"."mentee_state_enum_old" AS ENUM('pending', 'rejected', 'approved')` | ||
) | ||
await queryRunner.query( | ||
`ALTER TABLE "mentee" ALTER COLUMN "state" DROP DEFAULT` | ||
) | ||
await queryRunner.query( | ||
`ALTER TABLE "mentee" ALTER COLUMN "state" TYPE "public"."mentee_state_enum_old" USING "state"::"text"::"public"."mentee_state_enum_old"` | ||
) | ||
await queryRunner.query( | ||
`ALTER TABLE "mentee" ALTER COLUMN "state" SET DEFAULT 'pending'` | ||
) | ||
await queryRunner.query(`DROP TYPE "public"."mentee_state_enum"`) | ||
await queryRunner.query( | ||
`ALTER TYPE "public"."mentee_state_enum_old" RENAME TO "mentee_state_enum"` | ||
) | ||
} | ||
} |
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.