ioda-net / geo-api3

Backend from geoadmin/mf-chsdi3
Other
2 stars 0 forks source link

Create database in initializedb.py #4

Closed Jenselme closed 9 years ago

Jenselme commented 9 years ago

A database named bod_${vars:db_staging} with a schema named re3 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 by db_name = settings['sqlalchemy.bod.url'].split('/')[-1]

Still have to find how to create the database. I tested:

Jenselme commented 9 years ago

For /CatalogServer to work properly, the CREATE EXTENSION unaccent; command must also be run. The script should do it.

Jenselme commented 9 years ago

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.

Jenselme commented 9 years ago

Database is created by install.sh.