<?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 Version20190402112258 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 std_forms (id INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT \'Unique identifier\', created_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', updated_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', form_name VARCHAR(255) NOT NULL COMMENT \'ISO 639 Language code\', content JSON DEFAULT NULL COMMENT \'Content of the form\', netuser_id INT DEFAULT NULL COMMENT \'Identifier of the netuser that submitted the form\', created_date DATETIME NOT NULL COMMENT \'Date and time of the record creation\', updated_date DATETIME NOT NULL COMMENT \'Date and time the record was last updated\', INDEX IDX_BE014AEADE12AB56 (created_by), INDEX IDX_BE014AEA16FE72E1 (updated_by), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE std_forms ADD CONSTRAINT FK_BE014AEADE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_forms ADD CONSTRAINT FK_BE014AEA16FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (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 std_forms');
}
}