mountetna / magma

Data server with friendly data loaders
GNU General Public License v2.0
5 stars 2 forks source link

create_db command #96

Closed graft closed 5 years ago

graft commented 5 years ago

This adds a 'create_db' command, which is a utility to attach a project to a magma instance.

There are several elements to setting up a complete project: 1) Correct database configuration 2) Project models and migrations 3) Data

This command provides (1). Given a config.yml containing a database name, user, and password which specify a valid postgres role, the create_db command will ensure that the database exists and the schema for the specified project exists. Subsequently you can create or run migrations using an existing set of models.

If you previously created a database through postgres, you might have to change the owner of that database to the role in your config.yml in order to use this command, otherwise schema creation will not work.