knex/lib/dialects/cockroachdb/crdb-tablecompiler.js
2021-10-15 18:02:55 +03:00

19 lines
507 B
JavaScript

/* eslint max-len: 0 */
const TableCompiler = require('../postgres/schema/pg-tablecompiler');
class TableCompiler_CRDB extends TableCompiler {
constructor(client, tableBuilder) {
super(client, tableBuilder);
}
dropUnique(columns, indexName) {
indexName = indexName
? this.formatter.wrap(indexName)
: this._indexCommand('unique', this.tableNameRaw, columns);
this.pushQuery(`drop index ${this.tableName()}@${indexName} cascade `);
}
}
module.exports = TableCompiler_CRDB;