2015-01-13 04:20:40 +08:00
|
|
|
from django.db.backends.base.creation import BaseDatabaseCreation
|
2008-08-11 20:11:25 +08:00
|
|
|
|
2011-04-02 16:39:08 +08:00
|
|
|
|
2008-08-11 20:11:25 +08:00
|
|
|
class DatabaseCreation(BaseDatabaseCreation):
|
2012-09-08 03:40:59 +08:00
|
|
|
|
2008-08-11 20:11:25 +08:00
|
|
|
def sql_table_creation_suffix(self):
|
2014-01-20 08:45:29 +08:00
|
|
|
test_settings = self.connection.settings_dict['TEST']
|
2014-09-04 20:15:09 +08:00
|
|
|
assert test_settings['COLLATION'] is None, (
|
|
|
|
"PostgreSQL does not support collation setting at database creation time."
|
|
|
|
)
|
2014-01-20 08:45:29 +08:00
|
|
|
if test_settings['CHARSET']:
|
|
|
|
return "WITH ENCODING '%s'" % test_settings['CHARSET']
|
2008-08-11 20:11:25 +08:00
|
|
|
return ''
|