Skip to content

Instantly share code, notes, and snippets.

@hungryzi
Last active December 11, 2015 14:49
Show Gist options
  • Save hungryzi/4617033 to your computer and use it in GitHub Desktop.
Save hungryzi/4617033 to your computer and use it in GitHub Desktop.
Indices for naive modelling
@schema = IndexedDBBackbone.describe('experiment1')
.createStore('catalog_items', keyPath: 'id')
.createStore('inventory_items', keyPath: 'id')
.createIndex('catalog_items', 'serializedIndex', 'serialized', unique: false)
.createIndex('catalog_items', 'categoryIndex', 'category_id', unique: false)
.createIndex('inventory_items', 'locationIndex', 'location_id', unique: false)
.createIndex('inventory_items', 'catalogItemIndex', 'catalog_item_id', unique: false)
@schema = IndexedDBBackbone.describe('experiment1')
.createStore('catalog_items', keyPath: 'id')
.createStore('inventory_items', keyPath: 'id')
.createIndex( 'catalog_items',
'queryIndex',
['serialized', 'category_id'],
unique: false)
.createIndex('inventory_items', 'locationIndex', 'location_id', unique: false)
.createIndex('inventory_items', 'catalogItemIndex', 'catalog_item_id', unique: false)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment