From 22774923d4521a7f1e5227aae05a1d77faef00ec Mon Sep 17 00:00:00 2001 From: Jim Buzbee Date: Fri, 12 Apr 2013 11:50:08 -0600 Subject: [PATCH 1/2] Per recent meteor change, remove var keyword from Tables to make it visible outside file --- client/example/employee.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/example/employee.js b/client/example/employee.js index f71f25f..2c358eb 100644 --- a/client/example/employee.js +++ b/client/example/employee.js @@ -1,7 +1,7 @@ var notDone = true; var Employee = new Meteor.Table('employees'); Meteor.subscribe('meteor_tables'); -var Tables = new Meteor.Collection('meteor_tables'); +Tables = new Meteor.Collection('meteor_tables'); Template.devwikEmployees.rendered = function () { if (notDone) {//do it once From 67bb55c309b50a31680fc65cb9c6a8d5fb5740eb Mon Sep 17 00:00:00 2001 From: Jim Buzbee Date: Fri, 12 Apr 2013 16:22:09 -0600 Subject: [PATCH 2/2] Utilize databse name from config file during databse initialization --- server/dbinit.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/dbinit.js b/server/dbinit.js index 64dfc1c..d476be7 100644 --- a/server/dbinit.js +++ b/server/dbinit.js @@ -19,6 +19,8 @@ pool.getConnection(function(err, connection) { query = connection.query('show tables', function(err, result) { if (err) throw err; Fiber(function() { + // construct the property name we need to fetch the table name + var databaseProperty = "Tables_in_" + Devwik.SQL.Config.database; //Get the list of views in the db Devwik.SQL.View.getViews(); @@ -31,9 +33,9 @@ pool.getConnection(function(err, connection) { Devwik.SQL.tables = {}; Devwik.SQL.views = {}; _.each(result, function(row){ //For each table in the db - if(!(row.Tables_in_meteor === Devwik.SQL.Config.dbChanges)) { + if(!(row[databaseProperty] === Devwik.SQL.Config.dbChanges)) { //Get the info about the table and its columns - var table = new Devwik.SQL.Table(row.Tables_in_meteor); + var table = new Devwik.SQL.Table(row[databaseProperty] ); Devwik.SQL.tables[table.name] = table; console.log('loaded:' + table.name); }