Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var db = openDatabase("example_db", "", "Example Database", 100000);
- // openDatabase(db name, required version (blank string for n/a), human-readable database name, expected size in bytes)
- db.changeVersion("", "1", function(t){
- t.executeSql("create table ...");
- });
- /* Note:
- openDatabase actually takes one more (optional) argument -- a callback in case the database was /just/ created, for you to call changeVersion and provide an initial schema. However, since this post is more interested in migrations, and because I don't want the initial migration to be a "special case", I'm pretending like it doesn't exist. It's there if you want it, of course.
- */
Add Comment
Please, Sign In to add comment