Create table only if it doesn't exists

This commit is contained in:
Arik Fraimovich 2014-03-12 13:32:28 +02:00
parent ae3151d3a7
commit 2d995d0935

View File

@ -322,7 +322,7 @@ def create_db(create_tables, drop_tables):
db.database.execute_sql('DROP TABLE %s CASCADE' % model._meta.db_table)
#model.drop_table()
if create_tables:
if create_tables and not model.table_exists():
model.create_table()
db.close_db(None)