yathit / ydn-db

Javascript database module for Indexeddb, Web SQL and localStorage storage mechanisms supporting version migration, advanced query, SQL and transaction.
Apache License 2.0
503 stars 41 forks source link

Modify schema in WebSQL: Data is lost #44

Closed dpalou closed 9 years ago

dpalou commented 9 years ago

Hi,

I noticed that if I modify the schema of a certain store in WebSQL, all the data in that store is lost. In IndexedDB it works fine, the data is kept.

I created a simple jsfiddle to show it:

https://jsfiddle.net/otb1wbet/

If you look at the console you'll see that once the database is created with another schema I cannot retrieve the entries anymore.

If this data should be migrated manually by the developer, can you please give me some hints on how to do it?

Thank you

yathit commented 9 years ago

Hi,

WebSQL does not support ALTER TABLE.

For all my use case (and you should be), truth data is in server and can be restored at any time.