<?php
declare(strict_types=1);
namespace CoreMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240426161242 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 shipments_bundle__printer (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', name VARCHAR(128) NOT NULL, type VARCHAR(50) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_76D0AC9AB03A8386 (created_by_id), INDEX IDX_76D0AC9A896DBBDE (updated_by_id), INDEX IDX_76D0AC9AC76F1F52 (deleted_by_id), INDEX name (name), INDEX deleted_at (deleted_at), INDEX created_at (created_at), INDEX updated_at (updated_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE shipments_bundle__printer ADD CONSTRAINT FK_76D0AC9AB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE shipments_bundle__printer ADD CONSTRAINT FK_76D0AC9A896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE shipments_bundle__printer ADD CONSTRAINT FK_76D0AC9AC76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX is_credit_note ON cash_register_bundle__payment_method (is_credit_note)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE shipments_bundle__printer DROP FOREIGN KEY FK_76D0AC9AB03A8386');
$this->addSql('ALTER TABLE shipments_bundle__printer DROP FOREIGN KEY FK_76D0AC9A896DBBDE');
$this->addSql('ALTER TABLE shipments_bundle__printer DROP FOREIGN KEY FK_76D0AC9AC76F1F52');
$this->addSql('DROP TABLE shipments_bundle__printer');
$this->addSql('DROP INDEX is_credit_note ON cash_register_bundle__payment_method');
}
}