<?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 Version20200513084646 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_web_roles (id INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT \'Role unique identifier\', created_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', updated_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', name VARCHAR(100) NOT NULL COMMENT \'Role name\', image VARCHAR(100) NOT NULL COMMENT \'Role Imagge\', is_active TINYINT(1) DEFAULT \'1\' NOT NULL COMMENT \'Flag that indicates if the role is active\', is_default TINYINT(1) DEFAULT \'0\' NOT NULL COMMENT \'Flag that indicates if the role is Default\', 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 fk_std_roles_std_users (created_by), INDEX fk_std_roles_std_users_0 (updated_by), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE std_web_roles ADD CONSTRAINT FK_1A30EACBDE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_web_roles ADD CONSTRAINT FK_1A30EACB16FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_languages CHANGE language_code language_code VARCHAR(2) NOT NULL COMMENT \'ISO 639 Language code\'');
$this->addSql('ALTER TABLE std_config CHANGE machine_name machine_name VARCHAR(50) NOT NULL COMMENT \'Unique code used in the programming to identify the config variable\'');
}
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('CREATE TABLE cache_items (item_id VARBINARY(255) NOT NULL, item_data MEDIUMBLOB NOT NULL, item_lifetime INT UNSIGNED DEFAULT NULL, item_time INT UNSIGNED NOT NULL, PRIMARY KEY(item_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE std_config CHANGE machine_name machine_name VARCHAR(50) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'Unique code used in the programming to identify the config variable\'');
$this->addSql('ALTER TABLE std_languages CHANGE language_code language_code VARCHAR(2) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'ISO 639 Language code\'');
}
}