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

Compatibility with Craft 3.2 #81

Closed
watchwood opened this issue Aug 14, 2019 · 2 comments
Closed

Compatibility with Craft 3.2 #81

watchwood opened this issue Aug 14, 2019 · 2 comments

Comments

@watchwood
Copy link

Description

I have a preexisting site with this plugin running on Craft 3.1. When I attempt to update that site to craft 3.2, I get an error saying the drafts table already exists.

I'm under the impression that the drafts table exists as a Workflow table in Craft 3.1, and that Craft wants to use a table of the same name in 3.2

Steps to reproduce

  1. Have a site with Workflow and Craft 3.1
  2. Try to upgrade site to Craft 3.2

Additional info

  • Plugin version: 1.1.2 -> 1.2.1
  • Craft version: 3.1.34.2 -> 3.2.5.1
@watchwood
Copy link
Author

Database Exception: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'drafts' already exists
The SQL being executed was: CREATE TABLE drafts (
id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
sourceId int(11) NOT NULL,
creatorId int(11) NOT NULL,
name varchar(255) NOT NULL,
notes text
) ENGINE=InnoDb DEFAULT CHARSET=utf8

Migration: craft\migrations\m190312_152740_element_revisions

Output:

create table {{%drafts}} ...Exception: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'drafts' already exists
The SQL being executed was: CREATE TABLE drafts (
id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
sourceId int(11) NOT NULL,
creatorId int(11) NOT NULL,
name varchar(255) NOT NULL,
notes text
) ENGINE=InnoDb DEFAULT CHARSET=utf8 (/home/vagrant/code/vendor/yiisoft/yii2/db/Schema.php:664)
#0 /home/vagrant/code/vendor/yiisoft/yii2/db/Command.php(1295): yii\db\Schema->convertException(Object(PDOException), 'CREATE TABLE d...')
#1 /home/vagrant/code/vendor/yiisoft/yii2/db/Command.php(1091): yii\db\Command->internalExecute('CREATE TABLE d...')
#2 /home/vagrant/code/vendor/yiisoft/yii2/db/Migration.php(323): yii\db\Command->execute()
#3 /home/vagrant/code/vendor/craftcms/cms/src/migrations/m190312_152740_element_revisions.php(26): yii\db\Migration->createTable('{{%drafts}}', Array)
#4 /home/vagrant/code/vendor/craftcms/cms/src/db/Migration.php(56): craft\migrations\m190312_152740_element_revisions->safeUp()
#5 /home/vagrant/code/vendor/craftcms/cms/src/db/MigrationManager.php(243): craft\db\Migration->up(true)
#6 /home/vagrant/code/vendor/craftcms/cms/src/db/MigrationManager.php(163): craft\db\MigrationManager->migrateUp(Object(craft\migrations\m190312_152740_element_revisions))
#7 /home/vagrant/code/vendor/craftcms/cms/src/services/Updates.php(217): craft\db\MigrationManager->up()
#8 /home/vagrant/code/vendor/craftcms/cms/src/controllers/BaseUpdaterController.php(521): craft\services\Updates->runMigrations(Array)
#9 /home/vagrant/code/vendor/craftcms/cms/src/controllers/UpdaterController.php(208): craft\controllers\BaseUpdaterController->runMigrations(Array, 'restore-db')
#10 [internal function]: craft\controllers\UpdaterController->actionMigrate()
#11 /home/vagrant/code/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#12 /home/vagrant/code/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#13 /home/vagrant/code/vendor/craftcms/cms/src/web/Controller.php(187): yii\base\Controller->runAction('migrate', Array)
#14 /home/vagrant/code/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('migrate', Array)
#15 /home/vagrant/code/vendor/craftcms/cms/src/web/Application.php(299): yii\base\Module->runAction('updater/migrate', Array)
#16 /home/vagrant/code/vendor/craftcms/cms/src/web/Application.php(653): craft\web\Application->runAction('updater/migrate')
#17 /home/vagrant/code/vendor/craftcms/cms/src/web/Application.php(231): craft\web\Application->_processUpdateLogic(Object(craft\web\Request))
#18 /home/vagrant/code/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#19 /home/vagrant/code/public/index.php(22): yii\base\Application->run()
#20 {main}

@engram-design
Copy link
Member

Hmm, Workflow never used a drafts table, even in Craft 2, so I don't think this is a Workflow issue.

Might be related to craftcms/cms#4530?

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

2 participants