Files
yogibook_aury_new/db/migrations/20260812220000_add_multi_texts_defaults.php
T
2026-08-15 12:00:28 +03:00

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')
");
}
}