<p>According to the error, the <code>entrydrafts</code> table cannot be dropped because the <code>workflow_submissions</code> table depends on it. That looks like it belongs to the <a href="https://plugins.craftcms.com/workflow?craft4" rel="nofollow noreferrer">Workflow plugin</a>, so try uninstalling the Workflow plugin <em>before</em> running the migration, which should remove that table and its dependency.</p>

CC BY-SA 4.0
2023-04-25T15:35:01.990Z
Thank you Ben. Removing the plugin was one of the first things I did.  Are there steps that I can do to resolve the conflicts in such a way that Craft is happy and will not try to run the migration?
Unlimited
CC BY-SA 4.0
2023-04-25T17:26:22.737Z
Does the table still exist in the DB? If so, try dropping it manually.
Ben Croker
CC BY-SA 4.0
2023-04-25T17:36:36.653Z
I deleted the workflow_submissions table manually, but the migration still failed.  It looks like the m210624_222934_drop_deprecated_tables.php migration uses a 'drop if exists' class method but the method does not do a DROP CASCADE.  Unless I've missed something.
Unlimited
CC BY-SA 4.0
2023-04-26T15:20:51.517Z
What error message is it failing with now?
Ben Croker
CC BY-SA 4.0
2023-04-26T20:42:54.257Z
Sorry Ben, I got to it this morning and I wasn't getting the error anymore, somehow, the migration must have completed properly. I had manually dropped the workflow_submissions table... maybe that removed the dependencies for the depreciated tables?  I've been working this out on a development server (going from 3.4 to 4.4.8), so that I can work through it quickly on the live server.  I did this time through incrementally, but I'd like to go directly from Craft 3.4 to 3.8.7. Do you think that would work?
Unlimited
CC BY-SA 4.0
2023-04-27T23:36:16.590Z
I would think so.
Ben Croker
CC BY-SA 4.0
2023-04-22T01:10:53.683Z
2023-04-22T01:10:53.683Z
Ben Croker
<p>I am SO close to getting my Craft 3.8.7 upgraded to 4.0.  Now, I'm getting an error when it tries to run a migration. I read in the docs that there were a couple of tables that were deprecated, so I was surprised to see an error related to a dependency with the <code>entrydrafts</code> table.  I looked for any notes on this migration but could not find anything.  Here's the error:</p>
<pre><code>    Database Exception: SQLSTATE[2BP01]: Dependent objects still exist: 7 ERROR: cannot drop table entrydrafts because other objects depend on it
DETAIL: constraint workflow_submissions_draftId_fk on table workflow_submissions depends on table entrydrafts
HINT: Use DROP ... CASCADE to drop the dependent objects too.
The SQL being executed was: DROP TABLE IF EXISTS &quot;entrydrafts&quot;

Migration: craft\migrations\m210624_222934_drop_deprecated_tables

Output:

&gt; dropping {{%entrydrafterrors}} if it exists ... done (time: 0.009s)
&gt; dropping {{%entryversionerrors}} if it exists ... done (time: 0.004s)
&gt; dropping {{%entrydrafts}} if it exists ...Exception: SQLSTATE[2BP01]: Dependent objects still exist: 7 ERROR: cannot drop 
</code></pre>

<craft4><upgrades>
Craft 4 Upgrade - Migration issue
# Craft 4 Upgrade - Migration issue

(Asked by: username_0 on 2023-04-21)

I am SO close to getting my Craft 3.8.7 upgraded to 4.0.  Now, I'm getting an error when it tries to run a migration. I read in the docs that there were a couple of tables that were deprecated, so I was surprised to see an error related to a dependency with the entrydrafts table.  I looked for any notes on this migration but could not find anything.  Here's the error:
    Database Exception: SQLSTATE[2BP01]: Dependent objects still exist: 7 ERROR: cannot drop table entrydrafts because other objects depend on it
DETAIL: constraint workflow_submissions_draftId_fk on table workflow_submissions depends on table entrydrafts
HINT: Use DROP ... CASCADE to drop the dependent objects too.
The SQL being executed was: DROP TABLE IF EXISTS "entrydrafts"

Migration: craft\migrations\m210624_222934_drop_deprecated_tables

Output:

> dropping {{%entrydrafterrors}} if it exists ... done (time: 0.009s)
> dropping {{%entryversionerrors}} if it exists ... done (time: 0.004s)
> dropping {{%entrydrafts}} if it exists ...Exception: SQLSTATE[2BP01]: Dependent objects still exist: 7 ERROR: cannot drop

**Tags:** craft4, upgrades


---

## 1 answers

### Answer by username_1 on 2023-04-22. Score: 1

According to the error, the `entrydrafts` table cannot be dropped because the `workflow_submissions` table depends on it. That looks like it belongs to the [Workflow plugin](https://plugins.craftcms.com/workflow?craft4), so try uninstalling the Workflow plugin *before* running the migration, which should remove that table and its dependency.

> **Comments:**
> **username_0**: Thank you Ben. Removing the plugin was one of the first things I did.  Are there steps that I can do to resolve the conflicts in such a way that Craft is happy and will not try to run the migration?  
> **username_1**: Does the table still exist in the DB? If so, try dropping it manually.  
> **username_0**: I deleted the workflow_submissions table manually, but the migration still failed.  It looks like the m210624_222934_drop_deprecated_tables.php migration uses a 'drop if exists' class method but the method does not do a DROP CASCADE.  Unless I've missed something.  
> **username_1**: What error message is it failing with now?  
> **username_0**: Sorry Ben, I got to it this morning and I wasn't getting the error anymore, somehow, the migration must have completed properly. I had manually dropped the workflow_submissions table... maybe that removed the dependencies for the depreciated tables?  I've been working this out on a development server (going from 3.4 to 4.4.8), so that I can work through it quickly on the live server.  I did this time through incrementally, but I'd like to go directly from Craft 3.4 to 3.8.7. Do you think that would work?  
> **username_1**: I would think so.  

---

