From f572c05a32d9bada577b107d127ff81d244c59e6 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Mon, 6 Sep 2021 18:42:01 +0200 Subject: [PATCH] ts fixes --- packages/tools/src/SqlDumper.ts | 3 ++- packages/tools/src/diffTools.ts | 2 +- packages/types/dumper.d.ts | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/tools/src/SqlDumper.ts b/packages/tools/src/SqlDumper.ts index 3e3a08f0..ac55e716 100644 --- a/packages/tools/src/SqlDumper.ts +++ b/packages/tools/src/SqlDumper.ts @@ -229,7 +229,7 @@ export class SqlDumper implements AlterProcessor { table.primaryKey.columns.map(x => x.columnName) ); } - + (table.foreignKeys || []).forEach(fk => { this.put(',&n'); this.createForeignKeyFore(fk); @@ -387,6 +387,7 @@ export class SqlDumper implements AlterProcessor { break; } } + changeConstraint(oldConstraint: ConstraintInfo, newConstraint: ConstraintInfo) {} dropForeignKey(fk: ForeignKeyInfo) { if (this.dialect.explicitDropConstraint) { this.putCmd('^alter ^table %f ^drop ^foreign ^key %i', fk, fk.constraintName); diff --git a/packages/tools/src/diffTools.ts b/packages/tools/src/diffTools.ts index 5cdc737f..9a1c3955 100644 --- a/packages/tools/src/diffTools.ts +++ b/packages/tools/src/diffTools.ts @@ -294,6 +294,6 @@ export function getAlterTableScript( ): string { const plan = createAlterTablePlan(oldTable, newTable, opts, db, driver); const dmp = driver.createDumper(); - plan.run(dmp); + plan.run(dmp ); return dmp.s; } diff --git a/packages/types/dumper.d.ts b/packages/types/dumper.d.ts index 4e031efc..a439deb4 100644 --- a/packages/types/dumper.d.ts +++ b/packages/types/dumper.d.ts @@ -1,9 +1,10 @@ +import { AlterProcessor } from './alter-processor'; import { TableInfo } from './dbinfo'; import { SqlDialect } from './dialect'; export type TransformType = 'GROUP:YEAR' | 'GROUP:MONTH' | 'GROUP:DAY' | 'YEAR' | 'MONTH' | 'DAY'; // | 'GROUP:HOUR' | 'GROUP:MINUTE'; -export interface SqlDumper { +export interface SqlDumper extends AlterProcessor { s: string; dialect: SqlDialect; @@ -15,6 +16,5 @@ export interface SqlDumper { transform(type: TransformType, dumpExpr: () => void); endCommand(); - createTable(table: TableInfo); allowIdentityInsert(table: NamedObjectInfo, allow: boolean); }