webcss / angular-indexedDB

An angularjs serviceprovider to utilize indexedDB with angular
149 stars 99 forks source link

Database is not creating #46

Open sheikhbarkat opened 8 years ago

sheikhbarkat commented 8 years ago

This code is not working on angular 1.5v, no debug mode ?, no error log ?

$indexedDBProvider.connection('localDatabasex');.upgradeDatabase(1, function (event, db, tx) {
   console.log(db);
   //Create Objects -- CityMaster
   var objStore = db.createObjectStore('citymaster', { keyPath: 'ssn' });
   objStore.createIndex('cityid', 'int', { unique: false });
   objStore.createIndex('cityname', 'cityname', { unique: false });
   objStore.createIndex('statename', 'statename', { unique: false });
   objStore.createIndex('customcity', 'customcity', { unique: false });
   objStore.createIndex('Whenupdate', 'Whenupdate', { unique: false });
   objStore.createIndex('recentcity', 'recentcity', { unique: false });

});

phamquocbuu commented 8 years ago

Have you ever tried increase the version number upgradeDatabase(2, ...)? I also have this bug. The version of DB not change when I change it in code.

phamquocbuu commented 8 years ago

Oh, @sheikhbarkat , I see that when the dababase has any action such as call objectStore(), it will check the version and do upgrade. upgradeDatabase() just pass a callback function for using when upgrading, itself not do upgrade.

sheikhbarkat commented 8 years ago

Hey

Thanks for reply.

You have given those steps, i done exactly but database is not created., i tried many times it won't work. may be Angular version issue i'm using v 1.5

Then i created database using normal java script code.

Thanks

Regards ,

On Sun, Apr 17, 2016 at 5:43 PM, Cosmos Pham notifications@github.com wrote:

Oh, @sheikhbarkat https://github.com/sheikhbarkat , I see that when the dababase has any action such as call objectStore(), it will check the version and do upgrade. upgradeDatabase() just pass a callback function for using when upgrading, itself not do upgrade.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/webcss/angular-indexedDB/issues/46#issuecomment-211007997