fix(analytics): fixed issues with db init and refactor of code and names

This commit is contained in:
hadestructhor
2025-04-10 23:48:46 +02:00
parent 0588acb40a
commit 28e288db2c
10 changed files with 44 additions and 45 deletions
+1 -4
View File
@@ -202,10 +202,7 @@ async function createTables() {
table.text("footer_text");
table.text("custom_css");
table.boolean("show_powered_by").notNullable().defaultTo(true);
table.string("analytics_id");
table.string("analytics_domain_url");
table.enu("analytics_type", [ "google", "umami", "plausible" ]).defaultTo(null);
table.string("google_analytics_tag_id");
});
// maintenance_status_page
@@ -3,7 +3,7 @@ exports.up = function (knex) {
return knex.schema
.alterTable("status_page", function (table) {
table.renameColumn("google_analytics_tag_id", "analytics_id");
table.string("analytics_domain_url");
table.string("analytics_script_url");
table.enu("analytics_type", [ "google", "umami", "plausible", "matomo" ]).defaultTo(null);
}).then(() => {
@@ -17,7 +17,7 @@ exports.up = function (knex) {
exports.down = function (knex) {
return knex.schema.alterTable("status_page", function (table) {
table.renameColumn("analytics_id", "google_analytics_tag_id");
table.dropColumn("analytics_domain_url");
table.dropColumn("analytics_script_url");
table.dropColumn("analytics_type");
});
};