New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
π Fixed 3.0 migration for SQLite #11270
Conversation
closes TryGhost#11263 - The issue here is with hitting SQLite's internal SQLITE_LIMIT_VARIABLE_NUMBER limit when updating with large amount of posts having metadata fields set (ref.: https://sqlite.org/limits.html#max_variable_number) - Transforming migration to iterative method avoided inserting lots of records at once
Oh good fix, and definitely something to keep in mind for future migrations when doing bulk inserts. π |
I just placed that code into my non runing migration and the migration still fails the last what I see ist:
SO that fix is needed on other parts too I can provide a 2.x sqlite dumb to test with - please contact me for that. |
Looks good - but I think we should investigate the message posted above! |
@jalogisch was able to reproduce this error. Thanks for the report! It has to do with a different migration script, so will open up a separate PR with a fix. |
refs TryGhost#11270 - Fixed 3.0/11-update-posts-html migration which failed in scenario when more than 999 posts with posts_meta relation were present - The issue was originally spotted here: TryGhost#11270 (comment) - The main problem is in the `SELECT` statement which is generated for `findAll` method in Bookshelf which creates `WHERE IN(post_ids_here)` statement with all posts in the database - Using knex directly as that's a preferred way to write migrations (does not depend on the model layer)
refs #11270 - Fixed 3.0/11-update-posts-html migration which failed in scenario when more than 999 posts with posts_meta relation were present - The issue was originally spotted here: #11270 (comment) - The main problem is in the `SELECT` statement which is generated for `findAll` method in Bookshelf which creates `WHERE IN(post_ids_here)` statement with all posts in the database - Using knex directly as that's a preferred way to write migrations (does not depend on the model layer)
closes TryGhost#11349 - The main reason for failure was SQLite's 999 variable limit - More details here TryGhost#11270
closes #11263
It's touching migration code ποΈ I would love your 2 βοΈ for this. Thaaanks!