<?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 Version20191107155207 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE media_residence (id INT AUTO_INCREMENT NOT NULL, residence_id INT NOT NULL, file VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, size INT DEFAULT NULL, description LONGTEXT DEFAULT NULL, title VARCHAR(255) DEFAULT NULL, state TINYINT(1) NOT NULL, date_created DATETIME DEFAULT NULL, date_updated DATETIME DEFAULT NULL, INDEX IDX_2647EBAD8B225FBD (residence_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE media_residence ADD CONSTRAINT FK_2647EBAD8B225FBD FOREIGN KEY (residence_id) REFERENCES residence (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE media_residence');
}
}