Skip to content

Commit

Permalink
restore fix #91
Browse files Browse the repository at this point in the history
  • Loading branch information
yathit committed Dec 25, 2015
1 parent 424e7dd commit 45c08d4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 37 deletions.
6 changes: 3 additions & 3 deletions jsc/ydn.db-dev.js.map

Large diffs are not rendered by default.

24 changes: 14 additions & 10 deletions src/ydn/db/conn/websql.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,17 @@ ydn.db.con.WebSql.prototype.connect = function(dbname, schema) {
var edited_schema = schema;
edited_schema.addStore(info_store);
} else {
var sql = me.prepareDropTable_(info_store);
tx.executeSql(sql, [],
function(tr) {
// ok
}, function(tx, e) {
throw e;
});
var sqls = me.prepareDropTable_(info_store);
for (var i = 0; i < sqls.length; i++) {
var sql = sqls[i];
goog.log.finer(me.logger, sql);
tx.executeSql(sql, [],
function(tr) {
// ok
}, function(tx, e) {
throw e;
});
}
}
}
}
Expand Down Expand Up @@ -436,7 +440,7 @@ ydn.db.con.WebSql.CREATE_INDEX = false;
*
* @private
* @param {ydn.db.schema.Store} table table schema.
* @return {string} SQL statement for dropping the table.
* @return {!Array.<string>} SQL statement for dropping the table.
*/
ydn.db.con.WebSql.prototype.prepareDropTable_ = function(table) {

Expand All @@ -460,7 +464,7 @@ ydn.db.con.WebSql.prototype.prepareDropTable_ = function(table) {

}

return sqls.join(';');
return sqls;
};


Expand Down Expand Up @@ -882,7 +886,7 @@ ydn.db.con.WebSql.prototype.update_store_with_info_ = function(trans,
goog.log.warning(this.logger,
'table: ' + table_schema.getName() + ' has changed by ' + msg +
' ALTER TABLE cannot run in WebSql, dropping old table.');
sqls.unshift(this.prepareDropTable_(existing_table_schema));
sqls.unshift.apply(sqls, this.prepareDropTable_(existing_table_schema));
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/alltests.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 0 additions & 22 deletions test/core/iteration_websql_test.html

This file was deleted.

0 comments on commit 45c08d4

Please sign in to comment.