fix another indexeddb migration bug

This commit is contained in:
Nolan Lawson 2018-03-17 11:59:35 -07:00
parent ad36d9274d
commit 4d386357e7
2 changed files with 11 additions and 11 deletions

View file

@ -1,12 +1,12 @@
export const STATUSES_STORE = 'statuses-v3' export const STATUSES_STORE = 'statuses-v4'
export const STATUS_TIMELINES_STORE = 'status_timelines-v3' export const STATUS_TIMELINES_STORE = 'status_timelines-v4'
export const META_STORE = 'meta-v3' export const META_STORE = 'meta-v4'
export const ACCOUNTS_STORE = 'accounts-v3' export const ACCOUNTS_STORE = 'accounts-v4'
export const RELATIONSHIPS_STORE = 'relationships-v3' export const RELATIONSHIPS_STORE = 'relationships-v4'
export const NOTIFICATIONS_STORE = 'notifications-v3' export const NOTIFICATIONS_STORE = 'notifications-v4'
export const NOTIFICATION_TIMELINES_STORE = 'notification_timelines-v3' export const NOTIFICATION_TIMELINES_STORE = 'notification_timelines-v4'
export const PINNED_STATUSES_STORE = 'pinned_statuses-v3' export const PINNED_STATUSES_STORE = 'pinned_statuses-v4'
export const THREADS_STORE = 'threads-v3' export const THREADS_STORE = 'threads-v4'
export const TIMESTAMP = '__pinafore_ts' export const TIMESTAMP = '__pinafore_ts'
export const ACCOUNT_ID = '__pinafore_acct_id' export const ACCOUNT_ID = '__pinafore_acct_id'

View file

@ -18,7 +18,7 @@ import forEach from 'lodash/forEach'
const openReqs = {} const openReqs = {}
const databaseCache = {} const databaseCache = {}
const DB_VERSION = 8 const DB_VERSION = 9
export function getDatabase (instanceName) { export function getDatabase (instanceName) {
if (!instanceName) { if (!instanceName) {
@ -49,7 +49,7 @@ export function getDatabase (instanceName) {
} }
} }
if (e.oldVersion < 7) { if (e.oldVersion < DB_VERSION) {
createObjectStore(STATUSES_STORE, {keyPath: 'id'}, { createObjectStore(STATUSES_STORE, {keyPath: 'id'}, {
[TIMESTAMP]: TIMESTAMP, [TIMESTAMP]: TIMESTAMP,
[REBLOG_ID]: REBLOG_ID [REBLOG_ID]: REBLOG_ID