Files
Wallos/migrations/000012.php
2025-07-21 22:53:35 +02:00

11 lines
511 B
PHP

<?php
// This migration adds a "encryption" column to the notifications table so that the encryption type can be stored.
$columnQuery = $db->query("SELECT * FROM pragma_table_info('notifications') WHERE name='encryption'");
$columnRequired = $columnQuery->fetchArray(SQLITE3_ASSOC) === false;
if ($columnRequired) {
$db->exec('ALTER TABLE notifications ADD COLUMN `encryption` TEXT DEFAULT "tls"');
$db->exec('UPDATE notifications SET `encryption` = "tls"');
}
?>