mountetna / magma

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

Project creation #112

Open graft opened 4 years ago

graft commented 4 years ago

New projects are licensed by Janus; once a user has credentials authorizing them to a new project, they should in theory be able to put data into any Etna application using those credentials for that project.

However, in practice creating a new project in Magma requires a rather laborious process that must be done by hand:

1) A new project repo must be created with data models and migrations 2) The project repo must be deployed to magma production 3) A new database schema should be setup for the project in the magma db ('schema' being a postgres partition of the db here, see https://www.postgresql.org/docs/current/ddl-schemas.html) 3) A 'magma' bucket must be created on metis to hold files for this project.

These steps should happen seamlessly, allowing new projects to be booted up in Magma without much trouble.

On Metis the overhead for creating a new project is low (mkdir-ing a few directories suffices, and after mountetna/metis#53 shouldn't require any changes); on Magma we might require an explicit /create_project/:project_name action to prevent having to ensure a project every time a user tries to access one in whatever form.

The basics, following #104 (using 'labors' example): 1) Add a new schema labors to the database 2) Add a new table labors.models and a new table labors.attributes 3) Add a new entry { name: 'project' } to labors.models and { attribute_name: 'project_name', type: 'string' } to labors.attributes 4) Add a new table labors.projects with columns id, project_name.