window.start = function() {
sklad.open("testObj", {
version: 2,
migration: {
'1': function (database) {
// This migration part starts when your code runs first time in the browser.
// This is a migration from "didn't exist" to "1" database version
var objStore = database.createObjectStore('users', {autoIncrement: true});
objStore.createIndex('email_search', 'email', {unique: true});
objStore.createIndex('name_search', 'firstname');
},
'2': function (database) {
// This migration part starts when your code runs first time in the browser.
// This is a migration from "didn't exist" to "1" database version
var objStore = database.createObjectStore('deck', {autoIncrement: true});
var objStore = database.createObjectStore('block', {autoIncrement: true});
var objStore = database.createObjectStore('note', {autoIncrement: true});
var objStore = database.createObjectStore('comment', {autoIncrement: true});
},
}
}, function (err, conn) {
// work with database connection
var t = true;
var transaction = conn.database.transaction(["users", "deck", "block", "note", "comment"], "readwrite");
var objectStore = transaction.objectStore("users");
var objectStore1 = transaction.objectStore("deck");
var objectStore2 = transaction.objectStore("block");
var objectStore3 = transaction.objectStore("note");
});
};
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.