Ghost/core/server
Daniel Lockyer ddaa4ee5e1 Removed unnecessary checks during initial DB init
refs https://github.com/TryGhost/Toolbox/issues/202

- during DB init, we have to create all the tables
- right now we loop over all tables and call the `createTable` command
  - this command checks if the table exists and if not, creates the table
  - this works fine but it means we query the database for every table
  - in MySQL, we query the information_schema table, which we've seen
    issues with before because it doesn't have indexes
- the smarter thing to do here is to get all the tables that already exist,
  remove them from the list, and just straight up create them without
  further checks
- this entire thing should be protected by the migration lock so we
  shouldn't encounter issues from multiple processes initializing the DB
  and tables existing after the initial check
- this commit also removes the check from `createTable` because this isn't
  really needed. We should be using the migration utils, which do
  check for existing tables. I've added a note to the function and
  audited anywhere we still call the function
- this commit removes (- 49 tables + 1 initial check) 48 queries from
  the initial DB init
2022-02-21 08:44:40 +01:00
..
adapters Switch to @tryghost/errors from ignition errors package (#13807) 2021-12-01 10:22:01 +00:00
api Fixed linting issue 2022-02-10 12:25:57 +01:00
data Removed unnecessary checks during initial DB init 2022-02-21 08:44:40 +01:00
lib Revert "Revert "Extract logging from DI patterns, only use @tryghost/logging package"" (#13884) 2021-12-14 11:22:39 +00:00
models Refactored default settings population to reduce unnecessary DB queries 2022-02-08 10:11:00 +01:00
services Renamed defaultSettings to defaultRouteSettings 2022-02-21 20:06:20 +13:00
views Added new, simpler, linear boot process 2021-02-08 11:56:44 +00:00
web 🐛 Fixed Offer Redemptions being over counted (#13988) 2022-01-18 17:56:47 +02:00
analytics-events.js Added comments to all usages of lib/common/events 2021-07-07 16:02:44 +01:00
ghost-server.js Switch to @tryghost/errors from ignition errors package (#13807) 2021-12-01 10:22:01 +00:00
notify.js Removed unused import 2021-12-06 08:17:07 +00:00
overrides.js Set global Luxon timezone override to UTC 2021-10-20 09:19:29 +02:00
run-update-check.js Revert "Revert "Extract logging from DI patterns, only use @tryghost/logging package"" (#13884) 2021-12-14 11:22:39 +00:00
update-check.js Added library for extracting database information 2022-01-18 09:31:08 +00:00