<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240924094015 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql("ALTER TABLE `dp_column_settings` ADD `user_id` INT NULL AFTER `company_id`");
$this->addSql("ALTER TABLE `dp_column_settings` ADD FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON DELETE RESTRICT ON UPDATE RESTRICT");
$this->addSql("ALTER TABLE `dp_column_settings` ADD `updated_by` INT NULL AFTER `created_at`, ADD `updated_at` DATETIME NULL AFTER `updated_by`");
$this->addSql("ALTER TABLE `dp_column_settings` ADD FOREIGN KEY (`updated_by`) REFERENCES `user`(`id`) ON DELETE RESTRICT ON UPDATE RESTRICT");
}
public function down(Schema $schema): void
{
$this->addSql("ALTER TABLE `dp_column_settings` DROP FOREIGN KEY `dp_column_settings_ibfk_3`");
$this->addSql("ALTER TABLE `dp_column_settings` DROP COLUMN `user_id`");
$this->addSql("ALTER TABLE `dp_column_settings` DROP FOREIGN KEY `dp_column_settings_ibfk_4`");
$this->addSql("ALTER TABLE `dp_column_settings` DROP COLUMN `updated_by`");
$this->addSql("ALTER TABLE `dp_column_settings` DROP COLUMN `updated_at`");
}
}