qiscus / qiscus-sdk-android

Qiscus provide everything you need to power up your app with chats. And it's now made simple.
https://www.qiscus.com
Apache License 2.0
201 stars 84 forks source link

Feature/migration #48

Closed andhikayuana closed 6 years ago

andhikayuana commented 6 years ago

Better local data migration :

  1. write sql script with naming like qiscus.db_from_oldVersion_to_newVersion.sql exmaple : qiscus.db_from_14_to_15.sql
  2. write your sql script inside that file :

    example :

ALTER TABLE comments ADD COLUMN TESTING TEXT;
UPDATE comments SET TESTING = sender_email;
  1. place above file inside assets directory

  2. increase DB version com.qiscus.sdk.data.local.QiscusDb.DATABASE_VERSION

Voila :smile:

Test migration

  1. SQL Script for migration
  2. Increase DB Version
andhikayuana commented 6 years ago

bang @zetbaitsu ini udah ada examplenya juga, eh ini examplenya tak ganti ke bikik index ke field aja sekalian :smile: