jaguar_orm
jaguar_orm copied to clipboard
Implement migrations
Implement migrations
Started an experimental implementation here: https://github.com/Jaguar-dart/jaguar_orm/commit/29f27d971eae111497c21fceceef26fb30b2abc1
The plan is to create a snapshot (an xml file) for each changes. Store these snapshot files.
Diff the snapshot files to migrate up or down.
Blocked by https://github.com/Jaguar-dart/jaguar_orm/issues/19
Hey, what do think about create a __migrations__
table on schema to manage the migrations executed instead xml files?
This approach is used in many frameworks, if u agree I think that I can help on it!
That definitely sounds nice!
@hjjunior Are you still planning to work on this issue?
I was :/ but I faced a problem that go against the way is used generator on project
Can you please explain more?
oc! well, I was planing to create a migration when the flutter pub run build_runner build
, but I'll need to check if changed and/or what changed on database schema, and late it, if required create a new file/a new migration version with the diffs
I'd like to follow something like the room migrations but a little more automatic
@hjJunior Do you made any progress? Or are you still working on this?
Sorry guys, when I was planning to start, I just figure out another one, that already do this, take a look on Floor
The Floor approach looks nice, but it is still SQFlite specific. A migration implementation directly in the jarguar orm package would provide a possibility to handle DB migrations independently of the used database.
Is there any update about this ? Any example of a simple implementation ? Thank you for your hard work