mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 18:01:36 +03:00
2bfd8f8b7e
refs https://github.com/TryGhost/Team/issues/1471 - This is a many-to-one relation so that many posts can be linked to a specific newsletter - The `newsletters` table had to come first in the schema file so that it's initialized before the `posts` table (because of the foreign key) - Updated the model to make sure the new field doesn't leak in the API for now - This migration isn't using the `createAddColumnMigration` util because of a performance issue. In MySQL, adding/dropping a column without `algorithm=copy` uses the INPLACE algorithm which was too slow on big posts tables (~3 minutes for 10k posts). Switching to the COPY algorithm fixed the issue (~3 seconds for 10k posts). - SQLite isn't using the codepath where we run a raw SQL query because `knex` is doing multiple queries to add/remove a column |
||
---|---|---|
.. | ||
hooks | ||
init | ||
versions | ||
utils.js |