Postgres
Migrations using ActiveRecord happen in the omalab/oma repo which is a Rails app. In that repository all standard Rails documentation related to migrations applies.
To generate a migration, do:bundle exec rails g migration migration_name
This generates a migration, as normal. Run it here (remember to run it for test as well).
The and result of migrations is a changed db/schema.rb file. Once you're happy with the changes that happened to the DB you need to copy the file to oma-models/db/schema.rb and oma-processors/db/schema.rb.
When the code you're working on is ready for Pull requests, you need to make sure that there are Pull Requests open in all three repositories so database schema changes are reflected in all off them.
Three pull requests:
oma
PR should contain the migrations, the changed db/schema.rb and a reference in the Gemfile to the right oma-models.
oma-models
PR should contain the same schema as the the oma PR and changes to the actual model classes that come with the changed schema.
oma-processors
PR should contain the same schema as the the oma PR and and a reference in the Gemfile to the right oma-models.
Reference to oma-models:
Last updated