1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-02 20:15:26 +02:00

Run multiple sql files to update the db as required

Locks the config table to make sure only one instance does the update.
Refactors the start-up against an empty database code to also use the
same update mechanism.
This commit is contained in:
Elliott Stoneham 2016-07-15 16:54:07 +01:00
parent a3cfb06ef7
commit 8fcf67ef17
35 changed files with 251 additions and 178 deletions

View file

@ -17,8 +17,6 @@ export default Ember.Route.extend({
if (pwd.length === 0 || pwd === "{{.DBhash}}") {
this.transitionTo('auth.login'); // don't allow access to this page if we are not in setup mode, kick them out altogether
}
this.session.clearSession();
},
model() {

View file

@ -20,6 +20,7 @@ const {
export default Ember.Service.extend({
ajax: service(),
localStorage: service(),
endpoint: `${config.apiHost}/${config.apiNamespace}`,
orgId: '',
@ -27,6 +28,7 @@ export default Ember.Service.extend({
version: '',
message: '',
allowAnonymousAccess: false,
setupMode: false,
getBaseUrl(endpoint) {
return [this.get('host'), endpoint].join('/');
@ -40,12 +42,14 @@ export default Ember.Service.extend({
let isInSetupMode = dbhash && dbhash !== "{{.DBhash}}";
if (isInSetupMode) {
this.setProperites({
this.setProperties({
title: htmlSafe("Documize Setup"),
allowAnonymousAccess: false
allowAnonymousAccess: true,
setupMode: true
});
this.get('localStorage').clearAll();
return resolve();
return resolve(this);
}
return this.get('ajax').request('public/meta').then((response) => {

View file

@ -22,5 +22,9 @@ export default Ember.Service.extend({
clearSessionItem: function (key) {
delete localStorage[key];
},
clearAll() {
localStorage.clear();
}
});