ietf-tools / www

A customized CMS for the IETF website
BSD 3-Clause "New" or "Revised" License
22 stars 45 forks source link

Conflicting migrations #364

Closed kesara closed 7 months ago

kesara commented 7 months ago

357 and #356 created two different migrations under ietf/snippets/migrations with the same migration number iteration: 003.

This is producing an error: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0003_alter_workinggroup_list_subscribe, 0003_person_slug in snippets).

kesara commented 7 months ago

@mgax, on my local machine I still can't run migrations from #356.

application-1  |   Applying snippets.0003_person_slug...
application-1 exited with code 1
database-1     | 2023-12-15 03:57:09.645 UTC [42] ERROR:  column wagtailcore_grouppagepermission.permission_id does not exist at character 662
database-1     | 2023-12-15 03:57:09.645 UTC [42] STATEMENT:  UPDATE "wagtailcore_grouppagepermission" SET "permission_id" = (SELECT U0."id" FROM "auth_permission" U0 INNER JOIN "django_content_type" U1 ON (U0."content_type_id" = U1."id") WHERE (U0."codename" = (CONCAT((CASE WHEN ("wagtailcore_grouppagepermission"."permission_type" = 'edit') THEN 'change' ELSE "wagtailcore_grouppagepermission"."permission_type" END)::text, ('_page')::text)) AND U0."content_type_id" = 1) ORDER BY U1."app_label" ASC, U1."model" ASC, U0."codename" ASC LIMIT 1), "permission_type" = CASE WHEN ("wagtailcore_grouppagepermission"."permission_type" = 'edit') THEN 'change' ELSE "wagtailcore_grouppagepermission"."permission_type" END WHERE ("wagtailcore_grouppagepermission"."permission_id" IS NULL OR "wagtailcore_grouppagepermission"."permission_type" = 'edit')
application-1  | Operations to perform:
application-1  |   Apply all migrations: admin, announcements, auth, bibliography, blog, contenttypes, documents, events, forms, glossary, home, iesg_statement, images, sessions, snippets, standard, taggit, topics, utils, wagtailadmin, wagtailcore, wagtaildocs, wagtailembeds, wagtailforms, wagtailimages, wagtailredirects, wagtailsearch, wagtailsearchpromotions, wagtailusers
application-1  | Running migrations:
database-1     | 2023-12-15 03:57:09.813 UTC [42] ERROR:  could not create unique index "snippets_person_slug_key"
database-1     | 2023-12-15 03:57:09.813 UTC [42] DETAIL:  Key (slug)=() is duplicated.
database-1     | 2023-12-15 03:57:09.813 UTC [42] STATEMENT:  ALTER TABLE "snippets_person" ADD COLUMN "slug" varchar(511) DEFAULT '' NOT NULL UNIQUE
mgax commented 7 months ago

on my local machine I still can't run migrations from #356.

What a mess. It looks like I was a bit too cavalier with https://github.com/ietf-tools/wagtail_website/pull/356/commits/452ba46ffee3c99a1c5e4d5ea3fa45cf482eea33, sorry. #366 should fix it.

kesara commented 7 months ago

No worries.Thanks for the fix.