aegif / CmisSync

Synchronize content between a CMIS repository and your desktop. Like Dropbox for Enterprise Content Management!
http://CmisSync.com
163 stars 123 forks source link

Local database versioning #327

Open nicolas-raoul opened 10 years ago

nicolas-raoul commented 10 years ago

The format of the .cmissync SQLite database sometimes changes.

Have a key-value in table "general" to identify database format version.

ymolinet commented 10 years ago

sqlite implement PRAGMA user_version to do this.

nicolas-raoul commented 10 years ago

Thanks for the tip Yannick! Can we merge your commit 83107add7795 ? @MoritakaSoma has been working on something similar: https://github.com/MoritakaSoma/CmisSync/commits/db_migration @MoritakaSoma could you please merge the work from Yannick too? Thanks!

ymolinet commented 10 years ago

Yes you can merge. It's working, I've migrated my own database with this code. If you change the SQL Schema, you must :

  1. Change the value of SCHEMA_VERSION
  2. Write the migration code in the switch case ...

Perhaps this code could be moved in Migration.cs if we passed some variable as the sqliteconnection object that refer the database.