import { MigrationInterface, QueryRunner } from 'typeorm'

export class AddSettingsEntity1697026204345 implements MigrationInterface {
	name = 'AddSettingsEntity1697026204345'

	public async up(queryRunner: QueryRunner): Promise<void> {
		await queryRunner.query(
			`CREATE TABLE "settings" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "tenantId" uuid, "createdBy" uuid, "lastUpdatedAt" TIMESTAMP NOT NULL DEFAULT now(), "lastUpdatedBy" uuid, "customerAppSettings" json NOT NULL, CONSTRAINT "PK_0669fe20e252eb692bf4d344975" PRIMARY KEY ("id"))`,
		)
	}

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