migrations/Version20240423113220.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 Version20240423113220 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->addSql("INSERT INTO `std_config` (`machine_name`, `created_by`, `updated_by`, `value`, `description_machine_name`, `details_machine_name`, `parent_name`, `variable_type`, `order_value`, `is_hidden`, `created_date`, `updated_date`, `label`, `language_code`) VALUES ('OAUTH_FACEBOOK_ID', 1, 1, '', 'OAUTH_FACEBOOK_ID', 'OAUTH_FACEBOOK_ID', 'OAuth Facebook', 'INPUT', 1, 0, now(), now(), 'OAuth Facebook Client ID', '');");
  19.         $this->addSql("INSERT INTO `std_config` (`machine_name`, `created_by`, `updated_by`, `value`, `description_machine_name`, `details_machine_name`, `parent_name`, `variable_type`, `order_value`, `is_hidden`, `created_date`, `updated_date`, `label`, `language_code`) VALUES ('OAUTH_FACEBOOK_CLIENT_SECRET', 1, 1, '', 'OAUTH_FACEBOOK_CLIENT_SECRET', 'OAUTH_FACEBOOK_CLIENT_SECRET', 'OAuth Facebook', 'INPUT', 2, 0, now(), now(), 'OAuth Facebook Client Secret', '');");
  20.         $this->addSql("INSERT INTO `std_config` (`machine_name`, `created_by`, `updated_by`, `value`, `description_machine_name`, `details_machine_name`, `parent_name`, `variable_type`, `order_value`, `is_hidden`, `is_active`, `created_date`, `updated_date`, `label`, `content`, `language_code`, `roles`) VALUES ('OAUTH_APPLE_CLIENT_ID', 1, 1, '', 'OAUTH_APPLE_CLIENT_ID', 'OAUTH_APPLE_CLIENT_ID', 'OAuth Apple', 'INPUT', 1, 0, 1, '2024-04-29 09:48:35', '2024-04-29 09:48:35', 'OAuth Apple Client Id', NULL, '', NULL);");
  21.         $this->addSql("INSERT INTO `std_config` (`machine_name`, `created_by`, `updated_by`, `value`, `description_machine_name`, `details_machine_name`, `parent_name`, `variable_type`, `order_value`, `is_hidden`, `is_active`, `created_date`, `updated_date`, `label`, `content`, `language_code`, `roles`) VALUES ('OAUTH_APPLE_CLIENT_SECRET', 1, 1, '', 'OAUTH_APPLE_CLIENT_SECRET', 'OAUTH_APPLE_CLIENT_SECRET', 'OAuth Apple', 'INPUT', 2, 0, 1, now(), now(), 'OAuth Apple Client Secret', NULL, '', NULL);");
  22.         $this->addSql("ALTER TABLE `std_web_users` ADD COLUMN `apple_id` VARCHAR(255) NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci' AFTER `google_integration`;");
  23.     }
  24.     public function down(Schema $schema): void
  25.     {
  26.         // this down() migration is auto-generated, please modify it to your needs
  27.         $this->addSql("ALTER TABLE `std_web_users` CHANGE COLUMN `facebook_id` `facebook_id` VARCHAR(255) NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci'");
  28.         $this->addSql("DELETE FROM `std_config` WHERE  `machine_name`='OAUTH_FACEBOOK_ID';");
  29.         $this->addSql("DELETE FROM `std_config` WHERE  `machine_name`='OAUTH_FACEBOOK_CLIENT_SECRET';");
  30.         $this->addSql("DELETE FROM `std_config` WHERE  `machine_name`='OAUTH_APPLE_CLIENT_ID';");
  31.         $this->addSql("DELETE FROM `std_config` WHERE  `machine_name`='OAUTH_APPLE_CLIENT_SECRET';");
  32.         $this->addSql("ALTER TABLE `std_web_users` DROP COLUMN `apple_id`;");
  33.     }
  34. }