//private readonly IEnumerable<ForeignKeyRef> _foreignKeys; you won't be dropping the key usually, so there's really no need to drop dependent FKs internal DropColumn(ColumnRef columnRef, IDbConnection connection) : base(MergeObjectType.Column, MergeActionType.Delete, columnRef.ToString()) { _columnRef = columnRef; ForeignKeyRef fk; if (columnRef.IsForeignKey(connection, out fk)) { _dropFK = fk; } //_foreignKeys = GetReferencingForeignKeys(connection, columnRef.ObjectID); _cn = connection; }
public AlterColumn(ColumnRef newColumn, ColumnRef oldColumn) : base(MergeObjectType.Column, MergeActionType.Alter, $"{newColumn.ToString()}: {ColumnRef.CompareSyntaxes(oldColumn, newColumn)}", nameof(AlterColumn)) { _newColumn = newColumn; _oldColumn = oldColumn; _objectId = oldColumn.ObjectID; // this comes from GetSchemaColumns, so it has the ObjectID }
public RetypeColumn(ColumnRef fromSchemaColumn, ColumnRef toModelColumn) : base(MergeObjectType.Column, MergeActionType.Retype, $"{toModelColumn.ToString()}: {fromSchemaColumn.DataTypeComparison(toModelColumn)}") { _modelColumn = toModelColumn.PropertyInfo; }