Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unapplying Migrations Fails #185

Open
n4ff4h opened this issue Nov 6, 2023 · 1 comment
Open

Unapplying Migrations Fails #185

n4ff4h opened this issue Nov 6, 2023 · 1 comment

Comments

@n4ff4h
Copy link

n4ff4h commented Nov 6, 2023

When trying to uninstall this library, I did a python manage.py migrate django_apscheduler zero and the following errors throws up:

Operations to perform:
  Unapply all migrations: django_apscheduler
Running migrations:
  Rendering model states... DONE
  Unapplying django_apscheduler.0009_djangojobexecution_unique_job_executions... OK
  Unapplying django_apscheduler.0008_remove_djangojobexecution_started... OK
  Unapplying django_apscheduler.0007_auto_20200717_1404... OK
  Unapplying django_apscheduler.0006_remove_djangojob_name... OK
  Unapplying django_apscheduler.0005_migrate_name_to_id...Traceback (most recent call last):
  File "/Users/naffah/Code/PythonProjects/erp_integrator/manage.py", line 22, in <module>
    main()
  File "/Users/naffah/Code/PythonProjects/erp_integrator/manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/Users/naffah/Library/Caches/pypoetry/virtualenvs/erp-integrator-NtQaQ5xa-py3.11/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/Users/naffah/Library/Caches/pypoetry/virtualenvs/erp-integrator-NtQaQ5xa-py3.11/lib/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/naffah/Library/Caches/pypoetry/virtualenvs/erp-integrator-NtQaQ5xa-py3.11/lib/python3.11/site-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/naffah/Library/Caches/pypoetry/virtualenvs/erp-integrator-NtQaQ5xa-py3.11/lib/python3.11/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/naffah/Library/Caches/pypoetry/virtualenvs/erp-integrator-NtQaQ5xa-py3.11/lib/python3.11/site-packages/django/core/management/base.py", line 106, in wrapper
    res = handle_func(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/naffah/Library/Caches/pypoetry/virtualenvs/erp-integrator-NtQaQ5xa-py3.11/lib/python3.11/site-packages/django/core/management/commands/migrate.py", line 356, in handle
    post_migrate_state = executor.migrate(
                         ^^^^^^^^^^^^^^^^^
  File "/Users/naffah/Library/Caches/pypoetry/virtualenvs/erp-integrator-NtQaQ5xa-py3.11/lib/python3.11/site-packages/django/db/migrations/executor.py", line 141, in migrate
    state = self._migrate_all_backwards(plan, full_plan, fake=fake)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/naffah/Library/Caches/pypoetry/virtualenvs/erp-integrator-NtQaQ5xa-py3.11/lib/python3.11/site-packages/django/db/migrations/executor.py", line 219, in _migrate_all_backwards
    self.unapply_migration(states[migration], migration, fake=fake)
  File "/Users/naffah/Library/Caches/pypoetry/virtualenvs/erp-integrator-NtQaQ5xa-py3.11/lib/python3.11/site-packages/django/db/migrations/executor.py", line 279, in unapply_migration
    state = migration.unapply(state, schema_editor)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/naffah/Library/Caches/pypoetry/virtualenvs/erp-integrator-NtQaQ5xa-py3.11/lib/python3.11/site-packages/django/db/migrations/migration.py", line 159, in unapply
    raise IrreversibleError(
django.db.migrations.exceptions.IrreversibleError: Operation <RunPython <function migrate_name_to_id at 0x136aacf40>> in django_apscheduler.0005_migrate_name_to_id is not reversible

Any ideas on how to fix this?

@n4ff4h n4ff4h changed the title Trying to Unapply Migrations Fails Unapplying Migrations Fails Nov 6, 2023
@eduardopdev
Copy link
Collaborator

Hello, are you still dealing with this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants