Migration core.0016_remove_db_colum_for_K_and_K_error is not reversible
This prevent from unapplying this migration and thus the whole 1~16 migrations:
$ python manage.py migrate core zero --configuration=Local
Operations to perform:
Unapply all migrations: core
Running migrations:
Rendering model states... DONE
Unapplying core.0020_alter_planet_detection_type... OK
Unapplying core.0019_alter_planet_detection_type... OK
Unapplying core.0018_add_epn_view... OK
Unapplying core.0017_remove_system_to_planet2star_model... OK
Unapplying core.0016_remove_db_colum_for_K_and_K_error...Traceback (most recent call last):
File "/home/pmartin/Projets/exoplanet.eu/manage.py", line 22, in <module>
main()
File "/home/pmartin/Projets/exoplanet.eu/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/home/pmartin/Projets/exoplanet.eu/.venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
utility.execute()
File "/home/pmartin/Projets/exoplanet.eu/.venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/pmartin/Projets/exoplanet.eu/.venv/lib/python3.10/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/pmartin/Projets/exoplanet.eu/.venv/lib/python3.10/site-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
File "/home/pmartin/Projets/exoplanet.eu/.venv/lib/python3.10/site-packages/django/core/management/base.py", line 89, in wrapped
res = handle_func(*args, **kwargs)
File "/home/pmartin/Projets/exoplanet.eu/.venv/lib/python3.10/site-packages/django/core/management/commands/migrate.py", line 244, in handle
post_migrate_state = executor.migrate(
File "/home/pmartin/Projets/exoplanet.eu/.venv/lib/python3.10/site-packages/django/db/migrations/executor.py", line 121, in migrate
state = self._migrate_all_backwards(plan, full_plan, fake=fake)
File "/home/pmartin/Projets/exoplanet.eu/.venv/lib/python3.10/site-packages/django/db/migrations/executor.py", line 196, in _migrate_all_backwards
self.unapply_migration(states[migration], migration, fake=fake)
File "/home/pmartin/Projets/exoplanet.eu/.venv/lib/python3.10/site-packages/django/db/migrations/executor.py", line 252, in unapply_migration
state = migration.unapply(state, schema_editor)
File "/home/pmartin/Projets/exoplanet.eu/.venv/lib/python3.10/site-packages/django/db/migrations/migration.py", line 149, in unapply
raise IrreversibleError("Operation %s in %s is not reversible" % (operation, self))
django.db.migrations.exceptions.IrreversibleError: Operation <RunSQL 'ALTER TABLE core_planetdbview RENAME COLUMN "K" to "k"'> in core.0016_remove_db_colum_for_K_and_K_error is not reversible
This leaves the DB in a bad state:
$ python manage.py showmigrations core --configuration=Local
core
[X] 0001_initial
[X] 0002_auto_20200406_1949
[X] 0003_planet2star_correct_foreign_key_name
[X] 0004_star2publication_correct_foreign_key_name
[X] 0005_planet2publication_correct_foreign_key_name
[X] 0006_add_planetdbview
[X] 0007_corrections_to_relations_to_publications
[X] 0008_small_fix_for_discovered_and_main_star_on_planet
[X] 0009_new_year_2021_planet_discovered_choices_update
[X] 0010_new_year_2022_planet_discovered_choices_update
[X] 0011_remove_future_django_4_deprecated_types
[X] 0012_fix_planets_to_planetary_system_relation
[X] 0013_alter_planet_discovered
[X] 0014_add_import_table_for_exoimport
[X] 0015_add_import_id_foreign_key
[X] 0016_remove_db_colum_for_K_and_K_error
[ ] 0017_remove_system_to_planet2star_model
[ ] 0018_add_epn_view
[ ] 0019_alter_planet_detection_type
[ ] 0020_alter_planet_detection_type