Cannot migrate wagtailcore to zero
See original GitHub issueRunning django-admin migrate wagtailcore zero
fails as shown below, likely because of a missing dependency.
I suspect this is the reverse of the problem described in this comment.
Operations to perform:
Unapply all migrations: wagtailcore
Running migrations:
Rendering model states... DONE
Unapplying wagtailsearchpromotions.0002_capitalizeverbose... OK
Unapplying wagtailsearchpromotions.0001_initial... OK
Unapplying wagtailsearch.0003_remove_editors_pick... OK
Unapplying wagtailsearch.0002_add_verbose_names... OK
Unapplying wagtailsearch.0001_initial... OK
Unapplying wagtailredirects.0005_capitalizeverbose... OK
Unapplying wagtailredirects.0004_set_unique_on_path_and_site... OK
Unapplying wagtailredirects.0003_make_site_field_editable... OK
Unapplying wagtailredirects.0002_add_verbose_names... OK
Unapplying wagtailredirects.0001_initial... OK
Unapplying wagtailimages.0012_copy_image_permissions_to_collections... OK
Unapplying wagtailimages.0011_image_collection... OK
Unapplying wagtailimages.0010_change_on_delete_behaviour... OK
Unapplying wagtailimages.0009_capitalizeverbose... OK
Unapplying wagtailimages.0008_image_created_at_index... OK
Unapplying wagtailimages.0007_image_file_size... OK
Unapplying wagtailimages.0006_add_verbose_names... OK
Unapplying wagtailimages.0005_make_filter_spec_unique... OK
Unapplying wagtailimages.0004_make_focal_point_key_not_nullable... OK
Unapplying wagtailimages.0003_fix_focal_point_fields... OK
Unapplying wagtailimages.0002_initial_data... OK
Unapplying wagtailforms.0003_capitalizeverbose... OK
Unapplying wagtailforms.0002_add_verbose_names... OK
Unapplying wagtailforms.0001_initial... OK
Unapplying wagtaildocs.0007_merge... OK
Unapplying wagtaildocs.0006_copy_document_permissions_to_collections... OK
Unapplying wagtaildocs.0005_document_collection... OK
Unapplying wagtaildocs.0005_alter_uploaded_by_user_on_delete_action... OK
Unapplying wagtaildocs.0004_capitalizeverbose... OK
Unapplying wagtaildocs.0003_add_verbose_names... OK
Unapplying wagtaildocs.0002_initial_data... OK
Unapplying wagtailcore.0028_merge... OK
Unapplying wagtailcore.0027_fix_collection_path_collation... OK
Unapplying wagtailcore.0026_group_collection_permission... OK
Unapplying wagtailcore.0025_collection_initial_data... OK
Unapplying wagtailcore.0024_collection... OK
Unapplying wagtailcore.0024_alter_page_content_type_on_delete_behaviour... OK
Unapplying wagtailcore.0023_alter_page_revision_on_delete_behaviour... OK
Unapplying wagtailcore.0022_add_site_name... OK
Unapplying wagtailcore.0021_capitalizeverbose... OK
Unapplying wagtailcore.0020_add_index_on_page_first_published_at... OK
Unapplying wagtailcore.0019_verbose_names_cleanup... OK
Unapplying wagtailcore.0018_pagerevision_submitted_for_moderation_index... OK
Unapplying wagtailcore.0017_change_edit_page_permission_description... OK
Unapplying wagtailadmin.0001_create_admin_access_permissions...Traceback (most recent call last):
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
psycopg2.ProgrammingError: relation "wagtailcore_groupcollectionpermission" does not exist
LINE 1: DELETE FROM "wagtailcore_groupcollectionpermission" WHERE "w...
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "~/.virtualenvs/project/bin/django-admin", line 11, in <module>
sys.exit(execute_from_command_line())
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/core/management/__init__.py", line 345, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/core/management/base.py", line 399, in execute
output = self.handle(*args, **options)
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/core/management/commands/migrate.py", line 200, in handle
executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/db/migrations/executor.py", line 96, in migrate
self._migrate_all_backwards(plan, full_plan, fake=fake)
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/db/migrations/executor.py", line 163, in _migrate_all_backwards
self.unapply_migration(states[migration], migration, fake=fake)
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/db/migrations/executor.py", line 218, in unapply_migration
state = migration.unapply(state, schema_editor)
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/db/migrations/migration.py", line 172, in unapply
operation.database_backwards(self.app_label, schema_editor, from_state, to_state)
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/db/migrations/operations/special.py", line 189, in database_backwards
self.reverse_code(from_state.apps, schema_editor)
File "~/.virtualenvs/project/lib/python3.5/site-packages/wagtail/wagtailadmin/migrations/0001_create_admin_access_permissions.py", line 42, in remove_admin_access_permissions
codename='access_admin',
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/db/models/query.py", line 600, in delete
deleted, _rows_count = collector.delete()
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/db/models/deletion.py", line 292, in delete
count = qs._raw_delete(using=self.using)
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/db/models/query.py", line 614, in _raw_delete
return sql.DeleteQuery(self.model).delete_qs(self, using)
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/db/models/sql/subqueries.py", line 81, in delete_qs
cursor = self.get_compiler(using).execute_sql(CURSOR)
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 848, in execute_sql
cursor.execute(sql, params)
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/db/backends/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/db/utils.py", line 95, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/utils/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "~/.virtualenvs/project/lib/python3.5/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "wagtailcore_groupcollectionpermission" does not exist
LINE 1: DELETE FROM "wagtailcore_groupcollectionpermission" WHERE "w...
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Migration error Wagtail - django - Stack Overflow
When I do a migration, I get an error: $ python manage.py migrate Operations to perform: Apply all migrations: admin, auth, contenttypes, ...
Read more >Migrate your Wagtail Website from wagtailtrans to the new ...
This article describes one migration strategy on how to upgrade existing Wagtail websites (version <2.11) with wagtailtrans to the new ...
Read more >Live migration process during maintenance events
Spot VMs can't live migrate to become standard VMs while they are running or be set to automatically restart when there is a...
Read more >Migrations problem when integrating django-allauth
InvalidBasesError: Cannot resolve bases for [<ModelState: 'blog. ... makemigrations runs (no changes detected) by migrate fails.
Read more >Common questions about the Migration and modernization tool
You can't begin a test migration until an initial replication (IR) has been completed for the VM. The test migration button will be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
upgrading from wagtail 1.0 to 1.8 caused following
Commenting this line is the solution https://github.com/wagtail/wagtail/commit/bee221b8c9626df725cae9372c301a03c8ed9bae#diff-c80f81bff2ea91134d39e7fd667808d5R51
I think something wrong with this solution.
Workaround: run
django-admin migrate wagtailadmin zero --fake
then re-rundjango-admin migrate wagtailcore zero
.