Skip to content

Commit

Permalink
release - v 4.3.3
Browse files Browse the repository at this point in the history
add check for indexNames exist in addColumn
  • Loading branch information
ujjwalguptaofficial committed Jul 1, 2021
1 parent 72bdde5 commit 4182bc2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsstore",
"version": "4.3.2",
"version": "4.3.3",
"description": "A complete IndexedDB wrapper with SQL like syntax.",
"main": "dist/npm.export.js",
"types": "dist/ts/main/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/worker/idbutil/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ export class IDBUtil {
});
}
const addColumn = (store: IDBObjectStore, column: IColumn) => {
if (column.enableSearch) {
const columnName = column.name;
const columnName = column.name;
if (column.enableSearch && !store.indexNames.contains(columnName)) {
const options = column.primaryKey ? { unique: true } : { unique: column.unique };
options['multiEntry'] = column.multiEntry;
const keyPath = column.keyPath == null ? columnName : column.keyPath;
Expand Down
8 changes: 7 additions & 1 deletion test/cases/db_upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,13 @@ describe('Db upgrade Test', function () {
add: {
name: {
dataType: 'string'
}
},
"id": {
"primaryKey": true,
"dataType": "number",
"autoIncrement": true,
"notNull": true
},
},
},
5: {
Expand Down

0 comments on commit 4182bc2

Please sign in to comment.