mirror of
https://github.com/django/django.git
synced 2025-10-30 00:56:09 +00:00
Add a SQlite backend. One test passes!
This commit is contained in:
@@ -44,18 +44,18 @@ class SchemaTests(TestCase):
|
||||
# Remove any M2M tables first
|
||||
for field in model._meta.local_many_to_many:
|
||||
try:
|
||||
cursor.execute("DROP TABLE %s CASCADE" % (
|
||||
connection.ops.quote_name(field.rel.through._meta.db_table),
|
||||
))
|
||||
cursor.execute(connection.schema_editor().sql_delete_table % {
|
||||
"table": connection.ops.quote_name(field.rel.through._meta.db_table),
|
||||
})
|
||||
except DatabaseError:
|
||||
connection.rollback()
|
||||
else:
|
||||
connection.commit()
|
||||
# Then remove the main tables
|
||||
try:
|
||||
cursor.execute("DROP TABLE %s CASCADE" % (
|
||||
connection.ops.quote_name(model._meta.db_table),
|
||||
))
|
||||
cursor.execute(connection.schema_editor().sql_delete_table % {
|
||||
"table": connection.ops.quote_name(model._meta.db_table),
|
||||
})
|
||||
except DatabaseError:
|
||||
connection.rollback()
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user