summaryrefslogtreecommitdiffstats
path: root/modules-available/news
diff options
context:
space:
mode:
authorSimon Rettberg2023-07-18 14:21:03 +0200
committerSimon Rettberg2023-07-18 14:21:03 +0200
commitff3474e2e69d1ac92eb227dfedd170cfb012ba94 (patch)
treea4f2a940f0c6001560bb5e245c7b4d9afe3182cc /modules-available/news
parent[systemstatus] Show "reboot required" message on update-tab too (diff)
downloadslx-admin-ff3474e2e69d1ac92eb227dfedd170cfb012ba94.tar.gz
slx-admin-ff3474e2e69d1ac92eb227dfedd170cfb012ba94.tar.xz
slx-admin-ff3474e2e69d1ac92eb227dfedd170cfb012ba94.zip
[news] Fix install: Falsely reported UPDATE_DONE every time
Diffstat (limited to 'modules-available/news')
-rw-r--r--modules-available/news/install.inc.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules-available/news/install.inc.php b/modules-available/news/install.inc.php
index 89fc7069..18b60800 100644
--- a/modules-available/news/install.inc.php
+++ b/modules-available/news/install.inc.php
@@ -11,7 +11,7 @@ if (tableExists('news')) {
finalResponse(UPDATE_FAILED, "Could not rename news to vmchooser_pages: " . Database::lastError());
}
$dbret[] = UPDATE_DONE;
- if (false === Database::exec("ALTER TABLE `vmchooser_pages` ADD COLUMN type VARCHAR(10)")) {
+ if (false === Database::exec("ALTER TABLE `vmchooser_pages` ADD COLUMN type VARCHAR(10) CHARACTER SET ascii NOT NULL")) {
EventLog::warning("Could not add type column to vmchooser_pages: " . Database::lastError());
}
if (false === Database::exec("UPDATE `vmchooser_pages` SET `type` = 'news' WHERE 1")) {
@@ -35,20 +35,24 @@ $dbret[] = tableCreate('vmchooser_pages', "
if (tableGetIndex('vmchooser_pages', ['dateline']) !== false) {
Database::exec('ALTER TABLE vmchooser_pages DROP KEY `dateline`');
Database::exec('ALTER TABLE vmchooser_pages ADD KEY `type` (`type`, `dateline`)');
+ $dbret[] = UPDATE_DONE;
}
if (tableGetIndex('vmchooser_pages', ['type', 'expires', 'dateline']) === false) {
Database::exec('ALTER TABLE vmchooser_pages ADD KEY `all3` (`type`, `expires`, `dateline`)');
+ $dbret[] = UPDATE_DONE;
}
if (!tableHasColumn('vmchooser_pages', 'expires')) {
Database::exec('ALTER TABLE vmchooser_pages ADD COLUMN `expires` int(10) unsigned NOT NULL AFTER `dateline`');
Database::exec('UPDATE vmchooser_pages SET expires = dateline + 86400 * 3650 WHERE expires = 0'); // ~10 Years
+ $dbret[] = UPDATE_DONE;
}
if (!tableHasColumn('vmchooser_pages', 'locationid')) {
Database::exec('ALTER TABLE vmchooser_pages ADD COLUMN `locationid` int(11) NULL AFTER `expires`');
+ $dbret[] = UPDATE_DONE;
}
-$dbret[] = Database::exec('ALTER TABLE vmchooser_pages MODIFY `type` varchar(10) CHARACTER SET ascii NOT NULL');
+Database::exec('ALTER TABLE vmchooser_pages MODIFY `type` varchar(10) CHARACTER SET ascii NOT NULL');
$dbret[] = tableAddConstraint('remoteaccess_x_location', 'locationid', 'location', 'locationid',
'ON UPDATE CASCADE ON DELETE CASCADE');