Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions server/module_api/sub_Object.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);


Expand Down Expand Up @@ -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?
Expand Down
5 changes: 2 additions & 3 deletions server/module_api/sub_Relationship.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down