(table, key, dataType)
| 195 | } |
| 196 | |
| 197 | addColumnQuery(table, key, dataType) { |
| 198 | dataType.field = key; |
| 199 | |
| 200 | const query = 'ALTER TABLE <%= table %> ADD <%= attribute %>;', |
| 201 | attribute = _.template('<%= key %> <%= definition %>', this._templateSettings)({ |
| 202 | key: this.quoteIdentifier(key), |
| 203 | definition: this.attributeToSQL(dataType, { |
| 204 | context: 'addColumn' |
| 205 | }) |
| 206 | }); |
| 207 | |
| 208 | return _.template(query, this._templateSettings)({ |
| 209 | table: this.quoteTable(table), |
| 210 | attribute |
| 211 | }); |
| 212 | } |
| 213 | |
| 214 | removeColumnQuery(tableName, attributeName) { |
| 215 | const query = 'ALTER TABLE <%= tableName %> DROP COLUMN <%= attributeName %>;'; |
no test coverage detected