MCPcopy
hub / github.com/sequelize/sequelize / addColumnQuery

Method addColumnQuery

lib/dialects/db2/query-generator.js:187–202  ·  lib/dialects/db2/query-generator.js::Db2QueryGenerator.addColumnQuery
(table, key, dataType)

Source from the content-addressed store, hash-verified

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 %>;';

Callers 3

addColumnMethod · 0.45
add-column.test.jsFile · 0.45

Calls 3

quoteIdentifierMethod · 0.95
attributeToSQLMethod · 0.95
quoteTableMethod · 0.80

Tested by

no test coverage detected