Skip to content

Commit ad03067

Browse files
committed
bugfix relating to saving tables with unique indexes
1 parent db774df commit ad03067

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![jSQL Logo](http://i.imgur.com/VQlJKOc.png)](http://pamblam.github.io/jSQL/)
22

3-
jSQL (Official) - Version 2.7 - *Now gluten free!*
3+
jSQL (Official) - Version 2.8 - *Now gluten free!*
44
[![npm version](https://badge.fury.io/js/jsql-official.svg)](https://badge.fury.io/js/jsql-official) [![Build Status](https://travis-ci.org/Pamblam/jSQL.svg?branch=master)](https://travis-ci.org/Pamblam/jSQL) [![Inline docs](http://inch-ci.org/github/Pamblam/jSQL.svg?branch=master)](http://inch-ci.org/github/Pamblam/jSQL)
55

66
<hr>

jSQL.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,7 +2204,7 @@
22042204

22052205
var keys = [];
22062206
for(var i=0; i<jSQL.tables[tbl].keys.unique.length; i++)
2207-
keys.push({column: jSQL.tables[tbl].keys.unique.column, type: "unique"});
2207+
keys.push({column: jSQL.tables[tbl].keys.unique[i].column, type: "unique"});
22082208
if(jSQL.tables[tbl].keys.primary.column)
22092209
keys.push({column: jSQL.tables[tbl].keys.primary.column, type: "primary"});
22102210

@@ -2292,6 +2292,7 @@
22922292
jSQL.createTable(tablename, cols, colTypes, keys, ai_col).execute();
22932293
}
22942294
}
2295+
22952296
// If it's an array it's just column names and the table is empty
22962297
// So, only do this if the rowdata is actually a rowdata object
22972298
if(!Array.isArray(rowdata)){
@@ -2506,7 +2507,7 @@
25062507
////////////////////////////////////////////////////////////////////////////
25072508

25082509
return {
2509-
version: 2.7,
2510+
version: 2.8,
25102511
tables: {},
25112512
query: jSQLParseQuery,
25122513
createTable: createTable,

jSQL.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jsql-official",
3-
"version": "2.7.0",
3+
"version": "2.8.0",
44
"description": "jSQL is a robust and persistent SQL engine written in Javascript for both Node and browser. See: pamblam.github.io/jSQL for details and usage.",
55
"main": "jSQL.min.js",
66
"directories": {

0 commit comments

Comments
 (0)