app: the real application. this depends on the generated_code sub project.
migrations: the migrations and code generators are defined here. this is also where most commands are run. this project depends on the generated_code sub project.
migration_manager: where user customize their migration manager. this project does not depend on any other sub projects, thus can be used to run "rescue" commands when, for example, generated_code is broken.
generated_code: where generated code are stored. users are never supposed to edit this project manually.
There are currently two sets of commands: one starts with mg, like mg preview, mg apply; the other starts with mgm, like mgm rescue, which will delete all generated code. NOTICE: the commands are not yet well separated into mg and mgm, so any suggestions on how to separate the commands are welcome.
I didn't use an sbt plugin because sbt will load a user's customized migration manager on starting, thus a reload is required every time the manager has been changed. I imagine there will be a "migration_manager" sub project in every user's project by default, even when users don't have the desire to customize it.
There are now four sub projects:
There are currently two sets of commands: one starts with
mg
, likemg preview
,mg apply
; the other starts withmgm
, likemgm rescue
, which will delete all generated code. NOTICE: the commands are not yet well separated intomg
andmgm
, so any suggestions on how to separate the commands are welcome.I didn't use an sbt plugin because sbt will load a user's customized migration manager on starting, thus a reload is required every time the manager has been changed. I imagine there will be a "migration_manager" sub project in every user's project by default, even when users don't have the desire to customize it.