diff --git a/documize/api/request/init.go b/documize/api/request/init.go index f843fe55..74b609f3 100644 --- a/documize/api/request/init.go +++ b/documize/api/request/init.go @@ -19,6 +19,7 @@ import ( "github.com/jmoiron/sqlx" "github.com/documize/community/documize/database" + "github.com/documize/community/documize/web" "github.com/documize/community/wordsmith/environment" "github.com/documize/community/wordsmith/log" "github.com/documize/community/wordsmith/utility" @@ -68,13 +69,15 @@ func init() { } // go into setup mode if required - if database.Check(Db, connectionString) { - if err := database.Migrate(true /* the config table exists */); err != nil { - log.Error("Unable to run database migration: ", err) - os.Exit(2) + if web.SiteMode != web.SiteModeOffline { + if database.Check(Db, connectionString) { + if err := database.Migrate(true /* the config table exists */); err != nil { + log.Error("Unable to run database migration: ", err) + os.Exit(2) + } + } else { + log.Info("database.Check(Db) !OK, going into setup mode") } - } else { - log.Info("database.Check(Db) !OK, going into setup mode") } return false // value not changed diff --git a/documize/database/templates/offline.html b/documize/database/templates/offline.html new file mode 100644 index 00000000..1206b958 --- /dev/null +++ b/documize/database/templates/offline.html @@ -0,0 +1,136 @@ + + + + + + + + + Documize - Essential Maintenance + + + + + + + +
+
+ + + +
+
+ Down For Maintenance +
+
+

Essential Maintenance

+

We're currently updating Documize, back real soon.

+
+
+ +
+
+ + +