ethercreative / seo

SEO utilities including a unique field type, sitemap & redirect manager
MIT License
269 stars 96 forks source link

3.7.1 migration error #354

Open maknapp opened 3 years ago

maknapp commented 3 years ago

Description

I am using PostgreSQL and I am getting a migration error when updating from 3.6.7 to 3.7.1.

*** applying m201207_124200_add_product_types_to_sitemap
Exception: SQLSTATE[42704]: Undefined object: 7 ERROR:  constraint "seo_sitemap_group_check" of relation "cr_seo_sitemap" does not exist
The SQL being executed was: ALTER TABLE "cr_seo_sitemap" DROP CONSTRAINT "seo_sitemap_group_check"

I checked that table and there is a constraint with a similar name: cr_seo_sitemap_group_check. My DB_TABLEPREFIX environment variable is set to `cr`. Should the migration check for that?

Steps to reproduce

  1. Install craft with a DB_TABLE_PREFIX
  2. Install SEO to 3.6.7
  3. Update to 3.7.1

Additional info

nickcobley commented 3 years ago

Same error over here coming from 3.6.3 to 3.7.1 but using MariaDB 10.3, and also have a table prefix in place and have verified the migration works if there is no prefix.

flannelinc commented 2 years ago

Same error for me. Anyone figure this out?

maknapp commented 2 years ago

This was some time ago, but I believe I renamed the constraint to remove the prefix so that the migration had something to do. Something like this for postgresql: ALTER TABLE "cr_seo_sitemap" RENAME CONSTRAINT "cr_seo_sitemap_group_check" TO "seo_sitemap_group_check"

And then run the update again.

flannelinc commented 2 years ago

@maknapp Didn't work for me, but thank you!