GitHub user dosubot[bot] added a comment to the discussion: superset5 to superset6 migration
<!-- Answer --> Since there are no orphaned records, the issue is likely that **the constraint already exists**. This can happen if a previous migration attempt partially succeeded. **Check if the constraint already exists:** For PostgreSQL: ```sql SELECT constraint_name, table_name FROM information_schema.table_constraints WHERE constraint_name = 'fk_themes_created_by_fk_ab_user'; ``` For MySQL: ```sql SELECT CONSTRAINT_NAME, TABLE_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_NAME = 'fk_themes_created_by_fk_ab_user'; ``` **If the constraint already exists**, this is a duplicate constraint error. You can: 1. Check your current migration state: `SELECT * FROM alembic_version;` 2. The migration may have partially run - you might need to manually update the `alembic_version` table to the next revision after verifying the constraint is in place **Other things to check:** - [Ensure only one process is running migrations](https://github.com/apache/superset/discussions/37232#discussioncomment-15538719) - concurrent migrations can cause issues - What Superset version are you upgrading to? There was a [fix in PR #34433](https://github.com/apache/superset/pull/34433) for theme seeding issues during migrations Can you share the full error output and let me know which database you're using? <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/7e5ce837-3a24-4cd5-9872-02debde44fbd?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/7e5ce837-3a24-4cd5-9872-02debde44fbd?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/7e5ce837-3a24-4cd5-9872-02debde44fbd?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/7e5ce837-3a24-4cd5-9872-02debde44fbd?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7e5ce837-3a24-4cd5-9872-02debde44fbd?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/7e5ce837-3a24-4cd5-9872-02debde44fbd?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7e5ce837-3a24-4cd5-9872-02debde44fbd?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=Since%20there%20are%20no%20orphaned%20records%2C%20the%20issue%20is%20likely%20that%20%2A%2Athe%20constraint%20already%20exists%2A%2A.%20This%20can%20happen%20if%20a%20previous%20migration%20attempt%20partially%20succeeded.%0A%0A%2A%2ACheck%20if%20the%20constraint%20already%20exists%3A%2A%2A%0A%0AFor%20PostgreSQL%3A%0A%60%60%60sql%0ASELECT%20constraint_name%2C%20table_name%20%0AFROM%20information_schema.table_constraints%20%0AWHERE%20constraint_name%20%3D%20%27fk_themes_created_by_fk_ab_user%27%3B%0A%60%60%60%0A%0AFor%20MySQL%3A%0A%60%60%60sql%0ASELECT%20CONSTRAINT_NAME%2C%20TABLE_NAME%20%0AFROM%20INFORMATION_SCHEMA.TABLE_CONSTRAINTS%20%0AWHERE%20CONSTRAINT_NAME%20%3D%20%27fk_themes_created_by_fk_ab_user%27%3B%0A%60%60%60%0A%0A%2A%2AIf%20the%20constra int%20already%20exists%2A%2A%2C%20this%20is%20a%20duplicate%20constraint%20error.%20You%20can%3A%0A1.%20Check%20your%20current%20migration%20state%3A%20%60SELECT%20%2A%20FROM%20alembic_version%3B%60%0A2.%20The%20migration%20may%20have%20partially%20run%20-%20you%20might%20need%20to%20manually%20update%20the%20%60alembic_version%60%20table%20to%20the%20next%20revision%20after%20verifying%20the%20constraint%20is%20in%20place%0A%0A%2A%2AOther%20things%20to%20check%3A%2A%2A%0A-%20%5BEnsure%20only%20one%20process%20is%20running%20migrations%5D%28https%3A//github.com/apache/superset/discussions/37232%23discussioncomment-15538719%29%20-%20concurrent%20migrations%20can%20cause%20issues%0A-%20What%20Superset%20version%20are%20you%20upgrading%20to%3F%20There%20was%20a%20%5Bfix%20in%20PR%20%2334433%5D%28https%3A//github.com/apache/superset/pull/34433%29%20for%20theme%20seeding%20issues%20during%20migrations%0A%0ACan%20you%20share%20the%20full%20error%20output%20and%20let%20me%20know%20which%20 database%20you%27re%20using%3F) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/38286) GitHub link: https://github.com/apache/superset/discussions/38286#discussioncomment-15943303 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
