(table, key, dataType)
| 185 | } |
| 186 | |
| 187 | addColumnQuery(table, key, dataType) { |
| 188 | dataType.field = key; |
| 189 | |
| 190 | const query = class="st">'ALTER TABLE <%= table %> ADD <%= attribute %>;', |
| 191 | attribute = _.template(class="st">'<%= key %> <%= definition %>', this._templateSettings)({ |
| 192 | key: this.quoteIdentifier(key), |
| 193 | definition: this.attributeToSQL(dataType, { |
| 194 | context: class="st">'addColumn' |
| 195 | }) |
| 196 | }); |
| 197 | |
| 198 | return _.template(query, this._templateSettings)({ |
| 199 | table: this.quoteTable(table), |
| 200 | attribute |
| 201 | }); |
| 202 | } |
| 203 | |
| 204 | removeColumnQuery(tableName, attributeName) { |
| 205 | const query = class="st">'ALTER TABLE <%= tableName %> DROP COLUMN <%= attributeName %>;'; |
no test coverage detected