> > So I had a migration which can be found below, so when I was applying the > migration I get this error You can't delete all columns with ALTER TABLE; > use DROP TABLE instead That makes sense because I have only a single > column. When I use the code sample 2 it works nicely. Can anyone explain > the motivation behind removing fields first and then deleting a model,One > case I think of is seeing if the deletion of a field is valid(In case of > foreign keys and models.PROTECT), wouldn't sql throw an error anyway. So if > this is indeed a bug/Improvement I will be glad to help, if it isn't I > would be happy with anyone explaining why this would/should be the way to > delete models.
Code Sample 1 class Migration(migrations.Migration): dependencies = [ ('login', '0003_session'), ] operations = [ migrations.RemoveField( model_name='session', name='session_ptr', ), migrations.DeleteModel( name='Session', ), ] Code Sample 2 class Migration(migrations.Migration): dependencies = [ ('login', '0003_session'), ] operations = [ migrations.DeleteModel( name='Session', ), ] -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/00bb8f64-0174-4e01-b19f-5c91fad6b8d0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.