Use keyword as index name
This commit is contained in:
parent
5452579f0d
commit
9505023718
1 changed files with 2 additions and 2 deletions
|
|
@ -353,7 +353,7 @@
|
||||||
refresh-id (js/Date.now)]
|
refresh-id (js/Date.now)]
|
||||||
(swap! state update-in [:section/posts :loading] conj refresh-id)
|
(swap! state update-in [:section/posts :loading] conj refresh-id)
|
||||||
(-> (js/Promise.all #js [(db/count! ::db/posts)
|
(-> (js/Promise.all #js [(db/count! ::db/posts)
|
||||||
(-> (db/open-cursor! ::db/posts "created_at" db/all "prev")
|
(-> (db/open-cursor! ::db/posts ::db/post-created-at db/all "prev")
|
||||||
(db/transduce-cursor xform))])
|
(db/transduce-cursor xform))])
|
||||||
(.then (fn [[total displayed-posts]]
|
(.then (fn [[total displayed-posts]]
|
||||||
(swap! state update :section/posts #(-> (assoc % :total total)
|
(swap! state update :section/posts #(-> (assoc % :total total)
|
||||||
|
|
@ -451,7 +451,7 @@
|
||||||
(db/create-object-store! db ::db/posts {:keyPath "id"}))
|
(db/create-object-store! db ::db/posts {:keyPath "id"}))
|
||||||
2 (fn migration-0002 [_ txn]
|
2 (fn migration-0002 [_ txn]
|
||||||
(-> (db/open-store txn ::db/posts "readwrite")
|
(-> (db/open-store txn ::db/posts "readwrite")
|
||||||
(db/create-index! "created_at" "created_at" {:unique false})))})
|
(db/create-index! ::db/post-created-at "created_at" {:unique false})))})
|
||||||
|
|
||||||
;; go go go
|
;; go go go
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue