postgre, mysql uniques, recreate table WIP, drop index works

This commit is contained in:
Jan Prochazka
2021-09-04 18:43:59 +02:00
parent b3b7d021c5
commit 04a6540890
15 changed files with 113 additions and 27 deletions

View File

@@ -420,8 +420,24 @@ export class SqlDumper implements AlterProcessor {
);
}
dropIndex(ix: IndexInfo) {}
createIndex(ix: IndexInfo) {}
dropIndex(ix: IndexInfo) {
this.put('^drop ^index %i', ix.constraintName);
if (this.dialect.dropIndexContainsTableSpec) {
this.put(' ^on %f', ix);
}
this.endCommand();
}
createIndex(ix: IndexInfo) {
this.put('^create');
if (ix.indexType) this.put(' %k', ix.indexType);
if (ix.isUnique) this.put(' ^unique');
this.put(' ^index %i &n^on %f (&>&n', ix.constraintName, ix);
this.putCollection(',&n', ix.columns, col => {
this.put('%i %k', col.columnName, col.isDescending == true ? 'DESC' : 'ASC');
});
this.put('&<&n)');
this.endCommand();
}
dropUnique(uq: UniqueInfo) {
this.dropConstraintCore(uq);