Skip to content
This repository was archived by the owner on May 24, 2018. It is now read-only.

Small Submittal #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion client/example/employee.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 4 additions & 2 deletions server/dbinit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
}
Expand Down