Use getRandomID() for new item ids rather than auto-increment
This commit is contained in:
parent
72ca609b52
commit
b495bb6334
1 changed files with 6 additions and 2 deletions
|
@ -625,6 +625,10 @@ Scholar.Item.prototype.save = function(){
|
|||
//
|
||||
// Primary fields
|
||||
//
|
||||
sqlColumns.push('itemID');
|
||||
var itemID = Scholar.getRandomID('items', 'itemID');
|
||||
sqlValues.push(itemID);
|
||||
|
||||
sqlColumns.push('itemTypeID');
|
||||
sqlValues.push({'int':this.getField('itemTypeID')});
|
||||
|
||||
|
@ -651,8 +655,8 @@ Scholar.Item.prototype.save = function(){
|
|||
}
|
||||
sql = sql.substring(0,sql.length-1) + ")";
|
||||
|
||||
// Save basic data to items table and get new ID
|
||||
var itemID = Scholar.DB.query(sql,sqlValues);
|
||||
// Save basic data to items table
|
||||
Scholar.DB.query(sql, sqlValues);
|
||||
this._data['itemID'] = itemID;
|
||||
|
||||
Scholar.History.setAssociatedID(itemID);
|
||||
|
|
Loading…
Reference in a new issue