appifyhub / monolith

The backbone backend service of Appify Hub
https://appifyhub.com
MIT License
1 stars 0 forks source link

Improve schema migration storage #180

Open milosmns opened 6 months ago

milosmns commented 6 months ago

Provide a brief summary of the planned work

Migrations of database schemas are individually stored in the database; we can optimize that to store only the last migrated schema version.

Detailed overview

Each schema is a row in the schemas database, and more rows are added when schemas are added. Ultimately, we will always run all migrations (until the latest schema is set), but all schemas will have a row set. Of course, this is a minor issue for the database, but it's an unnecessary process and complex schema management that only needs to exist today.

We can simplify it by only storing the latest version of the schema while running all previous migrations in a sequence before the last number is reached.

Hint/location:

com.appifyhub.monolith.features.init.storage.SchemaDao
com.appifyhub.monolith.features.init.repository.SchemaRepository
com.appifyhub.monolith.features.init.domain.SchemaInitializer

List the acceptance criteria

Include any additional notes (optional)

No response

milosmns commented 6 months ago

Related issues: