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

Commit 8c17e416 by Kevin Martin

Fixed a typo in PG Query Generator

1 parent aa17f8d7
Showing with 8 additions and 8 deletions
......@@ -86,8 +86,8 @@ module.exports = (function() {
var dataType = pgDataTypeMapping(tableName, attr, attributes[attr])
attrStr.push(addQuotes(attr) + " " + dataType)
if (attributes[attr].type.match(/^ENUM\(/)) {
query = "CREATE TYPE " + Utils.escape("enum_" + tableName + "_" + attr) + " AS " + attributes[attr].type + "; " + query
if (attributes[attr].match(/^ENUM\(/)) {
query = "CREATE TYPE " + Utils.escape("enum_" + tableName + "_" + attr) + " AS " + attributes[attr].match(/^ENUM\(.+\)/)[0] + "; " + query
}
}
......@@ -136,8 +136,8 @@ module.exports = (function() {
definition: pgDataTypeMapping(tableName, attrName, definition)
}))
if (definition.type.match(/^ENUM\(/)) {
query = "CREATE TYPE " + Utils.escape("enum_" + tableName + "_" + attrName) + " AS " + definition.type + "; " + query
if (definition.match(/^ENUM\(/)) {
query = "CREATE TYPE " + Utils.escape("enum_" + tableName + "_" + attrName) + " AS " + definition.match(/^ENUM\(.+\)/)[0] + "; " + query
}
}
......@@ -177,8 +177,8 @@ module.exports = (function() {
sql.push(attrSql)
if (definition.type.match(/^ENUM\(/)) {
query = "CREATE TYPE " + Utils.escape("enum_" + tableName + "_" + attributeName) + " AS " + definition.type + "; " + query
if (definition.match(/^ENUM\(/)) {
query = "CREATE TYPE " + Utils.escape("enum_" + tableName + "_" + attributeName) + " AS " + definition.match(/^ENUM\(.+\)/)[0] + "; " + query
}
}
......@@ -195,8 +195,8 @@ module.exports = (function() {
after: addQuotes(attributeName),
}))
if (attributes[attributeName].type.match(/^ENUM\(/)) {
query = "CREATE TYPE " + Utils.escape("enum_" + tableName + "_" + attributeName) + " AS " + attributes[attributeName].type + "; " + query
if (attributes[attributeName].match(/^ENUM\(/)) {
query = "CREATE TYPE " + Utils.escape("enum_" + tableName + "_" + attributeName) + " AS " + attributes[attributeName].match(/^ENUM\(.+\)/)[0] + "; " + query
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!