<?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 Version20250129083653 extends AbstractMigration
{
public function getDescription(): string
{
return 'Fix the db schema';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE UNIQUE INDEX UNIQ_70FF972B77153098 ON aliment (code)');
$this->addSql('ALTER TABLE category CHANGE position position INT DEFAULT 0 NOT NULL');
$this->addSql('ALTER TABLE pickup_hour RENAME INDEX idx_29d8f0414d16c4dd TO IDX_E53A92C4D16C4DD');
$this->addSql('ALTER TABLE product_category CHANGE created_at created_at DATETIME NOT NULL, CHANGE updated_at updated_at DATETIME NOT NULL');
$this->addSql('ALTER TABLE shop_settings CHANGE pickup_mode pickup_mode TINYINT(1) DEFAULT 0 NOT NULL');
$this->addSql('ALTER TABLE template_name CHANGE type type VARCHAR(255) DEFAULT \'web_site\' NOT NULL');
}
public function down(Schema $schema): void
{
$this->addSql('DROP INDEX UNIQ_70FF972B77153098 ON aliment');
$this->addSql('ALTER TABLE category CHANGE position position INT DEFAULT NULL');
$this->addSql('ALTER TABLE pickup_hour RENAME INDEX idx_e53a92c4d16c4dd TO IDX_29D8F0414D16C4DD');
$this->addSql('ALTER TABLE product_category CHANGE created_at created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, CHANGE updated_at updated_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL');
$this->addSql('ALTER TABLE shop_settings CHANGE pickup_mode pickup_mode TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE template_name CHANGE type type VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE user_role DROP FOREIGN KEY FK_2DE8C6A3A76ED395');
$this->addSql('ALTER TABLE user_role DROP FOREIGN KEY FK_2DE8C6A3D60322AC');
}
}