#Is there any documentation on how to manage the down migrations of the SQL plugin?

7 messages · Page 1 of 1 (latest)

cursive sand
#

I'm not rust and sqlx expert but i cannot understand how to handle a down migration inside a Tauri app. If anyone can point on some docs or articles, it should be very useful. Thanks in advance

frail geode
cursive sand
#

Tell me if I'm understanding well, do you suggest using a migration with MigrationKind::Up even if it's a down migration?

frail geode
#

normally on production db if we have to reverse some action, we do add new migrations. in a case where we might have not applied last migrations then applying them to reverse can be avoided by checking while applying very rare occasions as it complicate everything but large db and heavy data moving can be avoided. but I don't think in tauri you can do it directly. 99% cases migrations are used as timeline of truth to record every change and is applied in order on db.

frail geode
#

if you are not building very complex app, just create new migration that reverse old one. I was working with one group where they have to keep 500+ migrations, so team decide to do major update and reset db migrations but added complex multiple import logic, once everyone was onbaord on new version they removed all import logic. this all happened without user interactions or actions.

cursive sand
#

I use down when writing the migration so I can roll back and correct a mistake locally before committing the migration. I thought that it could be very useful when you are developing but I understand your point of view. Thanks for your time