-
Notifications
You must be signed in to change notification settings - Fork 10
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
[Craft 5] migration error upgrading from 5.0.2 => 5.1.0 #127
Comments
Thanks for reporting! Would you mind hacking the plugin to see if this fix will work? Open this file:
Replace the public function safeUp(): bool
{
// Add new columns
$this->_newColumns();
// Populate new columns with existing data
$this->_populateData();
// Make new column not nullable
// - AFTER the column has been populated
// - BEFORE adding indexes and foreign keys
$this->alterColumn(Install::GM_ADDRESSES, 'siteId', $this->integer()->notNull());
// Add new column indexes
$this->_newIndexes();
// Add new foreign keys
$this->_newForeignKeys();
// Post an announcement
$this->_announcement();
// Success
return true;
} If that works, let me know and I can release an official patch for it! 👍 |
Thanks @lindseydiloreto - will report back 🫡 |
Confirmed that the ☝️ change resolved the issue we were having on 5.1.0 upgrade. A release would be great when you can, but appreciate we are close to the holidays, and our individual issue is resolved by using a temp fork with your change for now |
Hope you had a great holiday season, thanks for your patience @tomdavies! This patch has been officially released in v5.1.1. And thanks again for reporting it! 🍺 |
I'm seeing the same issue reported in #124 and #125, but with the Craft 5 version of the plugin (Plugin version: 5.1.0, Craft version: 5.5.5):
Weirdly, the issue does not occur in every environment. The migrations ran fine in local dev (ddev) + internal QA, but breaks in client's environment. DB is MySQL 8.0.x in all three envs. I think main the difference might be whether
devMode
is true in the relevant environment or not.Is a similar fix from 4.6.1 applicable to the Craft 5 branch, or not really?
I can provide a pre-migration DB snapshot + composer.json if needed.
Cheers!
The text was updated successfully, but these errors were encountered: