mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
ts fixes
This commit is contained in:
parent
3895c6bb47
commit
f572c05a32
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
4
packages/types/dumper.d.ts
vendored
4
packages/types/dumper.d.ts
vendored
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user