File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -126,9 +126,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
126126 "schema.tests.SchemaTests.test_remove_unique_together_does_not_remove_meta_constraints" ,
127127 "schema.tests.SchemaTests.test_unique_together" ,
128128 # ManyToManyField
129- "schema.tests.SchemaTests.test_m2m_create" ,
130- "schema.tests.SchemaTests.test_m2m_create_custom" ,
131- "schema.tests.SchemaTests.test_m2m_create_inherited" ,
132129 "schema.tests.SchemaTests.test_m2m_rename_field_in_target_model" ,
133130 "schema.tests.SchemaTests.test_m2m_repoint" ,
134131 "schema.tests.SchemaTests.test_m2m_repoint_custom" ,
Original file line number Diff line number Diff line change 44class DatabaseSchemaEditor (BaseDatabaseSchemaEditor ):
55 def create_model (self , model ):
66 self .connection .database .create_collection (model ._meta .db_table )
7+ # Make implicit M2M tables.
8+ for field in model ._meta .local_many_to_many :
9+ if field .remote_field .through ._meta .auto_created :
10+ self .create_model (field .remote_field .through )
711
812 def delete_model (self , model ):
13+ # Delete implicit M2m tables.
14+ for field in model ._meta .local_many_to_many :
15+ if field .remote_field .through ._meta .auto_created :
16+ self .delete_model (field .remote_field .through )
917 self .connection .database [model ._meta .db_table ].drop ()
1018
1119 def add_field (self , model , field ):
You can’t perform that action at this time.
0 commit comments