src/Migrations/Version20200921081000.php line 1
<?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 Version20200921081000 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 material (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, type VARCHAR(255) NOT NULL, data JSON NOT NULL, published TINYINT(1) NOT NULL, deleted TINYINT(1) DEFAULT \'0\' NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, owner_type VARCHAR(50) DEFAULT NULL, owner_id INT DEFAULT NULL, INDEX IDX_7CBE7595B03A8386 (created_by_id), INDEX IDX_7CBE7595896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE material ADD CONSTRAINT FK_7CBE7595B03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE material ADD CONSTRAINT FK_7CBE7595896DBBDE FOREIGN KEY (updated_by_id) REFERENCES users (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE material');
}
}