cds icon indicating copy to clipboard operation
cds copied to clipboard

refact(migrate): create a unique service to migrate data and structure

Open richardlt opened this issue 4 years ago • 0 comments

Today database structure migration and data migration are achieved by two different services, database_migrate and api (at startup).

We want to create a unique service to handle both migration process.

This should not based on CDS version because we don't want to mix release management contraints with migrations scripts. However we want to be able to remove code migration.

Solution:

  • Code migration should be moved to database migrate service.
  • A code migration should refer a sql script.
  • A code migration can be optional (no run auto but manually when api already started).
  • Code migration are not useful on fresh install.
  • Code migration should implement an interface and be referenced forever in database migrate service even if the code is removed.
  • Both sql and code migration should be referenced in database when executed.
  • At startup database migrate should plan exec all migration that are not referenced in database, if code is missing for a code migration it should abort and give an info.

richardlt avatar Dec 19 '19 16:12 richardlt