Ghost/core/server/data
Hannah Wolfe b00d9fee6d 🎨 ⏱ Cleanup / optimise the server.init() function (#7985)
refs #2182

* 🔥 Remove unused options from server init
- this is left over from old code and is now unused

* 🎨 Move knex-migrator check to db health

- Move complex check function into own module
- Call module from server/index.js
- This just improves the readability of server/index.js

* 🔥 Remove old comments

- These comments all make no sense now!

* 🎨 ⏱ Move model init out of promise chain

- Model.init() does not return a promise
- Therefore, we can move it to the top of the init function, outside of the promise change
- This should be a minor optimisation, and again improves readability /clarity of what's happening

*  ⁉️ Move DBHash init / first run to Settings model

- this structure is left over from when we had code we executed on the first run of Ghost
- the implementation used the API to initialise one setting before populateDefaults is called
- this had lots of dependencies - the whole model, API, and permissions structure had to be initialised for it to work
- the new implementation is simpler, it captures the dbHash getting initialised during populateDefaults()
- it also adds an event, so we can do first-run code later if we really want to (or maybe apps can?!)
- perhaps this is hiding behaviour, and there's a nicer way to do it, but populateDefaults seems like a sane place to populate a default setting 😁

* ⏱ Optimise require order so config is first

- the first require to config will cause the files to be read etc
- this ensures that it happens early, and isn't confusingly timed as part of loading a different module

* 🎨 Simplify settings model changes
2017-02-17 17:44:34 +01:00
..
db 🎨 ⏱ Cleanup / optimise the server.init() function (#7985) 2017-02-17 17:44:34 +01:00
export 🔥 remove database version (#7894) 2017-01-26 12:12:00 +00:00
import Import from LTS blogs now properly adds tags to posts. (#7926) 2017-01-31 17:50:44 +01:00
importer 🔥 remove imageRelPath (#7927) 2017-02-03 14:42:05 +00:00
meta 🔥 do not store settings in config (#7924) 2017-02-03 13:15:11 +00:00
migrations 🔥 remove database version (#7894) 2017-01-26 12:12:00 +00:00
schema public client registration: remember auth url (#7994) 2017-02-14 12:41:28 +00:00
slack 🎨 add urlFor('admin') and increase usage of urlFor helper (#7935) 2017-02-02 18:51:35 +00:00
validation Use moment-timezone when using .tz() (#7653) 2016-10-31 14:44:24 +01:00
xml 🎨 😎 config env usages (#7929) 2017-02-03 18:25:39 +00:00
timezones.json Adds UTC as select option to timezones select list 2016-06-10 15:19:16 +02:00