Skip to content

Commit 7dd0fdd

Browse files
committed
implement SchemaEditor.create/delete_model()
1 parent 33c4648 commit 7dd0fdd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/workflows/test-python.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ jobs:
110110
ordering
111111
or_lookups
112112
queries
113+
schema.tests.SchemaTests.test_creation_deletion
113114
select_related
114115
select_related_onetoone
115116
select_related_regress

django_mongodb/schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
55
def create_model(self, model):
6-
pass
6+
self.connection.database.create_collection(model._meta.db_table)
77

88
def delete_model(self, model):
9-
pass
9+
self.connection.database[model._meta.db_table].drop()
1010

1111
def add_field(self, model, field):
1212
pass

0 commit comments

Comments
 (0)