www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit b495bb633455acc9755aec171f27b1a45910b816
parent 72ca609b52ebe511ccb054d499a2dd476274558f
Author: Dan Stillman <dstillman@zotero.org>
Date:   Thu, 29 Jun 2006 06:28:50 +0000

Use getRandomID() for new item ids rather than auto-increment


Diffstat:
Mchrome/chromeFiles/content/scholar/xpcom/data_access.js | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/chrome/chromeFiles/content/scholar/xpcom/data_access.js b/chrome/chromeFiles/content/scholar/xpcom/data_access.js @@ -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);