brianc/node-sql — pull request #65 by brianc (2013-05-14 14:05:36+00:00)
Title: renameColumn not working?

I wonder if I'm doing something wrong or if it is just not working:

```js
QueryGenerator.prototype.renameColumnQuery = function(tableName, attrNameBefore, attributes) {
var attrNameAfter = Object.keys(attributes)[0]
, columns = [
{ name: attrNameBefore, dataType: attributes[attrNameAfter] },
{ name: attrNameAfter, dataType: attributes[attrNameAfter] }
]
, model = this.sql.define({ name: tableName, columns: columns })
, scope = model.alter().renameColumn(model.get(attrNameBefore), model.get(attrNameAfter))

return this.evaluate(scope.toQuery())
}
```

The `columns` are containing the following array:

```js
[ { name: 'signature',
dataType: 'VARCHAR(255) NOT NULL DEFAULT \'Signature\'' },
{ name: 'sig',
dataType: 'VARCHAR(255) NOT NULL DEFAULT \'Signature\'' } ]
```

According to the tests, I'd expected that it would just work. But for some reason, node-sql is complaining about a missing dataType :(