import { MigrationInterface, QueryRunner } from "typeorm"; export class UniqueEmailPhone1729846207793 implements MigrationInterface { name = 'UniqueEmailPhone1729846207793' public async up(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "users" ADD CONSTRAINT "UQ_17d1817f241f10a3dbafb169fd2" UNIQUE ("phone_number")`); await queryRunner.query(`ALTER TABLE "users" ADD CONSTRAINT "UQ_97672ac88f789774dd47f7c8be3" UNIQUE ("email")`); await queryRunner.query(`ALTER TABLE "users" ALTER COLUMN "hash_password" SET NOT NULL`); } public async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`ALTER TABLE "users" ALTER COLUMN "hash_password" DROP NOT NULL`); await queryRunner.query(`ALTER TABLE "users" DROP CONSTRAINT "UQ_97672ac88f789774dd47f7c8be3"`); await queryRunner.query(`ALTER TABLE "users" DROP CONSTRAINT "UQ_17d1817f241f10a3dbafb169fd2"`); await queryRunner.query(`DROP TABLE "feeds"`); } }