import { XObjectName, ExecutableStatement } from '../core'; import { ColumnSchema, ConstraintSchema, DatabaseSchema, ForeignKeySchema, IndexSchema, PrimaryKeySchema, SequenceSchema, TableSchema } from '../orm'; import { ObjectDifference } from './compare'; import { SchemaComparator } from './schema-comparator'; export declare abstract class MigrateScripter { private comparator; constructor(comparator: SchemaComparator); protected beforeCodes: T[]; protected afterCodes: T[]; protected middleCodes: T[]; protected seedDataCodes: Map; clear(): void; /** * 生成迁移代码 */ migrate(defaultSchema: string, source: DatabaseSchema | undefined, target: DatabaseSchema | undefined): void; getScripts(): T[]; abstract insertSeedData(table: TableSchema, data: any[]): void; abstract createIndex(table: XObjectName, index: IndexSchema): void; abstract dropIndex(table: XObjectName, name: string): void; abstract addForeignKey(table: XObjectName, fk: ForeignKeySchema): void; abstract dropForeignKey(table: XObjectName, name: string): void; abstract commentColumn(table: XObjectName, name: string, comment?: string): void; abstract commentTable(table: XObjectName, comment?: string): void; abstract commentIndex(table: XObjectName, name: string, comment?: string): void; abstract commentConstraint(table: XObjectName, name: string, comment?: string): void; abstract commentForeignKey(table: XObjectName, name: string, comment?: string): void; abstract setDefaultValue(table: XObjectName, column: string, defaultValue: string): void; abstract dropDefaultValue(table: XObjectName, column: string): void; abstract setAutoRowflag(table: XObjectName, column: string): void; abstract dropAutoRowflag(table: XObjectName, column: string): void; abstract dropIdentity(table: XObjectName, column: string): void; abstract setIdentity(table: XObjectName, column: string, start: number, increment: number): void; abstract createTable(table: TableSchema): void; createTableAndMembers(table: TableSchema): void; alterTableAndMembers(tableChanges: ObjectDifference): void; abstract dropTable(table: TableSchema): void; dropTableAndMembers(table: TableSchema): void; abstract annotation(note: string): void; abstract createSequence(sequence: SequenceSchema): void; abstract dropSequence(name: XObjectName): void; abstract addColumn(table: XObjectName, schema: ColumnSchema): void; abstract dropColumn(table: XObjectName, name: string): void; abstract alterColumn(table: XObjectName, column: ColumnSchema): void; abstract addPrimaryKey(table: XObjectName, pk: PrimaryKeySchema): void; abstract dropPrimaryKey(table: XObjectName, name: string): void; abstract addConstraint(table: XObjectName, constraint: ConstraintSchema): void; abstract dropConstraint(table: XObjectName, constraint: ConstraintSchema): void; }