Files
Wallos/migrations/000042.php
Easy 279ddf61ce add serverchan notification (#951)
* add serverchan notification

* Update endpoints/cronjobs/sendnotifications.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update endpoints/notifications/testserverchannotifications.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Miguel Ribeiro <k.d.mitnick@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-20 15:06:49 +00:00

19 lines
491 B
PHP

<?php
/*
* This migration adds a table to store Serverchan notification settings
*/
$tableQuery = $db->query("SELECT name FROM sqlite_master WHERE type='table' AND name='serverchan_notifications'");
$tableExists = $tableQuery->fetchArray(SQLITE3_ASSOC);
if (!$tableExists) {
$db->exec('CREATE TABLE serverchan_notifications (
enabled BOOLEAN DEFAULT 0,
sendkey TEXT DEFAULT "",
user_id INTEGER,
FOREIGN KEY (user_id) REFERENCES user(id)
)');
}
?>