Commit 49c5bc06 authored by jan.koester's avatar jan.koester
Browse files

test

parent de47f609
Loading
Loading
Loading
Loading
+6 −2
Changes for plugins/navbar/navbar.cpp: 6 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -91,9 +91,13 @@ namespace blogi {
                << ");";
            Args->database[0]->exec(sql,res);

            // Migration: add position column if missing
            // Migration: add position column if missing. Plain ADD COLUMN (no
            // "IF NOT EXISTS") is portable to MySQL server versions that don't
            // support that conditional syntax at all — those would otherwise
            // throw an ALTER TABLE syntax error, silently swallowed below,
            // leaving the column permanently missing.
            sql.clear(); res.clear();
            sql << "ALTER TABLE navbar_items ADD COLUMN IF NOT EXISTS position integer default 0;";
            sql << "ALTER TABLE navbar_items ADD COLUMN position integer default 0;";
            try { Args->database[0]->exec(sql,res); } catch(...) {}

            return;