40 lines
1.3 KiB
PHP
40 lines
1.3 KiB
PHP
<?php
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class AddMultiTextsDefaults extends AbstractMigration
|
|
{
|
|
public function up(): void
|
|
{
|
|
$this->execute("
|
|
UPDATE notificationsetting
|
|
SET title_multi = 'I tuoi abbonamenti in scadenza',
|
|
body_multi = 'Ciao {first_name}, hai {count} abbonamenti in scadenza il {expiredate}: {orders}.'
|
|
WHERE notificationtype = 'order' AND daysbefore > 0
|
|
");
|
|
|
|
$this->execute("
|
|
UPDATE notificationsetting
|
|
SET title_multi = 'I tuoi abbonamenti scadono oggi',
|
|
body_multi = 'Ciao {first_name}, oggi scadono {count} dei tuoi abbonamenti: {orders}.'
|
|
WHERE notificationtype = 'order' AND daysbefore = 0
|
|
");
|
|
|
|
$this->execute("
|
|
UPDATE notificationsetting
|
|
SET title_multi = 'Certificati medici in scadenza',
|
|
body_multi = 'Ciao {first_name}, hai {count} certificati in scadenza il {expiredate}: {documents}.'
|
|
WHERE notificationtype = 'certificate'
|
|
");
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
$this->execute("
|
|
UPDATE notificationsetting
|
|
SET title_multi = NULL, body_multi = NULL
|
|
WHERE notificationtype IN ('order', 'certificate')
|
|
");
|
|
}
|
|
}
|