import { MigrationInterface, QueryRunner } from "typeorm";

export class Migrations1728884547505 implements MigrationInterface {
    name = 'Migrations1728884547505'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`CREATE TABLE "users" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "first_name" character varying NOT NULL DEFAULT '', "last_name" character varying NOT NULL DEFAULT '', "email" character varying NOT NULL DEFAULT '', "role" "public"."users_role_enum" NOT NULL DEFAULT 'brand', "otp" character varying NOT NULL DEFAULT '', "otp_time" TIMESTAMP, "is_verify_otp" boolean NOT NULL DEFAULT false, "country_code" character varying NOT NULL DEFAULT '', "phone_number" character varying NOT NULL DEFAULT '', "company_name" character varying NOT NULL DEFAULT '', "password" character varying NOT NULL DEFAULT '', "image" character varying NOT NULL DEFAULT '', "is_active" boolean NOT NULL DEFAULT true, "pending_steps" integer NOT NULL DEFAULT '0', "created_at" TIMESTAMP(0) NOT NULL DEFAULT now(), "updated_at" TIMESTAMP(0) NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP(0), CONSTRAINT "UQ_a04a5bd217fb4a1f1d013cd064f" UNIQUE ("country_code", "phone_number"), CONSTRAINT "UQ_97672ac88f789774dd47f7c8be3" UNIQUE ("email"), CONSTRAINT "PK_a3ffb1c0c8416b9fc6f907b7433" PRIMARY KEY ("id")); COMMENT ON COLUMN "users"."pending_steps" IS 'Remaining registrations Process step by step'`);
    }

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

}
