migrations/Version20200513084646.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20200513084646 extends AbstractMigration
  10. {
  11.     public function getDescription() : string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema) : void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  19.         $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');
  20.         $this->addSql('ALTER TABLE std_web_roles ADD CONSTRAINT FK_1A30EACBDE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
  21.         $this->addSql('ALTER TABLE std_web_roles ADD CONSTRAINT FK_1A30EACB16FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
  22.         $this->addSql('ALTER TABLE std_languages CHANGE language_code language_code VARCHAR(2) NOT NULL COMMENT \'ISO 639 Language code\'');
  23.         $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\'');
  24.     }
  25.     public function down(Schema $schema) : void
  26.     {
  27.         // this down() migration is auto-generated, please modify it to your needs
  28.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  29.         $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 = \'\' ');
  30.         $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\'');
  31.         $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\'');
  32.     }
  33. }