summaryrefslogtreecommitdiff
path: root/ext/bg/js/database.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-03-01 22:36:42 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-18 21:31:09 -0400
commit8106f4744b07833526d16acf656eda11d29b99ad (patch)
tree8d840ab694ee81f232dccc5154cc5d1e25e7c2cf /ext/bg/js/database.js
parent3b2663ba0957c65be959ba18dc80e13625e28f02 (diff)
Add support for importing and storing media files
Diffstat (limited to 'ext/bg/js/database.js')
-rw-r--r--ext/bg/js/database.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/bg/js/database.js b/ext/bg/js/database.js
index 260c815a..0c7eee6a 100644
--- a/ext/bg/js/database.js
+++ b/ext/bg/js/database.js
@@ -33,7 +33,7 @@ class Database {
}
try {
- this.db = await Database._open('dict', 5, (db, transaction, oldVersion) => {
+ this.db = await Database._open('dict', 6, (db, transaction, oldVersion) => {
Database._upgrade(db, transaction, oldVersion, [
{
version: 2,
@@ -90,6 +90,15 @@ class Database {
indices: ['dictionary', 'expression', 'reading', 'sequence', 'expressionReverse', 'readingReverse']
}
}
+ },
+ {
+ version: 6,
+ stores: {
+ media: {
+ primaryKey: {keyPath: 'id', autoIncrement: true},
+ indices: ['dictionary', 'path']
+ }
+ }
}
]);
});