<?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 Version20241128124352 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('ALTER TABLE admin CHANGE roles roles JSON NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE cart ADD contact_id INT DEFAULT NULL, ADD nummer VARCHAR(255) DEFAULT NULL, ADD date VARCHAR(255) DEFAULT NULL, ADD frontend_information TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE cart ADD CONSTRAINT FK_BA388B7E7A1254A FOREIGN KEY (contact_id) REFERENCES contact (id)');
$this->addSql('CREATE INDEX IDX_BA388B7E7A1254A ON cart (contact_id)');
$this->addSql('ALTER TABLE contact CHANGE updated updated TIMESTAMP default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP');
$this->addSql('ALTER TABLE customer CHANGE roles roles JSON NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE gutschrift CHANGE updated updated TIMESTAMP default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP');
$this->addSql('ALTER TABLE inquire CHANGE message message VARCHAR(65535) DEFAULT NULL');
$this->addSql('ALTER TABLE invoice CHANGE updated updated TIMESTAMP default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP');
$this->addSql('ALTER TABLE offer CHANGE updated updated TIMESTAMP default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP');
$this->addSql('ALTER TABLE order_confirmation CHANGE updated updated TIMESTAMP default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP');
$this->addSql('ALTER TABLE post CHANGE updated updated TIMESTAMP default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP');
$this->addSql('ALTER TABLE user CHANGE roles roles JSON NOT NULL COMMENT \'(DC2Type:json)\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE admin CHANGE roles roles JSON NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE cart DROP FOREIGN KEY FK_BA388B7E7A1254A');
$this->addSql('DROP INDEX IDX_BA388B7E7A1254A ON cart');
$this->addSql('ALTER TABLE cart DROP contact_id, DROP nummer, DROP date, DROP frontend_information');
$this->addSql('ALTER TABLE contact CHANGE updated updated DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL');
$this->addSql('ALTER TABLE customer CHANGE roles roles JSON NOT NULL COMMENT \'(DC2Type:json)\'');
$this->addSql('ALTER TABLE gutschrift CHANGE updated updated DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL');
$this->addSql('ALTER TABLE inquire CHANGE message message MEDIUMTEXT DEFAULT NULL');
$this->addSql('ALTER TABLE invoice CHANGE updated updated DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL');
$this->addSql('ALTER TABLE offer CHANGE updated updated DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL');
$this->addSql('ALTER TABLE order_confirmation CHANGE updated updated DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL');
$this->addSql('ALTER TABLE post CHANGE updated updated DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL');
$this->addSql('ALTER TABLE user CHANGE roles roles JSON NOT NULL COMMENT \'(DC2Type:json)\'');
}
}