不要怂,就是干,撸起袖子干!

Commit e7c81156 by Daniel Schwartz

adding if statement around port declaration, and returning query-generator to original form

1 parent dbbc9070
......@@ -44,7 +44,7 @@ module.exports = (function() {
this.isConnecting = true
this.isConnected = false
var conStr = '<%= protocol %>://<%= user %>:<%= password %>@<%= host %>/<%= database %>'
var conStr = '<%= protocol %>://<%= user %>:<%= password %>@<%= host %><% if(port) { %>:<%= port %><% } %>/<%= database %>';
conStr = Utils._.template(conStr)({
user: this.config.username,
password: this.config.password,
......
......@@ -61,7 +61,7 @@ module.exports = (function() {
primaryKeys[tableName] = []
tables[tableName] = {}
var query = "CREATE TABLE <%= table %> (<%= attributes%>)"
var query = "CREATE TABLE IF NOT EXISTS <%= table %> (<%= attributes%>)"
, attrStr = Utils._.map(attributes, function(dataType, attr) {
dataType = pgDataTypeMapping(tableName, attr, dataType)
return addQuotes(attr) + " " + dataType
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!