title: How to create multiple object stores in IndexedDB
body: <p>I don't know if I'm right or wrong. But as I know I can't create a version change transaction manually. The only way to invoke this is by changing the version number when opening the indexed DB connection. If this is correct, in example1 and example2 new objectStore will never be created?</p>
  
  <p>Example1</p>
  
  <pre><code>function createObjectStore(name){
      var request2 = indexedDB.open("existingDB");    
      request2.onupgradeneeded = function() {
          var db = request2.result;   
          var store = db.createObjectStore(name); 
      };
  }
  </code></pre>
  
  <p>Example2</p>
  
  <pre><code>function createObjectStore(name){
      var request2 = indexedDB.open("existingDB");    
      request2.onsuccess = function() {
          var db = request2.result;   
          var store = db.createObjectStore(name); 
      };
   }
  </code></pre>
  
  <p>Example3 - This should work:</p>
  
  <pre><code>function createObjectStore(name){
      var request2 = indexedDB.open("existingDB", 2);     
      request2.onupgradeneeded = function() {
          var db = request2.result;   
          var store = db.createObjectStore(name); 
      };
  }
  </code></pre>
  
  <p>If I want to create <strong>multiple objectStore's in one database</strong> how can I get/fetch database version before opening the database??
  So is there a way to automate this process of getting database version number??</p>
  
  <p>Is there any  other way to create objectStore other than that using onupgradeneeded event handler.</p>
  
  <p>Please help. Thanks a lot.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Here is same problem that I have:
  <a href="https://groups.google.com/a/chromium.org/forum/#!topic/chromium-html5/0rfvwVdSlAs" rel="noreferrer">https://groups.google.com/a/chromium.org/forum/#!topic/chromium-html5/0rfvwVdSlAs</a></p>