fix: add custom create index to firebird dumper

This commit is contained in:
Pavel
2025-06-03 17:39:40 +02:00
parent 4177448d32
commit 4e13598708

View File

@@ -43,6 +43,27 @@ class Dumper extends SqlDumper {
beginTransaction() {
this.putCmd('^set ^transaction');
}
createIndex(ix) {
const firstCol = ix.columns[0];
this.put('^create');
if (ix.isUnique) this.put(' ^unique');
this.put(
' %k ^index %i &n^on %f (&>&n',
firstCol.isDescending == true ? 'DESCENDING' : 'ASCENDING',
ix.constraintName,
ix
);
this.putCollection(',&n', ix.columns, col => {
this.put('%i', col.columnName);
});
this.put('&<&n)');
if (ix.filterDefinition && this.dialect.filteredIndexes) {
this.put('&n^where %s', ix.filterDefinition);
}
this.endCommand();
}
}
module.exports = Dumper;