const con = require('./connect.js'); con.con.connect(function(err) { if (err) throw err; let sql = `CREATE TABLE vn.smartTag ( code varchar(100) NOT NULL, shelvingFk varchar(10) NULL, \`level\` int(11) NULL, CONSTRAINT \`PRIMARY\` PRIMARY KEY (code), CONSTRAINT smartTag_FK FOREIGN KEY (shelvingFk) REFERENCES vn.shelving(code) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;`; con.con.query(sql, function(err, result) { if (err) throw err; }); });