def create_database(self): # Create a postgresql database. postgresql_database_ensure( self.database_name, owner=self.database_user, encoding='UTF8', template='template0', locale='en_US.UTF-8' )
def setup_databases(): # create production postgres database and test database # needs to match local_settings.py deployment values postgresql_role_ensure(env.deploy_user, env.password, superuser=True, createdb=True, createrole=True, inherit=True, login=True) postgresql_database_ensure('urbanfootprint', owner=env.deploy_user, template='template_postgis')
def create_database(self): # Create a postgresql database. postgresql_database_ensure( self.database_name, owner=self.database_user, encoding='UTF8', template='template0', locale='en_US.UTF-8' ) if self.deploy_postgis: self.setup_postgis_for_database()
def ensure_database(db_name, owner): # owner should == what you used in ensure_role postgresql_database_ensure(db_name, owner=owner, encoding="UTF8")