Migration error django-cms



  • Created a table of doctors which refers to the title model in django-cms. The migration on the server makes a mistake that is textually lower. A lot of google, nothing worked. I can remove all migrations from the migration folder and start makingmigrations and it will work, but the problem is that when the tables change, migration will not be applied. The question arises as to how I can correct this so that every time I do not remove migration and drop the OBD.

    Traceback (most recent call last):
      File "manage.py", line 22, in <module>
        main()
      File "manage.py", line 18, in main
        execute_from_command_line(sys.argv)
      File "/home/user/Рабочий стол/backend-clinic/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
        utility.execute()
      File "/home/user/Рабочий стол/backend-clinic/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 413, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "/home/user/Рабочий стол/backend-clinic/venv/lib/python3.8/site-packages/django/core/management/base.py", line 354, in run_from_argv
        self.execute(*args, **cmd_options)
      File "/home/user/Рабочий стол/backend-clinic/venv/lib/python3.8/site-packages/django/core/management/base.py", line 398, in execute
        output = self.handle(*args, **options)
      File "/home/user/Рабочий стол/backend-clinic/venv/lib/python3.8/site-packages/django/core/management/base.py", line 89, in wrapped
        res = handle_func(*args, **kwargs)
      File "/home/user/Рабочий стол/backend-clinic/venv/lib/python3.8/site-packages/django/core/management/commands/migrate.py", line 92, in handle
        executor = MigrationExecutor(connection, self.migration_progress_callback)
      File "/home/user/Рабочий стол/backend-clinic/venv/lib/python3.8/site-packages/django/db/migrations/executor.py", line 18, in __init__
        self.loader = MigrationLoader(self.connection)
      File "/home/user/Рабочий стол/backend-clinic/venv/lib/python3.8/site-packages/django/db/migrations/loader.py", line 53, in __init__
        self.build_graph()
      File "/home/user/Рабочий стол/backend-clinic/venv/lib/python3.8/site-packages/django/db/migrations/loader.py", line 259, in build_graph
        self.graph.validate_consistency()
      File "/home/user/Рабочий стол/backend-clinic/venv/lib/python3.8/site-packages/django/db/migrations/graph.py", line 195, in validate_consistency
        [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
      File "/home/user/Рабочий стол/backend-clinic/venv/lib/python3.8/site-packages/django/db/migrations/graph.py", line 195, in <listcomp>
        [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
      File "/home/user/Рабочий стол/backend-clinic/venv/lib/python3.8/site-packages/django/db/migrations/graph.py", line 58, in raise_error
        raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
    django.db.migrations.exceptions.NodeNotFoundError: Migration doctors.0001_initial dependencies reference nonexistent parent node ('cms', '0023_auto_20211110_1234')
    

    I've been dealing with this problem a little bit. Migration under No. 0023 is being created by the creation of the migrations of tables in which there is ForeignKey to a table of django-cms, which is yet to be resolved. I'm waiting for your help.

    -rw-rw-r-- 1 user user 10853 ноя 15 17:30 0001_initial.py
    -rw-rw-r-- 1 user user  8719 ноя 15 17:30 0002_auto_20140816_1918.py
    -rw-rw-r-- 1 user user   389 ноя 15 17:30 0003_auto_20140926_2347.py
    -rw-rw-r-- 1 user user  1355 ноя 15 17:30 0004_auto_20140924_1038.py
    -rw-rw-r-- 1 user user  4844 ноя 15 17:30 0005_auto_20140924_1039.py
    -rw-rw-r-- 1 user user  1853 ноя 15 17:30 0006_auto_20140924_1110.py
    -rw-rw-r-- 1 user user   378 ноя 15 17:30 0007_auto_20141028_1559.py
    -rw-rw-r-- 1 user user   394 ноя 15 17:30 0008_auto_20150121_0059.py
    -rw-rw-r-- 1 user user   419 ноя 15 17:30 0008_auto_20150208_2149.py
    -rw-rw-r-- 1 user user   224 ноя 15 17:30 0009_merge.py
    -rw-rw-r-- 1 user user  3223 ноя 15 17:30 0010_migrate_use_structure.py
    -rw-rw-r-- 1 user user   651 ноя 15 17:30 0011_auto_20150419_1006.py
    -rw-rw-r-- 1 user user   823 ноя 15 17:30 0012_auto_20150607_2207.py
    -rw-rw-r-- 1 user user   546 ноя 15 17:30 0013_urlconfrevision.py
    -rw-rw-r-- 1 user user  1363 ноя 15 17:30 0014_auto_20160404_1908.py
    -rw-rw-r-- 1 user user   391 ноя 15 17:30 0015_auto_20160421_0000.py
    -rw-rw-r-- 1 user user   773 ноя 15 17:30 0016_auto_20160608_1535.py
    -rw-rw-r-- 1 user user  1988 ноя 15 17:30 0017_pagetype.py
    -rw-rw-r-- 1 user user  3490 ноя 15 17:30 0018_create_pagenode.py
    -rw-rw-r-- 1 user user  3189 ноя 15 17:30 0019_set_pagenode.py
    -rw-rw-r-- 1 user user  2730 ноя 15 17:30 0020_old_tree_cleanup.py
    -rw-rw-r-- 1 user user   427 ноя 15 17:30 0021_auto_20180507_1432.py
    -rw-rw-r-- 1 user user   810 ноя 15 17:30 0022_auto_20180620_1551.py
    -rw-rw-r-- 1 user user  2384 ноя 15 17:37 0023_auto_20211115_1737.py
    -rw-rw-r-- 1 user user   395 ноя 15 17:30 __init__.py
    drwxrwxr-x 2 user user  4096 ноя 15 17:30 __pycache__
    
    -rw-r--r-- 1 root root 10853 Nov 15 17:36 0001_initial.py
    -rw-r--r-- 1 root root  8719 Nov 15 17:36 0002_auto_20140816_1918.py
    -rw-r--r-- 1 root root   389 Nov 15 17:36 0003_auto_20140926_2347.py
    -rw-r--r-- 1 root root  1355 Nov 15 17:36 0004_auto_20140924_1038.py
    -rw-r--r-- 1 root root  4844 Nov 15 17:36 0005_auto_20140924_1039.py
    -rw-r--r-- 1 root root  1853 Nov 15 17:36 0006_auto_20140924_1110.py
    -rw-r--r-- 1 root root   378 Nov 15 17:36 0007_auto_20141028_1559.py
    -rw-r--r-- 1 root root   394 Nov 15 17:36 0008_auto_20150121_0059.py
    -rw-r--r-- 1 root root   419 Nov 15 17:36 0008_auto_20150208_2149.py
    -rw-r--r-- 1 root root   224 Nov 15 17:36 0009_merge.py
    -rw-r--r-- 1 root root  3223 Nov 15 17:36 0010_migrate_use_structure.py
    -rw-r--r-- 1 root root   651 Nov 15 17:36 0011_auto_20150419_1006.py
    -rw-r--r-- 1 root root   823 Nov 15 17:36 0012_auto_20150607_2207.py
    -rw-r--r-- 1 root root   546 Nov 15 17:36 0013_urlconfrevision.py
    -rw-r--r-- 1 root root  1363 Nov 15 17:36 0014_auto_20160404_1908.py
    -rw-r--r-- 1 root root   391 Nov 15 17:36 0015_auto_20160421_0000.py
    -rw-r--r-- 1 root root   773 Nov 15 17:36 0016_auto_20160608_1535.py
    -rw-r--r-- 1 root root  1988 Nov 15 17:36 0017_pagetype.py
    -rw-r--r-- 1 root root  3490 Nov 15 17:36 0018_create_pagenode.py
    -rw-r--r-- 1 root root  3189 Nov 15 17:36 0019_set_pagenode.py
    -rw-r--r-- 1 root root  2730 Nov 15 17:36 0020_old_tree_cleanup.py
    -rw-r--r-- 1 root root   427 Nov 15 17:36 0021_auto_20180507_1432.py
    -rw-r--r-- 1 root root   810 Nov 15 17:36 0022_auto_20180620_1551.py
    -rw-r--r-- 1 root root  2384 Nov 10 12:34 0023_auto_20211110_1234.py
    -rw-r--r-- 1 root root   395 Nov 15 17:36 __init__.py
    drwxr-xr-x 2 root root  4096 Nov 15 17:36 __pycache__
    


    1. I've solved the problem, but it's but it's working without mistakes. I changed the name of the file on the local car to name from the server, that is. 0023_auto_20211115_1737.py changed. 0023_auto_20211110_1234.py♪ Also in the BDE on a local vehicle in table django_migrations changed the name=0023_auto_20211115_1737.py, on name=0023_auto_20211115_1737.py.

    2. I also used another solution to the problem, which was not very comfortable, and I just took out the files in the commity files that broke all the migrations.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2