Advertisement
Guest User

Untitled

a guest
Jan 14th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. //provide database name and version number
  2. var request = indexedDB.open("checkin");
  3. var db = null;
  4.  
  5.  
  6. request.onupgradeneeded = function(){
  7. db = request.result;
  8.  
  9. //create object store and define key property of the objects on that store i.e., primary index. Here "ID" is the key
  10. var store = db.createObjectStore("tbPos", {keyPath: "ID", autoIncrement: true});
  11.  
  12. //define other properties of the objects of that store i.e., define other columns.
  13. store.createIndex("lat", "lat", {unique: false});
  14. store.createIndex("lng", "lng", {unique: false});
  15. store.createIndex("usuario", "usuario", {unique: false});
  16. store.createIndex("rota", "rota", {unique: false});
  17. store.createIndex("cliente", "cliente", {unique: false});
  18. store.createIndex("hora", "hora", {unique: false});
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement