nostros icon indicating copy to clipboard operation
nostros copied to clipboard

Design DB migrations and versioning

Open KoalaSat opened this issue 2 years ago • 3 comments

Right now we just launch all migrations when the APP starts to make sure the DB is up to date https://github.com/KoalaSat/nostros/blob/4d5b93dd2462f7d1ba6f9d68ff259d52f1ae6389/android/app/src/main/java/com/nostros/modules/DatabaseModule.java#L26

This clearly does not scale, and we need to prepare specific services for this which should check the DB version and apply the missing migrations. Also would be good to defined a good (file?) structure so each migration can be clearly spotted.

KoalaSat avatar Jan 23 '23 18:01 KoalaSat

Is there any opposition to using Room for some built in migration table logic?

jeffchang5 avatar Jan 24 '23 17:01 jeffchang5

I'm not familiar with it @jeffchang5 , but the only limitation is to allow the business logic to continue communicating with the shared SQlite DB

KoalaSat avatar Jan 24 '23 18:01 KoalaSat

app.py

from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate

app = Flask(name) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///example.db' db = SQLAlchemy(app) migrate = Migrate(app, db)

your app code goes here

???

JuLiO-UtXo avatar Feb 21 '23 02:02 JuLiO-UtXo