Closed Jenselme closed 9 years ago
For /CatalogServer to work properly, the CREATE EXTENSION unaccent;
command must also be run. The script should do it.
I am not sure if creating the database from this script is such a good idea. The user carto_dev must have the rights to do so and I don't see how to correctly detect if the database exits. I think we must consider that the database is already created before launching this script. Maybe update install.sh
and create it from there.
The script can now create the schema if it doesn't exits and the remove_accents function.
Database is created by install.sh
.
A database named
bod_${vars:db_staging}
with a schema namedre3
must exist for the script to complete. It should be able to create them.The schema can be created with:
engine.execute(CreateSchema('re3'))
. The name of the database can be fetched bydb_name = settings['sqlalchemy.bod.url'].split('/')[-1]
Still have to find how to create the database. I tested:
engine.execute('CREATE DATABASE {}'.format(db_name))
conn = engine.connexion(); conn.execute('CREATE DATABASE {}'.format(db_name))