migrations/Version20241024113415.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 Version20241024113415 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql("ALTER TABLE `std_web_users`
  18.         ADD COLUMN `apple_refresh_token` VARCHAR(255) NULL AFTER `apple_id`;");
  19.         $this->addSql("DELETE FROM `std_config` WHERE `machine_name` = 'OAUTH_APPLE_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`) 
  21.         VALUES ('OAUTH_APPLE_TEAM_ID', 1, 1, '', 'OAUTH_APPLE_TEAM_ID', 'OAUTH_APPLE_TEAM_ID', 'OAuth Apple', 'INPUT', 2, 0, 1, NOW(), NOW(), 'OAuth Apple Team Id', NULL, '', NULL);
  22.         ");
  23.         $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`) 
  24.         VALUES ('OAUTH_APPLE_KEY_ID', 1, 1, '', 'OAUTH_APPLE_KEY_ID', 'OAUTH_APPLE_KEY_ID', 'OAuth Apple', 'INPUT', 3, 0, 1, NOW(), NOW(), 'OAuth Apple Key Id', NULL, '', NULL);
  25.         ");
  26.         $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`) 
  27.         VALUES ('OAUTH_APPLE_KEY', 1, 1, '', 'OAUTH_APPLE_KEY', 'OAUTH_APPLE_KEY', 'OAuth Apple', 'TEXTAREA', 4, 0, 1, NOW(), NOW(), 'OAuth Apple Key', NULL, '', NULL);
  28.         ");
  29.     }
  30.     public function down(Schema $schema): void
  31.     {
  32.         $this->addSql("ALTER TABLE `std_web_users`
  33.         DROP COLUMN `apple_refresh_token`;");
  34.         $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);");
  35.         $this->addSql("DELETE FROM `std_config` WHERE `machine_name` = 'OAUTH_APPLE_TEAM_ID';");
  36.         $this->addSql("DELETE FROM `std_config` WHERE `machine_name` = 'OAUTH_APPLE_KEY_ID';");
  37.         $this->addSql("DELETE FROM `std_config` WHERE `machine_name` = 'OAUTH_APPLE_KEY';");
  38.     }
  39. }