migrations/Version20190507095649.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 Version20190507095649 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('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\'');
  20.         $this->addSql('ALTER TABLE std_languages CHANGE language_code language_code VARCHAR(2) NOT NULL COMMENT \'ISO 639 Language code\'');
  21.         
  22.         $this->addSql("INSERT INTO `std_blocks_settings` (`machine_name`, `block_id`, `created_by`, `updated_by`, `name`, `setting_type`, `is_active`, `created_date`, `updated_date`, `order_value`, `settings`) VALUES ('setting_form_cols', 17, 1, 1, 'Form cols', 'INPUT', 1, '2019-03-19 14:09:58', '2019-03-19 14:10:00', 1, NULL);");
  23.         $this->addSql("INSERT INTO `std_blocks_settings` (`machine_name`, `block_id`, `created_by`, `updated_by`, `name`, `setting_type`, `is_active`, `created_date`, `updated_date`, `order_value`, `settings`) VALUES ('setting_form_cols', 18, 1, 1, 'Form cols', 'INPUT', 1, '2019-03-19 14:09:58', '2019-03-19 14:10:00', 1, NULL);");
  24.         $this->addSql("INSERT INTO `std_blocks_settings` (`machine_name`, `block_id`, `created_by`, `updated_by`, `name`, `setting_type`, `is_active`, `created_date`, `updated_date`, `order_value`, `settings`) VALUES ('setting_form_cols', 19, 1, 1, 'Form cols', 'INPUT', 1, '2019-03-19 14:09:58', '2019-03-19 14:10:00', 1, NULL);");
  25.         $this->addSql("INSERT INTO `std_blocks_settings` (`machine_name`, `block_id`, `created_by`, `updated_by`, `name`, `setting_type`, `is_active`, `created_date`, `updated_date`, `order_value`, `settings`) VALUES ('setting_form_cols', 20, 1, 1, 'Form cols', 'INPUT', 1, '2019-03-19 14:09:58', '2019-03-19 14:10:00', 1, NULL);");
  26.         $this->addSql("INSERT INTO `std_blocks_settings` (`machine_name`, `block_id`, `created_by`, `updated_by`, `name`, `setting_type`, `is_active`, `created_date`, `updated_date`, `order_value`, `settings`) VALUES ('setting_form_cols', 21, 1, 1, 'Form cols', 'INPUT', 1, '2019-03-19 14:09:58', '2019-03-19 14:10:00', 1, NULL);");
  27.         $this->addSql("INSERT INTO `std_blocks_settings` (`machine_name`, `block_id`, `created_by`, `updated_by`, `name`, `setting_type`, `is_active`, `created_date`, `updated_date`, `order_value`, `settings`) VALUES ('setting_form_cols', 28, 1, 1, 'Form cols', 'INPUT', 1, '2019-03-19 14:09:58', '2019-03-19 14:10:00', 1, NULL);");
  28.         $this->addSql("INSERT INTO `std_blocks_settings` (`machine_name`, `block_id`, `created_by`, `updated_by`, `name`, `setting_type`, `is_active`, `created_date`, `updated_date`, `order_value`, `settings`) VALUES ('setting_form_cols', 30, 1, 1, 'Form cols', 'INPUT', 1, '2019-03-19 14:09:58', '2019-03-19 14:10:00', 1, NULL);");
  29.         $this->addSql("INSERT INTO `std_blocks_settings` (`machine_name`, `block_id`, `created_by`, `updated_by`, `name`, `setting_type`, `is_active`, `created_date`, `updated_date`, `order_value`, `settings`) VALUES ('setting_form_cols', 29, 1, 1, 'Form cols', 'INPUT', 1, '2019-03-19 14:09:58', '2019-03-19 14:10:00', 1, NULL);");
  30.         $this->addSql("INSERT INTO `std_blocks_skins` (`block_id`, `machine_name`, `name`, `is_active`, `created_by`, `created_date`, `updated_by`, `updated_date`) VALUES (2, 'default1', 'Title Form', 1, 1, '2019-03-29 15:47:30', 1, '2019-03-29 15:47:30');");
  31.         $this->addSql("INSERT INTO `std_content_types_components` (`content_type_id`, `machine_name`, `component_type`, `order_value`, `is_active`, `created_by`, `created_date`, `updated_by`, `updated_date`, `name`, `settings`) VALUES (5, 'form_title', 'INPUT', 1, 1, 1, '2019-03-22 14:45:23', 1, '2019-03-22 14:45:25', 'Title', NULL);");
  32.         $this->addSql("INSERT INTO `std_content_types_components` (`content_type_id`, `machine_name`, `component_type`, `order_value`, `is_active`, `created_by`, `created_date`, `updated_by`, `updated_date`, `name`, `settings`) VALUES (5, 'form_subtitle', 'INPUT', 2, 1, 1, '2019-03-22 14:45:23', 1, '2019-03-22 14:45:25', 'Subtitle', NULL);");
  33.         $this->addSql("UPDATE `std_content_types_components` SET order_value = 3 WHERE content_type_id = 5 AND machine_name LIKE 'form_name';");
  34.         $this->addSql("UPDATE `std_content_types_components` SET order_value = 4 WHERE content_type_id = 5 AND machine_name LIKE 'form_email_to';");
  35.         $this->addSql("UPDATE `std_content_types_components` SET order_value = 5 WHERE content_type_id = 5 AND machine_name LIKE 'form_email_sender';");
  36.         $this->addSql("UPDATE `std_content_types_components` SET order_value = 6 WHERE content_type_id = 5 AND machine_name LIKE 'form_redirect';");
  37.         $this->addSql("UPDATE `std_content_types_components` SET order_value = 7 WHERE content_type_id = 5 AND machine_name LIKE 'form_input_email_to_send';");
  38.         $this->addSql("UPDATE `std_content_types_components` SET order_value = 8 WHERE content_type_id = 5 AND machine_name LIKE 'form_email_from';");
  39.         $this->addSql("UPDATE `std_content_types_components` SET order_value = 9 WHERE content_type_id = 5 AND machine_name LIKE 'form_email_subject';");
  40.         $this->addSql("UPDATE `std_content_types_components` SET order_value = 10 WHERE content_type_id = 5 AND machine_name LIKE 'form_email_body';");
  41.         $this->addSql("UPDATE `std_content_types_components` SET order_value = 11 WHERE content_type_id = 5 AND machine_name LIKE 'form_email_admin_subject';");
  42.         $this->addSql("UPDATE `std_content_types_components` SET order_value = 12 WHERE content_type_id = 5 AND machine_name LIKE 'form_email_admin_body';");
  43.     }
  44.     public function down(Schema $schema) : void
  45.     {
  46.         // this down() migration is auto-generated, please modify it to your needs
  47.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  48.         $this->addSql('ALTER TABLE std_config CHANGE machine_name machine_name VARCHAR(50) NOT NULL COLLATE utf8mb4_unicode_ci COMMENT \'Unique code used in the programming to identify the config variable\'');
  49.         $this->addSql('ALTER TABLE std_languages CHANGE language_code language_code VARCHAR(2) NOT NULL COLLATE utf8mb4_unicode_ci COMMENT \'ISO 639 Language code\'');
  50.     
  51.         $this->addSql("DELETE FROM `std_blocks_settings` WHERE `machine_name` like 'setting_form_cols' and `block_id` = 17");
  52.         $this->addSql("DELETE FROM `std_blocks_settings` WHERE `machine_name` like 'setting_form_cols' and `block_id` = 18");
  53.         $this->addSql("DELETE FROM `std_blocks_settings` WHERE `machine_name` like 'setting_form_cols' and `block_id` = 19");
  54.         $this->addSql("DELETE FROM `std_blocks_settings` WHERE `machine_name` like 'setting_form_cols' and `block_id` = 20");
  55.         $this->addSql("DELETE FROM `std_blocks_settings` WHERE `machine_name` like 'setting_form_cols' and `block_id` = 21");
  56.         $this->addSql("DELETE FROM `std_blocks_settings` WHERE `machine_name` like 'setting_form_cols' and `block_id` = 28");
  57.         $this->addSql("DELETE FROM `std_blocks_settings` WHERE `machine_name` like 'setting_form_cols' and `block_id` = 30");
  58.         $this->addSql("DELETE FROM `std_blocks_settings` WHERE `machine_name` like 'setting_form_cols' and `block_id` = 29");
  59.         $this->addSql("DELETE FROM `std_blocks_skins` WHERE `machine_name` like 'default1' and `block_id` = 2");
  60.         $this->addSql("DELETE FROM `std_content_types_components` WHERE `machine_name` like 'form_title' and `content_type_id` = 5");
  61.         $this->addSql("DELETE FROM `std_content_types_components` WHERE `machine_name` like 'form_subtitle' and `content_type_id` = 5");
  62.     }
  63. }