cobalt.update.js 680 B

12345678910111213141516
  1. (function($) {
  2. $(document).bind('cobalt-update', function(evt, cobalt, db, updates) {
  3. if (typeof(updates['cobalt'])!='undefined') {
  4. var update = updates.cobalt;
  5. switch (parseInt(update[0], 10)) {
  6. case 0:
  7. // Update to version 1.
  8. db.transaction(function (transaction) {
  9. transaction.executeSql('ALTER TABLE entries ADD COLUMN extra TEXT DEFAULT ""', [], function(){}, cobalt.dbErrorHandler);
  10. transaction.executeSql('ALTER TABLE usage_data ADD COLUMN last INTEGER', [], function(){}, cobalt.dbErrorHandler);
  11. cobalt.updateVersion(transaction, 'cobalt', 1);
  12. });
  13. }
  14. }
  15. });
  16. })(jQuery);