You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading to 5.0.0 in our application long-using taggit, an error in the migration occurs. Any ideas to rectify?
Applying taggit.0006_rename_taggeditem_content_type_object_id_taggit_tagg_content_8fc721_idx...Traceback (most recent call last):
File "manage.py", line 13, in <module>
execute_from_command_line(sys.argv)
File "/app/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
utility.execute()
File "/app/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/app/venv/lib/python3.8/site-packages/django/core/management/base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "/app/venv/lib/python3.8/site-packages/django/core/management/base.py", line 448, in execute
output = self.handle(*args, **options)
File "/app/src/core/management/commands/resetdb.py", line 35, in handle
create_database(options)
File "/app/src/core/management/commands/resetdb.py", line 157, in create_database
call_command("migrateall", interactive=False, verbosity=options["verbosity"])
File "/app/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 198, in call_command
return command.execute(*args, **defaults)
File "/app/venv/lib/python3.8/site-packages/django/core/management/base.py", line 448, in execute
output = self.handle(*args, **options)
File "/app/src/legacybridge/management/commands/migrateall.py", line 16, in handle
call_command("migrate", **options)
File "/app/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 198, in call_command
return command.execute(*args, **defaults)
File "/app/venv/lib/python3.8/site-packages/django/core/management/base.py", line 448, in execute
output = self.handle(*args, **options)
File "/app/venv/lib/python3.8/site-packages/django/core/management/base.py", line 96, in wrapped
res = handle_func(*args, **kwargs)
File "/app/venv/lib/python3.8/site-packages/django/core/management/commands/migrate.py", line 349, in handle
post_migrate_state = executor.migrate(
File "/app/venv/lib/python3.8/site-packages/django/db/migrations/executor.py", line 135, in migrate
state = self._migrate_all_forwards(
File "/app/venv/lib/python3.8/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
state = self.apply_migration(
File "/app/venv/lib/python3.8/site-packages/django/db/migrations/executor.py", line 252, in apply_migration
state = migration.apply(state, schema_editor)
File "/app/venv/lib/python3.8/site-packages/django/db/migrations/migration.py", line 130, in apply
operation.database_forwards(
File "/app/venv/lib/python3.8/site-packages/django/db/migrations/operations/models.py", line 947, in database_forwards
raise ValueError(
ValueError: Found wrong number (0) of indexes for taggit_taggeditem(content_type_id, object_id).
The text was updated successfully, but these errors were encountered:
blissdev
changed the title
New 5.0.0 migrations fails
New 5.0.0 migrations fails: Found wrong number (0) of indexes
Nov 29, 2023
@blissdev I had the same issue with very old taggit installation (seems meanwhile some mess with migrations must have happened in the project). Anyway, try to connect directly to mysql using eg.
$ mysql -h yourhost -u youruser -p yourdbname
then display indexes:
$ SHOW INDEXES FROM taggit_taggeditem;
if index for content_type_id and object_id doesn't exist then execute:
$ create index taggit_tagg_content_8fc721_idx on taggit_taggeditem (content_type_id, object_id);
After upgrading to 5.0.0 in our application long-using taggit, an error in the migration occurs. Any ideas to rectify?
The text was updated successfully, but these errors were encountered: