diff --git a/server/module_api/sub_Object.js b/server/module_api/sub_Object.js index ca210ad..b752448 100644 --- a/server/module_api/sub_Object.js +++ b/server/module_api/sub_Object.js @@ -65,16 +65,16 @@ hrisObject.setup = function() { //// OK, make sure this object is cached for us: cachedObjects[object[Object.id]] = object.attrs(); - - + + // sql: // CREATE TABLE `hris2_attributes` ( // `attribute_id` int(11) unsigned NOT NULL AUTO_INCREMENT, // PRIMARY KEY (`attribute_id`) // ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - + var sql = AD.Util.String.render(sqlCommands.newTable, object.attrs()); - + // console.log('sql:'+sql); @@ -147,8 +147,6 @@ console.log('sql:'+sql); - //// 2: Remove any relationships referenced by/to this object - } else { /// Odd ... where did this reference come from? diff --git a/server/module_api/sub_Relationship.js b/server/module_api/sub_Relationship.js index dd3b616..6a209bb 100644 --- a/server/module_api/sub_Relationship.js +++ b/server/module_api/sub_Relationship.js @@ -81,10 +81,9 @@ hrisRelationship.setup = function() { // Add the foreign key column var sql = 'ALTER TABLE '+AD.Defaults.dbName+'.'+ objA.object_table + ' ADD '; - sql += objB.object_pkey + ' int(10) UNSIGNED'; - sql += ';' + sql += objB.object_pkey + ' int(10) UNSIGNED;'; // Add an index - sql + 'ALTER TABLE '+AD.Defaults.dbName+'.'+ objA.object_table + ' ADD INDEX (' + objB.object_pkey + ')' ; + sql += 'ALTER TABLE '+AD.Defaults.dbName+'.'+ objA.object_table + ' ADD INDEX (' + objB.object_pkey + ');' ; console.log(sql) db.runSQL(sql,[], function(err, results, fields){ if (err) {