Commit de47f609 authored by jan.koester's avatar jan.koester
Browse files

test

parent 759a8fdc
Loading
Loading
Loading
Loading
+6 −2
Changes for plugins/google/google.cpp: 6 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -55,10 +55,14 @@ namespace blogi {
                << ");";
            Args->database[0]->exec(sql, res);

            // Migrate existing installations that lack the photo column
            // Migrate existing installations that lack the photo column.
            // 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.
            dbpp::SQL sqlmig;
            dbpp::DBResult resmig;
            sqlmig << "ALTER TABLE google_reviews ADD COLUMN IF NOT EXISTS author_photo_url text;";
            sqlmig << "ALTER TABLE google_reviews ADD COLUMN author_photo_url text;";
            try { Args->database[0]->exec(sqlmig, resmig); } catch(...) {}

            try { getConfig(*Args->database[0], "GOOGLE_PLACES_API_KEY", _apiKey); } catch(...) {}