Total Complexity | 2 |
Complexity/F | 1 |
Lines of Code | 19 |
Function Count | 2 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import {MigrationInterface, QueryRunner} from "typeorm"; |
||
2 | |||
3 | export class UserAdministrative1588426823331 implements MigrationInterface { |
||
4 | name = 'UserAdministrative1588426823331' |
||
5 | |||
6 | public async up(queryRunner: QueryRunner): Promise<any> { |
||
7 | await queryRunner.query(`CREATE TYPE "user_administrative_contract_enum" AS ENUM('cdi', 'cdd', 'ctt', 'apprenticeship', 'professionalization')`, undefined); |
||
8 | await queryRunner.query(`CREATE TABLE "user_administrative" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "joiningDate" TIMESTAMP NOT NULL, "leavingDate" TIMESTAMP, "annualEarnings" integer NOT NULL, "transportFee" integer DEFAULT 0, "healthInsurance" boolean NOT NULL, "executivePosition" boolean NOT NULL, "contract" "user_administrative_contract_enum" NOT NULL, CONSTRAINT "PK_3a17ceae75a0f330edb671f4b76" PRIMARY KEY ("id"))`, undefined); |
||
9 | await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "entryDate"`, undefined); |
||
10 | } |
||
11 | |||
12 | public async down(queryRunner: QueryRunner): Promise<any> { |
||
13 | await queryRunner.query(`ALTER TABLE "user" ADD "entryDate" TIMESTAMP`, undefined); |
||
14 | await queryRunner.query(`DROP TABLE "user_administrative"`, undefined); |
||
15 | await queryRunner.query(`DROP TYPE "user_administrative_contract_enum"`, undefined); |
||
16 | } |
||
17 | |||
18 | } |
||
19 |