<?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 Version20190320161453 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_translations (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\', language_code VARCHAR(2) NOT NULL COMMENT \'ISO 639 Language code\', label VARCHAR(100) NOT NULL COMMENT \'ISO 639 Label\', translation VARCHAR(255) NOT NULL COMMENT \'ISO 639 Translation\', created_date DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT \'Date and time of the record creation\', updated_date DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT \'Date and time the record was last updated\', INDEX IDX_90DC0DEFDE12AB56 (created_by), INDEX IDX_90DC0DEF16FE72E1 (updated_by), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE std_blocks (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\', machine_name VARCHAR(50) DEFAULT NULL COMMENT \'Unique code used in the programming to identify the block\', is_active TINYINT(1) DEFAULT \'1\' COMMENT \'Flag that indicates if the block is active\', 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\', name VARCHAR(100) DEFAULT NULL COMMENT \'Name of the block\', INDEX fk_std_blocks_std_users (created_by), INDEX fk_std_blocks_std_users_0 (updated_by), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE std_blocks_components (machine_name VARCHAR(50) NOT NULL COMMENT \'Machine name of the component\', block_id INT UNSIGNED NOT NULL COMMENT \'Unique identifier\', created_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', updated_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', component_type INT NOT NULL COMMENT \'Type of the component (1- input, 2 - image, 3 - textarea,...)\', settings JSON DEFAULT NULL COMMENT \'Component settings\', order_value INT DEFAULT NULL COMMENT \'Order of the component\', is_active TINYINT(1) DEFAULT \'1\' NOT NULL COMMENT \'Flag that indicates if the block is active\', 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\', name VARCHAR(100) NOT NULL COMMENT \'Name of the block\', INDEX IDX_F097A598E9ED820C (block_id), INDEX fk_std_blocks_components_std_users (created_by), INDEX fk_std_blocks_components_std_users_0 (updated_by), PRIMARY KEY(block_id, machine_name)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE std_blocks_settings (machine_name VARCHAR(50) NOT NULL COMMENT \'Machine name of the setting\', block_id INT UNSIGNED NOT NULL COMMENT \'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 \'Setting name\', setting_type INT DEFAULT NULL, is_active TINYINT(1) DEFAULT \'1\' NOT NULL COMMENT \'Flag that indicates if the setting is active\', 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\', order_value INT DEFAULT NULL COMMENT \'Order of the setting\', INDEX IDX_FCD6F728E9ED820C (block_id), INDEX fk_std_blocks_settings_std_users (created_by), INDEX fk_std_blocks_settings_std_users_0 (updated_by), PRIMARY KEY(block_id, machine_name)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE std_config (machine_name VARCHAR(50) NOT NULL COMMENT \'Unique code used in the programming to identify the config variable\', created_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', updated_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', value VARCHAR(500) DEFAULT NULL COMMENT \'Value of the config variable\', description_machine_name VARCHAR(50) DEFAULT NULL COMMENT \'Machine name of the translation of the description of the variable\', details_machine_name VARCHAR(50) DEFAULT NULL COMMENT \'Machine name of the translation of the details text of the variable\', parent_machine_name VARCHAR(50) DEFAULT NULL COMMENT \'Machine name of the translation of the parent group of variables\', variable_type VARCHAR(10) DEFAULT NULL COMMENT \'Type of the variable. It affects the kind of input generated .
Possible values:\', order_value INT DEFAULT NULL COMMENT \'Order of the permission\', is_hidden TINYINT(1) NOT NULL COMMENT \'Flag that indicates that this variable is hidden from the user\', is_active TINYINT(1) DEFAULT \'1\' NOT NULL COMMENT \'Flag that indicates if this config variable is active.\', created_date DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT \'Date and time of the record creation\', updated_date DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT \'Date and time the record was last updated\', INDEX fk_std_config_std_users (created_by), INDEX fk_std_config_std_users_0 (updated_by), PRIMARY KEY(machine_name)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE std_languages (language_code VARCHAR(2) NOT NULL COMMENT \'ISO 639 Language code\', name VARCHAR(100) NOT NULL COMMENT \'Language name\', is_public TINYINT(1) DEFAULT \'1\' NOT NULL COMMENT \'Flag to indicate if this language code is available in the front-end\', is_active TINYINT(1) DEFAULT \'1\' COMMENT \'Flag that indicates if the Language is active\', PRIMARY KEY(language_code)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE std_options (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\', machine_name VARCHAR(50) NOT NULL COMMENT \'Unique code used in the programming to identify the option\', order_value INT DEFAULT NULL COMMENT \'Order of the option on the menu\', path VARCHAR(255) DEFAULT NULL COMMENT \'Main Path of the option\', external_link VARCHAR(255) DEFAULT NULL COMMENT \'External Link of the option\', required_permissions INT NOT NULL DEFAULT 0, max_permissions INT NOT NULL DEFAULT 15, is_active TINYINT(1) DEFAULT \'1\' COMMENT \'Flag indicating if the option is active\', created_date DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT \'Date and time of the record creation\', updated_date DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT \'Date and time the record was last updated\', INDEX fk_std_options_std_users (created_by), INDEX fk_std_options_std_users_0 (updated_by), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE std_options_permissions (id INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT \'Unique identifier\', option_id INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', created_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', updated_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', machine_name VARCHAR(50) DEFAULT NULL COMMENT \'Code used in the programming to identify the option permission\', name VARCHAR(50) DEFAULT NULL COMMENT \'Name of the permission\', value INT UNSIGNED DEFAULT NULL COMMENT \'Value of the permission - it has to be a power of 2 and unique for the option\', order_value INT DEFAULT NULL COMMENT \'Order of the permission\', created_date DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT \'Date and time of the record creation\', updated_date DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT \'Date and time the record was last updated\', INDEX fk_std_options_permissions_std_users (created_by), INDEX fk_std_options_permissions_std_options (option_id), INDEX fk_std_options_permissions_std_users_0 (updated_by), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE std_pages (id INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT \'Page unique identifier\', template_id INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', created_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', updated_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', title VARCHAR(100) DEFAULT NULL COMMENT \'Page title\', content_type VARCHAR(50) DEFAULT NULL COMMENT \'Type of content page\', is_active TINYINT(1) DEFAULT \'1\' NOT NULL COMMENT \'Flag that indicates if the page is active\', 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\', order_value INT DEFAULT NULL COMMENT \'Page order\', publish_date DATETIME DEFAULT NULL COMMENT \'Date/hour when to publish page\', expire_date DATETIME DEFAULT NULL COMMENT \'Date/time when to expire (unpublish) page\', INDEX IDX_634AB4685DA0FB8 (template_id), INDEX fk_std_pages_std_users (created_by), INDEX fk_std_pages_std_users_0 (updated_by), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE std_pages_content (page_id INT UNSIGNED NOT NULL COMMENT \'Page unique identifier\', language_code VARCHAR(2) NOT NULL COMMENT \'ISO 639 Language code\', created_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', updated_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', is_active TINYINT(1) DEFAULT \'1\' NOT NULL COMMENT \'Flag that indicates if the content is active\', 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\', title VARCHAR(150) DEFAULT NULL, url VARCHAR(500) NOT NULL COMMENT \'Url of the page\', canonical_url VARCHAR(500) DEFAULT NULL COMMENT \'Canonical url of the page\', meta_title VARCHAR(150) DEFAULT NULL, meta_keywords VARCHAR(1000) DEFAULT NULL COMMENT \'Meta keywords of the page\', meta_description VARCHAR(255) DEFAULT NULL COMMENT \'Meta description of the page\', og_title VARCHAR(150) DEFAULT NULL COMMENT \'Open graph title of the page\', og_image VARCHAR(255) DEFAULT NULL COMMENT \'Open graph link to the image of the page\', og_description VARCHAR(300) DEFAULT NULL, og_url VARCHAR(255) DEFAULT NULL COMMENT \'Open graph url of the page\', scripts_head VARCHAR(255) DEFAULT NULL COMMENT \'Scripts to add to the head of the page\', scripts_body VARCHAR(255) DEFAULT NULL COMMENT \'Scripts to add to the body of the page\', scripts_footer VARCHAR(255) DEFAULT NULL COMMENT \'Scripts to add to the footer of the page\', content JSON DEFAULT NULL COMMENT \'Content of the page\', INDEX IDX_9E966E0BC4663E4 (page_id), INDEX fk_std_pages_content_std_users (created_by), INDEX fk_std_pages_content_std_users_0 (updated_by), INDEX fk_std_pages_content_std_languages (language_code), PRIMARY KEY(page_id, language_code)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE std_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\', is_active TINYINT(1) DEFAULT \'1\' NOT NULL COMMENT \'Flag that indicates if the role is active\', 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('CREATE TABLE std_roles_permissions (option_id INT UNSIGNED NOT NULL COMMENT \'Unique identifier\', role_id INT UNSIGNED NOT NULL COMMENT \'Role unique identifier\', created_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', updated_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', permissions INT UNSIGNED DEFAULT NULL COMMENT \'Sum of all the permissions of the option associated to the role\', created_date DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT \'Date and time of the record creation\', updated_date DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT \'Date and time the record was last updated\', INDEX fk_std_roles_permissions_std_users_0 (updated_by), INDEX fk_std_roles_permissions_std_users (created_by), INDEX fk_std_roles_permissions_std_options (option_id), INDEX IDX_746083FCD60322AC (role_id), PRIMARY KEY(option_id, role_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE std_templates (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\', name VARCHAR(100) DEFAULT NULL COMMENT \'Template name\', machine_name VARCHAR(50) DEFAULT NULL COMMENT \'Machine name of the template\', is_active TINYINT(1) DEFAULT \'1\' COMMENT \'Flag that indicates if the template is active\', 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_templates_std_users (created_by), INDEX fk_std_templates_std_users_0 (updated_by), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE std_templates_blocks (template_id INT UNSIGNED NOT NULL COMMENT \'Unique identifier\', block_id INT UNSIGNED NOT NULL COMMENT \'Unique identifier\', created_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', updated_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', order_value INT DEFAULT NULL COMMENT \'Order of block\', is_active TINYINT(1) DEFAULT \'1\' NOT NULL COMMENT \'Flag that indicates if the block is active\', 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_B8EAC42F5DA0FB8 (template_id), INDEX fk_std_templates_blocks_std_block (block_id), INDEX fk_std_templates_blocks_std_users (created_by), INDEX fk_std_templates_blocks_std_users_0 (updated_by), PRIMARY KEY(template_id, block_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE std_users (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\', name VARCHAR(255) DEFAULT NULL COMMENT \'User\'\'s name\', username VARCHAR(100) NOT NULL COMMENT \'Username used to login\', email VARCHAR(254) NOT NULL COMMENT \'Email address of the user\', password VARCHAR(255) NOT NULL COMMENT \'User\'\'s password\', password_date DATETIME DEFAULT NULL COMMENT \'Last date and time the password was updated\', failed_attempts INT UNSIGNED DEFAULT NULL COMMENT \'Number of failed login attempts\', force_password_change TINYINT(1) DEFAULT NULL COMMENT \'Flag to force the user to change the password on the next login\', last_login_date DATETIME DEFAULT NULL COMMENT \'Date and time of the last successful login\', penultimate_login_date DATETIME DEFAULT NULL COMMENT \'Date and time of the penultimate successful login\', language VARCHAR(3) DEFAULT NULL COMMENT \'Preferred user interface\'\'s language code\', is_locked TINYINT(1) NOT NULL COMMENT \'Flag to lock the user\', is_super_user TINYINT(1) NOT NULL COMMENT \'Flag indicating super user privileges\', is_deleted TINYINT(1) NOT NULL COMMENT \'Flag that indicates the user has been deleted\', is_active TINYINT(1) DEFAULT \'1\' NOT NULL COMMENT \'Flag that indicates if the user is active\', 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_users_std_users (created_by), INDEX fk_std_users_std_users_upd (updated_by), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSQL('INSERT INTO std_users (id, name, username, email, password, password_date, failed_attempts, force_password_change, last_login_date, penultimate_login_date, language, is_locked, is_super_user, is_deleted, is_active, created_by, created_date, updated_by, updated_date) VALUES (1, \'Super Admin\', \'superadmin\', \'websystems@fullscreen.pt\', \'$2y$12$sYI3CtYj3v0/TqNtSZ5rlOs5psQ7XGO/oXCJ4dwvWphxShWczffBK\', \'2019-02-11 19:13:19\', 0, 0, \'2019-03-09 12:59:58\', \'2019-02-11 19:13:22\', \'en\', 0, 1, 0, 1, 1, \'2019-02-11 19:13:34\', 1, \'2019-03-13 12:09:34\');');
$this->addSQL('CREATE TABLE std_users_roles (role_id INT UNSIGNED NOT NULL COMMENT \'Role unique identifier\', user_id INT UNSIGNED NOT NULL COMMENT \'Unique identifier\', created_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', updated_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', created_date DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT \'Date and time of the record creation\', updated_date DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT \'Date and time the record was last updated\', INDEX fk_std_users_roles_std_users_0 (updated_by), INDEX fk_std_users_roles_std_users (created_by), INDEX fk_std_users_roles_std_roles (role_id), INDEX IDX_895AC1BBA76ED395 (user_id), PRIMARY KEY(role_id, user_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE std_translations ADD CONSTRAINT FK_90DC0DEFDE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_translations ADD CONSTRAINT FK_90DC0DEF16FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_blocks ADD CONSTRAINT FK_ADA8C7F0DE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_blocks ADD CONSTRAINT FK_ADA8C7F016FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_blocks_components ADD CONSTRAINT FK_F097A598E9ED820C FOREIGN KEY (block_id) REFERENCES std_blocks (id)');
$this->addSql('ALTER TABLE std_blocks_components ADD CONSTRAINT FK_F097A598DE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_blocks_components ADD CONSTRAINT FK_F097A59816FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_blocks_settings ADD CONSTRAINT FK_FCD6F728E9ED820C FOREIGN KEY (block_id) REFERENCES std_blocks (id)');
$this->addSql('ALTER TABLE std_blocks_settings ADD CONSTRAINT FK_FCD6F728DE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_blocks_settings ADD CONSTRAINT FK_FCD6F72816FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_config ADD CONSTRAINT FK_B7CF7DF4DE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_config ADD CONSTRAINT FK_B7CF7DF416FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_options ADD CONSTRAINT FK_3335B4C7DE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_options ADD CONSTRAINT FK_3335B4C716FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_options_permissions ADD CONSTRAINT FK_2158F764A7C41D6F FOREIGN KEY (option_id) REFERENCES std_options (id)');
$this->addSql('ALTER TABLE std_options_permissions ADD CONSTRAINT FK_2158F764DE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_options_permissions ADD CONSTRAINT FK_2158F76416FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_pages ADD CONSTRAINT FK_634AB4685DA0FB8 FOREIGN KEY (template_id) REFERENCES std_templates (id)');
$this->addSql('ALTER TABLE std_pages ADD CONSTRAINT FK_634AB468DE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_pages ADD CONSTRAINT FK_634AB46816FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_pages_content ADD CONSTRAINT FK_9E966E0BC4663E4 FOREIGN KEY (page_id) REFERENCES std_pages (id)');
$this->addSql('ALTER TABLE std_pages_content ADD CONSTRAINT FK_9E966E0B451CDAD4 FOREIGN KEY (language_code) REFERENCES std_languages (language_code)');
$this->addSql('ALTER TABLE std_pages_content ADD CONSTRAINT FK_9E966E0BDE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_pages_content ADD CONSTRAINT FK_9E966E0B16FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_roles ADD CONSTRAINT FK_F5007FDADE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_roles ADD CONSTRAINT FK_F5007FDA16FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_roles_permissions ADD CONSTRAINT FK_746083FCA7C41D6F FOREIGN KEY (option_id) REFERENCES std_options (id)');
$this->addSql('ALTER TABLE std_roles_permissions ADD CONSTRAINT FK_746083FCD60322AC FOREIGN KEY (role_id) REFERENCES std_roles (id)');
$this->addSql('ALTER TABLE std_roles_permissions ADD CONSTRAINT FK_746083FCDE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_roles_permissions ADD CONSTRAINT FK_746083FC16FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_templates ADD CONSTRAINT FK_E35BD1CDE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_templates ADD CONSTRAINT FK_E35BD1C16FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_templates_blocks ADD CONSTRAINT FK_B8EAC42F5DA0FB8 FOREIGN KEY (template_id) REFERENCES std_templates (id)');
$this->addSql('ALTER TABLE std_templates_blocks ADD CONSTRAINT FK_B8EAC42FE9ED820C FOREIGN KEY (block_id) REFERENCES std_blocks (id)');
$this->addSql('ALTER TABLE std_templates_blocks ADD CONSTRAINT FK_B8EAC42FDE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_templates_blocks ADD CONSTRAINT FK_B8EAC42F16FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_users ADD CONSTRAINT FK_57BDF4F4DE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_users ADD CONSTRAINT FK_57BDF4F416FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_users_roles ADD CONSTRAINT FK_895AC1BBD60322AC FOREIGN KEY (role_id) REFERENCES std_roles (id)');
$this->addSql('ALTER TABLE std_users_roles ADD CONSTRAINT FK_895AC1BBDE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_users_roles ADD CONSTRAINT FK_895AC1BB16FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_users_roles ADD CONSTRAINT FK_895AC1BBA76ED395 FOREIGN KEY (user_id) 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('ALTER TABLE std_blocks_components DROP FOREIGN KEY FK_F097A598E9ED820C');
$this->addSql('ALTER TABLE std_blocks_settings DROP FOREIGN KEY FK_FCD6F728E9ED820C');
$this->addSql('ALTER TABLE std_templates_blocks DROP FOREIGN KEY FK_B8EAC42FE9ED820C');
$this->addSql('ALTER TABLE std_pages_content DROP FOREIGN KEY FK_9E966E0B451CDAD4');
$this->addSql('ALTER TABLE std_options_permissions DROP FOREIGN KEY FK_2158F764A7C41D6F');
$this->addSql('ALTER TABLE std_roles_permissions DROP FOREIGN KEY FK_746083FCA7C41D6F');
$this->addSql('ALTER TABLE std_pages_content DROP FOREIGN KEY FK_9E966E0BC4663E4');
$this->addSql('ALTER TABLE std_roles_permissions DROP FOREIGN KEY FK_746083FCD60322AC');
$this->addSql('ALTER TABLE std_users_roles DROP FOREIGN KEY FK_895AC1BBD60322AC');
$this->addSql('ALTER TABLE std_pages DROP FOREIGN KEY FK_634AB4685DA0FB8');
$this->addSql('ALTER TABLE std_templates_blocks DROP FOREIGN KEY FK_B8EAC42F5DA0FB8');
$this->addSql('ALTER TABLE std_translations DROP FOREIGN KEY FK_90DC0DEFDE12AB56');
$this->addSql('ALTER TABLE std_translations DROP FOREIGN KEY FK_90DC0DEF16FE72E1');
$this->addSql('ALTER TABLE std_blocks DROP FOREIGN KEY FK_ADA8C7F0DE12AB56');
$this->addSql('ALTER TABLE std_blocks DROP FOREIGN KEY FK_ADA8C7F016FE72E1');
$this->addSql('ALTER TABLE std_blocks_components DROP FOREIGN KEY FK_F097A598DE12AB56');
$this->addSql('ALTER TABLE std_blocks_components DROP FOREIGN KEY FK_F097A59816FE72E1');
$this->addSql('ALTER TABLE std_blocks_settings DROP FOREIGN KEY FK_FCD6F728DE12AB56');
$this->addSql('ALTER TABLE std_blocks_settings DROP FOREIGN KEY FK_FCD6F72816FE72E1');
$this->addSql('ALTER TABLE std_config DROP FOREIGN KEY FK_B7CF7DF4DE12AB56');
$this->addSql('ALTER TABLE std_config DROP FOREIGN KEY FK_B7CF7DF416FE72E1');
$this->addSql('ALTER TABLE std_options DROP FOREIGN KEY FK_3335B4C7DE12AB56');
$this->addSql('ALTER TABLE std_options DROP FOREIGN KEY FK_3335B4C716FE72E1');
$this->addSql('ALTER TABLE std_options_permissions DROP FOREIGN KEY FK_2158F764DE12AB56');
$this->addSql('ALTER TABLE std_options_permissions DROP FOREIGN KEY FK_2158F76416FE72E1');
$this->addSql('ALTER TABLE std_pages DROP FOREIGN KEY FK_634AB468DE12AB56');
$this->addSql('ALTER TABLE std_pages DROP FOREIGN KEY FK_634AB46816FE72E1');
$this->addSql('ALTER TABLE std_pages_content DROP FOREIGN KEY FK_9E966E0BDE12AB56');
$this->addSql('ALTER TABLE std_pages_content DROP FOREIGN KEY FK_9E966E0B16FE72E1');
$this->addSql('ALTER TABLE std_roles DROP FOREIGN KEY FK_F5007FDADE12AB56');
$this->addSql('ALTER TABLE std_roles DROP FOREIGN KEY FK_F5007FDA16FE72E1');
$this->addSql('ALTER TABLE std_roles_permissions DROP FOREIGN KEY FK_746083FCDE12AB56');
$this->addSql('ALTER TABLE std_roles_permissions DROP FOREIGN KEY FK_746083FC16FE72E1');
$this->addSql('ALTER TABLE std_templates DROP FOREIGN KEY FK_E35BD1CDE12AB56');
$this->addSql('ALTER TABLE std_templates DROP FOREIGN KEY FK_E35BD1C16FE72E1');
$this->addSql('ALTER TABLE std_templates_blocks DROP FOREIGN KEY FK_B8EAC42FDE12AB56');
$this->addSql('ALTER TABLE std_templates_blocks DROP FOREIGN KEY FK_B8EAC42F16FE72E1');
$this->addSql('ALTER TABLE std_users DROP FOREIGN KEY FK_57BDF4F4DE12AB56');
$this->addSql('ALTER TABLE std_users DROP FOREIGN KEY FK_57BDF4F416FE72E1');
$this->addSql('ALTER TABLE std_users_roles DROP FOREIGN KEY FK_895AC1BBDE12AB56');
$this->addSql('ALTER TABLE std_users_roles DROP FOREIGN KEY FK_895AC1BB16FE72E1');
$this->addSql('ALTER TABLE std_users_roles DROP FOREIGN KEY FK_895AC1BBA76ED395');
$this->addSql('DROP TABLE std_translations');
$this->addSql('DROP TABLE std_blocks');
$this->addSql('DROP TABLE std_blocks_components');
$this->addSql('DROP TABLE std_blocks_settings');
$this->addSql('DROP TABLE std_config');
$this->addSql('DROP TABLE std_languages');
$this->addSql('DROP TABLE std_options');
$this->addSql('DROP TABLE std_options_permissions');
$this->addSql('DROP TABLE std_pages');
$this->addSql('DROP TABLE std_pages_content');
$this->addSql('DROP TABLE std_roles');
$this->addSql('DROP TABLE std_roles_permissions');
$this->addSql('DROP TABLE std_templates');
$this->addSql('DROP TABLE std_templates_blocks');
$this->addSql('DROP TABLE std_users');
$this->addSql('DROP TABLE std_users_roles');
}
}