<?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 Version20230411083043 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 shipments_bundle__time_delta_translations DROP FOREIGN KEY FK_52FCF239232D562B');
$this->addSql('DROP TABLE shipments_bundle__time_delta');
$this->addSql('DROP TABLE shipments_bundle__time_delta_translations');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE shipments_bundle__time_delta (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) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, minutes INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX deleted_at (deleted_at), INDEX IDX_87798FBEC76F1F52 (deleted_by_id), INDEX created_at (created_at), INDEX name (name), INDEX IDX_87798FBEB03A8386 (created_by_id), INDEX updated_at (updated_at), INDEX minutes (minutes), INDEX IDX_87798FBE896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE shipments_bundle__time_delta_translations (id INT AUTO_INCREMENT NOT NULL, object_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', locale VARCHAR(8) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, field VARCHAR(32) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, content LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_52FCF239232D562B (object_id), UNIQUE INDEX lookup_unique_idx (locale, object_id, field), FULLTEXT INDEX content (content), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE shipments_bundle__time_delta ADD CONSTRAINT FK_87798FBE896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE shipments_bundle__time_delta ADD CONSTRAINT FK_87798FBEC76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE shipments_bundle__time_delta ADD CONSTRAINT FK_87798FBEB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE shipments_bundle__time_delta_translations ADD CONSTRAINT FK_52FCF239232D562B FOREIGN KEY (object_id) REFERENCES shipments_bundle__time_delta (id) ON DELETE CASCADE');
}
}