Skip to content

Commit

Permalink
Fix IsStored-related breaking changes to migrations builders
Browse files Browse the repository at this point in the history
  • Loading branch information
roji committed Jun 18, 2020
1 parent 211184c commit 3158fe6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
24 changes: 12 additions & 12 deletions src/EFCore.Relational/Migrations/MigrationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public MigrationBuilder([CanBeNull] string activeProvider)
/// <param name="defaultValue"> The default value for the column. </param>
/// <param name="defaultValueSql"> The SQL expression to use for the column's default constraint. </param>
/// <param name="computedColumnSql"> The SQL expression to use to compute the column value. </param>
/// <param name="stored"> Whether the value of the computed column is stored in the database or not. </param>
/// <param name="fixedLength"> Indicates whether or not the column is constrained to fixed-length data. </param>
/// <param name="comment"> A comment to associate with the column. </param>
/// <param name="collation"> A collation to apply to the column. </param>
Expand All @@ -69,6 +68,7 @@ public MigrationBuilder([CanBeNull] string activeProvider)
/// <param name="scale">
/// The maximum number of decimal places that is allowed in this column, or <see langword="null" /> if not specified or not applicable.
/// </param>
/// <param name="stored"> Whether the value of the computed column is stored in the database or not. </param>
/// <returns> A builder to allow annotations to be added to the operation. </returns>
public virtual OperationBuilder<AddColumnOperation> AddColumn<T>(
[NotNull] string name,
Expand All @@ -82,12 +82,12 @@ public virtual OperationBuilder<AddColumnOperation> AddColumn<T>(
[CanBeNull] object defaultValue = null,
[CanBeNull] string defaultValueSql = null,
[CanBeNull] string computedColumnSql = null,
bool? stored = null,
bool? fixedLength = null,
[CanBeNull] string comment = null,
[CanBeNull] string collation = null,
int? precision = null,
int? scale = null)
int? scale = null,
bool? stored = null)
{
Check.NotEmpty(name, nameof(name));
Check.NotEmpty(table, nameof(table));
Expand All @@ -106,12 +106,12 @@ public virtual OperationBuilder<AddColumnOperation> AddColumn<T>(
DefaultValue = defaultValue,
DefaultValueSql = defaultValueSql,
ComputedColumnSql = computedColumnSql,
IsStored = stored,
IsFixedLength = fixedLength,
Comment = comment,
Collation = collation,
Precision = precision,
Scale = scale,
IsStored = stored
};
Operations.Add(operation);

Expand Down Expand Up @@ -328,7 +328,6 @@ public virtual OperationBuilder<AddUniqueConstraintOperation> AddUniqueConstrain
/// <param name="defaultValue"> The default value for the column. </param>
/// <param name="defaultValueSql"> The SQL expression to use for the column's default constraint. </param>
/// <param name="computedColumnSql"> The SQL expression to use to compute the column value. </param>
/// <param name="stored"> Whether the value of the computed column is stored in the database or not. </param>
/// <param name="oldClrType">
/// The CLR type that the column was previously mapped to. Can be <see langword="null" />, in which case previous value is considered unknown.
/// </param>
Expand Down Expand Up @@ -359,7 +358,6 @@ public virtual OperationBuilder<AddUniqueConstraintOperation> AddUniqueConstrain
/// <param name="oldComputedColumnSql">
/// The previous SQL expression used to compute the column value. Can be <see langword="null" />, in which case previous value is considered unknown.
/// </param>
/// <param name="oldStored"> Whether the value of the previous computed column was stored in the database or not. </param>
/// <param name="fixedLength"> Indicates whether or not the column is constrained to fixed-length data. </param>
/// <param name="oldFixedLength"> Indicates whether or not the column was previously constrained to fixed-length data. </param>
/// <param name="comment"> A comment to associate with the column. </param>
Expand All @@ -378,6 +376,8 @@ public virtual OperationBuilder<AddUniqueConstraintOperation> AddUniqueConstrain
/// <param name="oldScale">
/// The previous maximum number of decimal places that is allowed in this column, or <see langword="null" /> if not specified or not applicable.
/// </param>
/// <param name="stored"> Whether the value of the computed column is stored in the database or not. </param>
/// <param name="oldStored"> Whether the value of the previous computed column was stored in the database or not. </param>
/// <returns> A builder to allow annotations to be added to the operation. </returns>
public virtual AlterOperationBuilder<AlterColumnOperation> AlterColumn<T>(
[NotNull] string name,
Expand All @@ -391,7 +391,6 @@ public virtual AlterOperationBuilder<AlterColumnOperation> AlterColumn<T>(
[CanBeNull] object defaultValue = null,
[CanBeNull] string defaultValueSql = null,
[CanBeNull] string computedColumnSql = null,
bool? stored = null,
[CanBeNull] Type oldClrType = null,
[CanBeNull] string oldType = null,
bool? oldUnicode = null,
Expand All @@ -401,7 +400,6 @@ public virtual AlterOperationBuilder<AlterColumnOperation> AlterColumn<T>(
[CanBeNull] object oldDefaultValue = null,
[CanBeNull] string oldDefaultValueSql = null,
[CanBeNull] string oldComputedColumnSql = null,
bool? oldStored = null,
bool? fixedLength = null,
bool? oldFixedLength = null,
[CanBeNull] string comment = null,
Expand All @@ -411,7 +409,9 @@ public virtual AlterOperationBuilder<AlterColumnOperation> AlterColumn<T>(
int? precision = null,
int? oldPrecision = null,
int? scale = null,
int? oldScale = null)
int? oldScale = null,
bool? stored = null,
bool? oldStored = null)
{
Check.NotEmpty(name, nameof(name));
Check.NotEmpty(table, nameof(table));
Expand All @@ -430,12 +430,12 @@ public virtual AlterOperationBuilder<AlterColumnOperation> AlterColumn<T>(
DefaultValue = defaultValue,
DefaultValueSql = defaultValueSql,
ComputedColumnSql = computedColumnSql,
IsStored = stored,
IsFixedLength = fixedLength,
Comment = comment,
Collation = collation,
Precision = precision,
Scale = scale,
IsStored = stored,
OldColumn = new ColumnOperation
{
ClrType = oldClrType ?? typeof(T),
Expand All @@ -447,12 +447,12 @@ public virtual AlterOperationBuilder<AlterColumnOperation> AlterColumn<T>(
DefaultValue = oldDefaultValue,
DefaultValueSql = oldDefaultValueSql,
ComputedColumnSql = oldComputedColumnSql,
IsStored = oldStored,
IsFixedLength = oldFixedLength,
Comment = oldComment,
Collation = oldCollation,
Precision = oldPrecision,
Scale = oldScale
Scale = oldScale,
IsStored = oldStored
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ public ColumnsBuilder([NotNull] CreateTableOperation createTableOperation)
/// <param name="defaultValue"> The default value for the column. </param>
/// <param name="defaultValueSql"> The SQL expression to use for the column's default constraint. </param>
/// <param name="computedColumnSql"> The SQL expression to use to compute the column value. </param>
/// <param name="stored"> Whether the value of the computed column is stored in the database or not. </param>
/// <param name="fixedLength"> Indicates whether or not the column is constrained to fixed-length data. </param>
/// <param name="comment"> A comment to be applied to the column. </param>
/// <param name="collation"> A collation to be applied to the column. </param>
/// <param name="precision"> The maximum number of digits for data in the column. </param>
/// <param name="scale"> The maximum number of decimal places for data in the column. </param>
/// <param name="stored"> Whether the value of the computed column is stored in the database or not. </param>
/// <returns> The same builder so that multiple calls can be chained. </returns>
public virtual OperationBuilder<AddColumnOperation> Column<T>(
[CanBeNull] string type = null,
Expand All @@ -60,12 +60,12 @@ public virtual OperationBuilder<AddColumnOperation> Column<T>(
[CanBeNull] object defaultValue = null,
[CanBeNull] string defaultValueSql = null,
[CanBeNull] string computedColumnSql = null,
bool? stored = null,
bool? fixedLength = null,
[CanBeNull] string comment = null,
[CanBeNull] string collation = null,
int? precision = null,
int? scale = null)
int? scale = null,
bool? stored = null)
{
var operation = new AddColumnOperation
{
Expand All @@ -81,12 +81,12 @@ public virtual OperationBuilder<AddColumnOperation> Column<T>(
DefaultValue = defaultValue,
DefaultValueSql = defaultValueSql,
ComputedColumnSql = computedColumnSql,
IsStored = stored,
IsFixedLength = fixedLength,
Comment = comment,
Collation = collation,
Precision = precision,
Scale = scale
Scale = scale,
IsStored = stored
};
_createTableOperation.Columns.Add(operation);

Expand Down

0 comments on commit 3158fe6

Please sign in to comment.