ethercreative/seo

3.7.1 migration error

Opened this issue · 4 comments

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_TABLE_PREFIX 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

  • Craft version: 3.6.12
  • SEO version: 3.6.7
  • PHP version: 7.4.3
  • Database driver & version: PostgreSQL 12
  • Other Plugins:

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.

Same error for me. Anyone figure this out?

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.

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