<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20151222140321 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema): void
{
// Add container_image table
$this->addSql('CREATE TABLE container_image (id INT AUTO_INCREMENT NOT NULL, container_id INT DEFAULT NULL, image_id INT DEFAULT NULL, created_by INT DEFAULT NULL, modified_by INT DEFAULT NULL, creation_date DATETIME NOT NULL, modified_date DATETIME DEFAULT NULL, deleted TINYINT(1) DEFAULT NULL, INDEX IDX_411E50BD3DA5256D (image_id), INDEX IDX_411E50BDDE12AB56 (created_by), INDEX IDX_411E50BD25F94802 (modified_by), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE container_image ADD CONSTRAINT FK_CI_CONTAINER FOREIGN KEY (container_id) REFERENCES container (id)');
$this->addSql('ALTER TABLE container_image ADD CONSTRAINT FK_CI_IMAGE FOREIGN KEY (image_id) REFERENCES image (id)');
$this->addSql('ALTER TABLE container_image ADD CONSTRAINT FK_CI_CREATED FOREIGN KEY (created_by) REFERENCES user (id)');
$this->addSql('ALTER TABLE container_image ADD CONSTRAINT FK_CI_MODIFIED FOREIGN KEY (modified_by) REFERENCES user (id)');
$this->addSql('ALTER TABLE container_image ADD deletedAt DATETIME DEFAULT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
}
}