<?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 Version20221106115915 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE tarif_category (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE orders CHANGE last_pickup_update_at last_pickup_update_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP');
$this->addSql('ALTER TABLE tarifs_article ADD tarif_category_id INT DEFAULT NULL, DROP name, CHANGE update_at update_at DATETIME NOT NULL');
$this->addSql('ALTER TABLE tarifs_article ADD CONSTRAINT FK_14724AC15C13F3B3 FOREIGN KEY (tarif_category_id) REFERENCES tarif_category (id)');
$this->addSql('CREATE INDEX IDX_14724AC15C13F3B3 ON tarifs_article (tarif_category_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE tarifs_article DROP FOREIGN KEY FK_14724AC15C13F3B3');
$this->addSql('DROP TABLE tarif_category');
$this->addSql('ALTER TABLE orders CHANGE last_pickup_update_at last_pickup_update_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL');
$this->addSql('DROP INDEX IDX_14724AC15C13F3B3 ON tarifs_article');
$this->addSql('ALTER TABLE tarifs_article ADD name VARCHAR(255) NOT NULL, DROP tarif_category_id, CHANGE update_at update_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL');
}
}