Conditions | 1 |
Total Lines | 5 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import {MigrationInterface, QueryRunner} from "typeorm"; |
||
5 | |||
6 | public async up(queryRunner: QueryRunner): Promise<any> { |
||
7 | await queryRunner.query(`CREATE TABLE "address" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "street" character varying NOT NULL, "city" character varying NOT NULL, "zipCode" character varying(6) NOT NULL, "country" character varying(2) NOT NULL, CONSTRAINT "PK_d92de1f82754668b5f5f5dd4fd5" PRIMARY KEY ("id"))`, undefined); |
||
8 | await queryRunner.query(`ALTER TABLE "customer" ADD "addressId" uuid NOT NULL`, undefined); |
||
9 | await queryRunner.query(`ALTER TABLE "customer" ADD CONSTRAINT "FK_7697a356e1f4b79ab3819839e95" FOREIGN KEY ("addressId") REFERENCES "address"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`, undefined); |
||
10 | } |
||
19 |