import { MigrationInterface, QueryRunner } from "typeorm";

export class Migrations1728970866343 implements MigrationInterface {
    name = 'Migrations1728970866343'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`CREATE TABLE "brand_industries" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "title" character varying NOT NULL DEFAULT '', "created_at" TIMESTAMP(0) NOT NULL DEFAULT now(), "updated_at" TIMESTAMP(0) NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP(0), "users" uuid, CONSTRAINT "PK_faef3c3c913a2f40c2ab91dec39" PRIMARY KEY ("id"))`);
        await queryRunner.query(`ALTER TABLE "brand_industries" ADD CONSTRAINT "FK_7797d4e7b63af4082bc0584f094" FOREIGN KEY ("users") REFERENCES "users"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE "brand_industries" DROP CONSTRAINT "FK_7797d4e7b63af4082bc0584f094"`);
        await queryRunner.query(`DROP TABLE "brand_industries"`);
    }

}
