import { MigrationInterface, QueryRunner } from "typeorm";

export class Migrations1741678450265 implements MigrationInterface {
    name = 'Migrations1741678450265'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE "posts" DROP CONSTRAINT "FK_196c4a109204faafad54cebf34c"`);
        await queryRunner.query(`ALTER TABLE "posts" ADD CONSTRAINT "FK_196c4a109204faafad54cebf34c" FOREIGN KEY ("social_media_id") REFERENCES "social_medias"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE "posts" DROP CONSTRAINT "FK_196c4a109204faafad54cebf34c"`);
        await queryRunner.query(`ALTER TABLE "posts" ADD CONSTRAINT "FK_196c4a109204faafad54cebf34c" FOREIGN KEY ("social_media_id") REFERENCES "social_medias"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
    }

}
