mirror of
https://github.com/ellite/Wallos.git
synced 2026-05-24 16:55:40 -04:00
* 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>
19 lines
491 B
PHP
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)
|
|
)');
|
|
}
|
|
|
|
?>
|