jaguar_orm icon indicating copy to clipboard operation
jaguar_orm copied to clipboard

Implement migrations

Open tejainece opened this issue 6 years ago • 13 comments

Implement migrations

tejainece avatar Jul 26 '17 22:07 tejainece

Started an experimental implementation here: https://github.com/Jaguar-dart/jaguar_orm/commit/29f27d971eae111497c21fceceef26fb30b2abc1

tejainece avatar Jul 24 '18 08:07 tejainece

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.

tejainece avatar Jul 24 '18 08:07 tejainece

Blocked by https://github.com/Jaguar-dart/jaguar_orm/issues/19

tejainece avatar Jul 24 '18 08:07 tejainece

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!

hjJunior avatar Apr 06 '19 00:04 hjJunior

That definitely sounds nice!

tejainece avatar Apr 06 '19 08:04 tejainece

@hjjunior Are you still planning to work on this issue?

tejainece avatar Jul 02 '19 06:07 tejainece

I was :/ but I faced a problem that go against the way is used generator on project

hjJunior avatar Jul 02 '19 23:07 hjJunior

Can you please explain more?

tejainece avatar Jul 03 '19 07:07 tejainece

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 avatar Jul 03 '19 22:07 hjJunior

@hjJunior Do you made any progress? Or are you still working on this?

flycash avatar Sep 26 '19 11:09 flycash

Sorry guys, when I was planning to start, I just figure out another one, that already do this, take a look on Floor

hjJunior avatar Sep 26 '19 12:09 hjJunior

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.

devjeff avatar Feb 27 '20 10:02 devjeff

Is there any update about this ? Any example of a simple implementation ? Thank you for your hard work

SebastienSCochet avatar May 26 '21 23:05 SebastienSCochet