c# - How can I manage my SQLite DB versions in Monotouch? -


if release app, , in 2 weeks release new update, , need change database, whats solution?. example in android i´ve sqlite library override void check database version. thanks.

there's lots of ways of doing this, here's system i've used in similar situations.

keep schema (and non-transactional data) baseline, , keep version number in database. then, whenever update program, change schema , save change sql in own file. name files number files sequentially e.g. (000001addtablex.sql, 000002removecolumnx.sql, etc). write chunk of code checks folder changesets saved. then, if changeset number in filename greater current version stored in db, run changeset against database.

this has following benefits

  • if you're using source control, schema changesets saved , associated (presumably) related changes in code when check in code.
  • your change set code well-tested because it'll exact code used during development.
  • no matter how many updates end user has skipped, they'll changesets in right order when upgrade.

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -