Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update js etl #148

Merged
merged 2 commits into from
May 25, 2017
Merged
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
6 changes: 3 additions & 3 deletions etl/js/lib/mysql.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ var DynamicTable = module.exports.DynamicTable = function(table) {
'PRIMARY KEY (_id)'
];

var ret = [ 'CREATE TABLE IF NOT EXISTS ' + this.meta.schema + '.' + this.name + '(\n' + allDims.join(',\n ') + '\n) engine = myisam' ];
var ret = ['CREATE TABLE IF NOT EXISTS ' + this.name + '(\n' + allDims.join(',\n ') + '\n) engine = myisam'];

if(this.triggers) {
var verbs = { before: "BEFORE", after: "AFTER" };
Expand All @@ -119,7 +119,7 @@ var DynamicTable = module.exports.DynamicTable = function(table) {
stmt += "DROP TRIGGER IF EXISTS " + triggername + "$$\n";
stmt += "USE `"+this.meta.schema+"`$$\n";
stmt += "CREATE TRIGGER " + triggername + "\n";
stmt += verbs[verb] + " " + nouns[noun] + " ON `"+this.meta.schema+ "`.`" + this.name + "`\n";
stmt += verbs[verb] + ' ' + nouns[noun] + ' ON `' + this.name + '`\n';
stmt += "FOR EACH ROW\nBEGIN\n";
stmt += this.triggers[action];
stmt += "END$$\nDELIMITER ;\n";
Expand Down Expand Up @@ -190,7 +190,7 @@ var DynamicTable = module.exports.DynamicTable = function(table) {
];
allDims.push( this.meta.extras.join(',\n '), ' PRIMARY KEY (_id)'/*, 'KEY version_index (_version)'*/);

var ret = 'CREATE TABLE IF NOT EXISTS ' + this.meta.schema + '.' + this.name + '_errors (' + allDims.join(',\n ') + '\n) engine = myisam';
var ret = 'CREATE TABLE IF NOT EXISTS ' + this.name + '_errors (' + allDims.join(',\n ') + '\n) engine = myisam';

return ret;
}
Expand Down