<?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 Version20260118162512 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->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');
foreach ($this->getParameters() as $token => $value) {
$this->addSql(
'INSERT INTO system_parameter (token, name, subject, body, created_at, modified_at) VALUES (:token, :name, :subject, :body, NOW(), NOW())',
[
'token' => $token,
'name' => $value['name'],
'subject' => $value['subject'] ?? null,
'body' => $value['body'] ?? null,
]
);
}
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE system_parameter');
}
/**
* @return array
*/
private function getParameters(): array
{
return [
'lead-inbound-sms' => [
'name' => 'Lead Inbound SMS',
'body' => <<<EOF
Hi {{name}}, thank you for contacting StopIRSDebt. Your request has been received and a member of our team will reach out shortly.
EOF
],
'lead-inbound-email' => [
'name' => 'Lead Inbound Email',
'subject' => 'Your request has been received — StopIRSDebt',
'body' => <<<EOF
<p>Hi {{name}},</p>
<p>Thank you for contacting StopIRSDebt. This is a confirmation that we’ve received your request.</p>
<p>A member of our team will review your message and reach out shortly.</p>
<p>Sincerely</p>
<p>StopIRSDebt.com</p>
EOF
],
];
}
}