Open
Description
What do you think about a new option --lazy-db
, which would behave like --reuse-db
, but falls back to --create-db
when there's a DB error during the first test.
Would that be possible / feasible?
Could this be done by default, without a new option?
For example:
def execute(self, sql, params=None):
self.db.validate_no_broken_transaction()
self.db.set_dirty()
with self.db.wrap_database_errors:
if params is None:
return self.cursor.execute(sql)
else:
> return self.cursor.execute(sql, params)
E ProgrammingError: relation "languages_plus_language" does not exist
E LINE 1: ...."family", "languages_plus_language"."notes" FROM "languages...
E ^
…/django-1.7.x/django/db/backends/utils.py:65: ProgrammingError