migrations/Version20260118162512.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 Version20260118162512 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('CREATE TABLE system_parameter (id INT AUTO_INCREMENT NOT NULL, token VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, subject VARCHAR(255) DEFAULT NULL, body LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, modified_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_8CAF11475F37A13B (token), INDEX idx_token (token), INDEX idx_name (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         foreach ($this->getParameters() as $token => $value) {
  20.             $this->addSql(
  21.                 'INSERT INTO system_parameter (token, name, subject, body, created_at, modified_at) VALUES (:token, :name, :subject, :body, NOW(), NOW())',
  22.                 [
  23.                     'token' => $token,
  24.                     'name' => $value['name'],
  25.                     'subject' => $value['subject'] ?? null,
  26.                     'body' => $value['body'] ?? null,
  27.                 ]
  28.             );
  29.         }
  30.     }
  31.     public function down(Schema $schema): void
  32.     {
  33.         // this down() migration is auto-generated, please modify it to your needs
  34.         $this->addSql('DROP TABLE system_parameter');
  35.     }
  36.     /**
  37.      * @return array
  38.      */
  39.     private function getParameters(): array
  40.     {
  41.         return [
  42.              'lead-inbound-sms' => [
  43.                  'name' => 'Lead Inbound SMS',
  44.                  'body' => <<<EOF
  45. Hi {{name}}, thank you for contacting StopIRSDebt. Your request has been received and a member of our team will reach out shortly.
  46. EOF
  47.              ],
  48.              'lead-inbound-email' => [
  49.                  'name' => 'Lead Inbound Email',
  50.                  'subject' => 'Your request has been received — StopIRSDebt',
  51.                  'body' => <<<EOF
  52. <p>Hi {{name}},</p>
  53. <p>Thank you for contacting StopIRSDebt. This is a confirmation that we’ve received your request.</p>
  54. <p>A member of our team will review your message and reach out shortly.</p>
  55. <p>Sincerely</p>
  56. <p>StopIRSDebt.com</p>
  57. EOF
  58.              ],
  59.          ];
  60.     }
  61. }