Skip to content
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

Migration error updating from 2.3.0 to 2.3.1 - missing column ownerSiteId #315

Closed
peteeveleigh opened this issue Dec 3, 2019 · 2 comments

Comments

@peteeveleigh
Copy link

peteeveleigh commented Dec 3, 2019

Tried to update from 2.3.0 to 2.3.1 in Craft 3.3.16.3.

This worked locally but failed on my staging server so I think may be down to MySQL versions or something. Though that doesn't really explain the error.

I updated locally via the CP and using Project Config so the changes were replicated when I deployed to my Staging server. Upon clicking the "Finish Up" button the following error occurred.

`Database Exception: SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'ownerSiteId'; check that column/key exists
The SQL being executed was: ALTER TABLE supertableblocks DROP COLUMN ownerSiteId

Migration: verbb\supertable\migrations\m190714_000000_propagation_method

Output:

drop column ownerSiteId from table {{%supertableblocks}} ...Exception: SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'ownerSiteId'; check that column/key exists
The SQL being executed was: ALTER TABLE supertableblocks DROP COLUMN ownerSiteId (/srv/users/serverpilot/apps/qoho-staging/vendor/yiisoft/yii2/db/Schema.php:674)
#0 /srv/users/serverpilot/apps/qoho-staging/vendor/yiisoft/yii2/db/Command.php(1295): yii\db\Schema->convertException(Object(PDOException), 'ALTER TABLE su...')
#1 /srv/users/serverpilot/apps/qoho-staging/vendor/yiisoft/yii2/db/Command.php(1091): yii\db\Command->internalExecute('ALTER TABLE su...')
#2 /srv/users/serverpilot/apps/qoho-staging/vendor/yiisoft/yii2/db/Migration.php(392): yii\db\Command->execute()
#3 /srv/users/serverpilot/apps/qoho-staging/vendor/verbb/super-table/src/migrations/m190714_000000_propagation_method.php(15): yii\db\Migration->dropColumn('{{%supertablebl...', 'ownerSiteId')
#4 /srv/users/serverpilot/apps/qoho-staging/vendor/craftcms/cms/src/db/Migration.php(58): verbb\supertable\migrations\m190714_000000_propagation_method->safeUp()
#5 /srv/users/serverpilot/apps/qoho-staging/vendor/craftcms/cms/src/db/MigrationManager.php(239): craft\db\Migration->up(true)
#6 /srv/users/serverpilot/apps/qoho-staging/vendor/craftcms/cms/src/db/MigrationManager.php(159): craft\db\MigrationManager->migrateUp(Object(verbb\supertable\migrations\m190714_000000_propagation_method))
#7 /srv/users/serverpilot/apps/qoho-staging/vendor/craftcms/cms/src/services/Updates.php(238): craft\db\MigrationManager->up()
#8 /srv/users/serverpilot/apps/qoho-staging/vendor/craftcms/cms/src/controllers/BaseUpdaterController.php(522): craft\services\Updates->runMigrations(Array)
#9 /srv/users/serverpilot/apps/qoho-staging/vendor/craftcms/cms/src/controllers/UpdaterController.php(209): craft\controllers\BaseUpdaterController->runMigrations(Array, 'restore-db')
#10 [internal function]: craft\controllers\UpdaterController->actionMigrate()
#11 /srv/users/serverpilot/apps/qoho-staging/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#12 /srv/users/serverpilot/apps/qoho-staging/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#13 /srv/users/serverpilot/apps/qoho-staging/vendor/craftcms/cms/src/web/Controller.php(187): yii\base\Controller->runAction('migrate', Array)
#14 /srv/users/serverpilot/apps/qoho-staging/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('migrate', Array)
#15 /srv/users/serverpilot/apps/qoho-staging/vendor/craftcms/cms/src/web/Application.php(299): yii\base\Module->runAction('updater/migrate', Array)
#16 /srv/users/serverpilot/apps/qoho-staging/vendor/craftcms/cms/src/web/Application.php(652): craft\web\Application->runAction('updater/migrate')
#17 /srv/users/serverpilot/apps/qoho-staging/vendor/craftcms/cms/src/web/Application.php(251): craft\web\Application->_processUpdateLogic(Object(craft\web\Request))
#18 /srv/users/serverpilot/apps/qoho-staging/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#19 /srv/users/serverpilot/apps/qoho-staging/public/index.php(21): yii\base\Application->run()
#20 {main}`

I got around the issue by manually adding a 'siteOwnerId' column to the 'supertableblocks' table before running the update. 🤷‍♂

  • Plugin version: 2.3.1
  • Craft version: 3.3.16.3
  • MySQL version: 5.5.62 (local version is 5.7)

--

@peteeveleigh peteeveleigh changed the title Problem updating from 2.3.0 to 2.3.1 Migration error updating from 2.3.0 to 2.3.1 - missing column ownerSiteId Dec 3, 2019
@rogertinch
Copy link

rogertinch commented Dec 6, 2019

@engram-design Any fix soon in the works for this? It's currently blocking our production launch. Should we just apply the hack above to get around it for now since we're not sure of ETA of the fix?

@engram-design
Copy link
Member

Fixed in 2.3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants