soynatan / django-easy-audit

Yet another Django audit log app, hopefully the simplest one.
GNU General Public License v3.0
735 stars 182 forks source link

1.3.7b3 migration fails if only partially migrated #303

Closed PaarthShah closed 1 month ago

PaarthShah commented 2 months ago

Migration status:

easyaudit                                                                                                                                                                                                          
 [X] 0001_initial                                                                                                                                                                                                  
 [X] 0002_auto_20170125_0759                                                                                                                                                                                       
 [X] 0003_auto_20170228_1505                                                                                                                                                                                       
 [X] 0004_auto_20170620_1354                                                                                                                                                                                       
 [X] 0005_auto_20170713_1155                                                                                                                                                                                       
 [X] 0006_auto_20171018_1242
 [X] 0007_auto_20180105_0838
 [X] 0008_auto_20180220_1908
 [X] 0009_auto_20180314_2225
 [X] 0010_repr_text
 [X] 0011_auto_20181101_1339
 [X] 0012_auto_20181018_0012
 [X] 0013_auto_20190723_0126
 [X] 0014_auto_20200513_0008
 [X] 0015_auto_20201019_1217
 [X] 0016_alter_crudevent_event_type
 [X] 0017_alter_requestevent_datetime
 [ ] 0018_rename_crudevent_object_id_content_type_index
 [ ] 0019_alter_crudevent_changed_fields_and_more

Error observed:

Operations to perform:                                                                                                                                                                                             
  Apply all migrations: easyaudit                                              
Traceback (most recent call last):                                                                                                                                                                                 
  File "/var/www/manage.py", line 22, in <module>                                                                                                                                                                  
    execute_from_command_line(sys.argv)                                                                                                                                                                            
  File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line                                                                                        
    utility.execute()                                                                                                                                                                                              
  File "/usr/local/lib/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute                                                                                                          
    self.fetch_command(subcommand).run_from_argv(self.argv)                                                                                                                                                        
  File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 413, in run_from_argv                                                                                                        
    self.execute(*args, **cmd_options)                                                                                                                                                                             
  File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 459, in execute                                                                                                              
    output = self.handle(*args, **options)                                                                                                                                                                         
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                         
  File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 107, in wrapper                                                                                                              
    res = handle_func(*args, **kwargs)                                                                                                                                                                             
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                             
  File "/usr/local/lib/python3.11/site-packages/django/core/management/commands/migrate.py", line 303, in handle                                                                                                   
    pre_migrate_apps = pre_migrate_state.apps                                                                                                                                                                      
                       ^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                      
  File "/usr/local/lib/python3.11/site-packages/django/utils/functional.py", line 47, in __get__                                                                                                                   
    res = instance.__dict__[self.name] = self.func(instance)                                                                                                                                                       
                                         ^^^^^^^^^^^^^^^^^^^                                                                                                                                                       
  File "/usr/local/lib/python3.11/site-packages/django/db/migrations/state.py", line 565, in apps                                                                                                                  
    return StateApps(self.real_apps, self.models)                                                                                                                                                                  
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                  
  File "/usr/local/lib/python3.11/site-packages/django/db/migrations/state.py", line 626, in __init__                                                                                                              
    self.render_multiple([*models.values(), *self.real_models])                                                                                                                                                    
  File "/usr/local/lib/python3.11/site-packages/django/db/migrations/state.py", line 664, in render_multiple                                                                                                       
    model.render(self)                                                                                                                                                                                             
  File "/usr/local/lib/python3.11/site-packages/django/db/migrations/state.py", line 957, in render                                                                                                                
    return type(self.name, bases, body)                                                                                                                                                                            
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                            
  File "/usr/local/lib/python3.11/site-packages/django/db/models/base.py", line 143, in __new__                                                                                                                    
    new_class.add_to_class("_meta", Options(meta, app_label))                                                                                                                                                      
  File "/usr/local/lib/python3.11/site-packages/django/db/models/base.py", line 371, in add_to_class                                                                                                               
    value.contribute_to_class(cls, name)                                                                                                                                                                           
  File "/usr/local/lib/python3.11/site-packages/django/db/models/options.py", line 220, in contribute_to_class                                                                                                     
    raise TypeError(                                                                                                                                                                                               
TypeError: 'class Meta' got invalid attribute(s): index_together