This commit is contained in:
Roman Volosovskyi 2017-05-01 13:50:49 +03:00
parent fa94340b6a
commit 0c53936d61
3 changed files with 14 additions and 4 deletions

View File

@ -18,5 +18,5 @@
:suggestions-trigger {:type :string :suggestions-trigger {:type :string
:default "on-change"}}}) :default "on-change"}}})
(defn migration [_ _] (defn migration [old-realm new-realm]
(log/debug "migrating chat-contact schema")) (log/debug "migrating chat-contact schema v6"))

View File

@ -29,4 +29,14 @@
:default false}}}) :default false}}})
(defn migration [old-realm new-realm] (defn migration [old-realm new-realm]
(log/debug "migrating contact schema v6")) (log/debug "migrating contact schema v6")
(let [new-contacts (.objects new-realm "contact")]
(dotimes [i (.-length new-contacts)]
(let [contact (aget new-contacts i)
id (aget contact "whisper-identity")]
(when (= id "console")
(log/debug (js->clj contact))
(aset contact "dapp-url" nil)
(aset contact "bot-url" "local://console-bot"))
(when (= id "wallet")
(aset contact "dapp-url" "https://status.im/dapps/wallet/"))))))

View File

@ -33,6 +33,6 @@
group-contact/schema]) group-contact/schema])
(defn migration [old-realm new-realm] (defn migration [old-realm new-realm]
(log/debug "migrating v5 account database: " old-realm new-realm) (log/debug "migrating v6 account database: " old-realm new-realm)
(chat/migration old-realm new-realm) (chat/migration old-realm new-realm)
(contact/migration old-realm new-realm)) (contact/migration old-realm new-realm))