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):
126
126
"schema.tests.SchemaTests.test_remove_unique_together_does_not_remove_meta_constraints" ,
127
127
"schema.tests.SchemaTests.test_unique_together" ,
128
128
# ManyToManyField
129
- "schema.tests.SchemaTests.test_m2m_create" ,
130
- "schema.tests.SchemaTests.test_m2m_create_custom" ,
131
- "schema.tests.SchemaTests.test_m2m_create_inherited" ,
132
129
"schema.tests.SchemaTests.test_m2m_rename_field_in_target_model" ,
133
130
"schema.tests.SchemaTests.test_m2m_repoint" ,
134
131
"schema.tests.SchemaTests.test_m2m_repoint_custom" ,
Original file line number Diff line number Diff line change 4
4
class DatabaseSchemaEditor (BaseDatabaseSchemaEditor ):
5
5
def create_model (self , model ):
6
6
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 )
7
11
8
12
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 )
9
17
self .connection .database [model ._meta .db_table ].drop ()
10
18
11
19
def add_field (self , model , field ):
You can’t perform that action at this time.
0 commit comments