Files
Wallos/migrations/000041.php
Dani Bento 75c94ad15c add support for mattermost notifications (#923)
Signed-off-by: Daniela Filipe Bento <danibento@overdestiny.com>
2025-10-12 12:42:39 +02:00

16 lines
608 B
PHP
Executable File

<?php
// This migration adds a mattermost_notifications table to store Mattermost notification settings.
$tableQuery = $db->query("SELECT name FROM sqlite_master WHERE type='table' AND name='mattermost_notifications'");
$tableExists = $tableQuery->fetchArray(SQLITE3_ASSOC);
if ($tableExists === false) {
$db->exec("
CREATE TABLE mattermost_notifications (
enabled INTEGER NOT NULL DEFAULT 0,
user_id INTEGER,
webhook_url TEXT DEFAULT '',
bot_username TEXT DEFAULT '',
bot_icon_emoji TEXT DEFAULT ''
);
");
}