* Drop a table from database * * @param {string} tableName Table name to drop * @param {object} options Query options * * @returns {Promise}
(tableName, options)
| 256 | * @returns {Promise} |
| 257 | */ |
| 258 | async dropTable(tableName, options) { |
| 259 | // if we're forcing we should be cascading unless explicitly stated otherwise |
| 260 | options = { ...options }; |
| 261 | options.cascade = options.cascade || options.force || false; |
| 262 | |
| 263 | const sql = this.queryGenerator.dropTableQuery(tableName, options); |
| 264 | |
| 265 | await this.sequelize.query(sql, options); |
| 266 | } |
| 267 | |
| 268 | async _dropAllTables(tableNames, skip, options) { |
| 269 | for (const tableName of tableNames) { |