Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrations: Add fluent overloads to specify column types for Insert/Update/Delete columns #21886

Closed
bricelam opened this issue Jul 31, 2020 · 1 comment · Fixed by #22346
Closed
Labels
area-migrations closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@bricelam
Copy link
Contributor

bricelam commented Jul 31, 2020

It's pretty ugly to perform CUD on OOB tables without these:

migrationBuilder.InsertData("MyTable", new[] { "Id", "MyColumn" }, new object[] { 1, 1 }).GetInfrastructure()
    .ColumnTypes = new[] { "int", "int" };

var operation = migrationBuilder.UpdateData("MyTable", "Id", 1, "MyColumn", 2).GetInfrastructure();
operation.KeyColumnTypes = new[] { "int" };
operation.ColumnTypes = new[] { "int" };

migrationBuilder.DeleteData("MyTable", "Id", 1).GetInfrastructure()
    .KeyColumnTypes = new[] { "int" };

Admittedly, Update gets a little prettier in VB.NET 😉

With migrationBuilder.UpdateData("MyTable", "Id", 1, "MyColumn", 2).GetInfrastructure()
    .KeyColumnTypes = { "int" }
    .ColumnTypes = { "int" }
End With
@ajcvickers ajcvickers added this to the Backlog milestone Aug 3, 2020
@AndriySvyryd AndriySvyryd self-assigned this Sep 1, 2020
@AndriySvyryd AndriySvyryd modified the milestones: Backlog, 5.0.0 Sep 1, 2020
AndriySvyryd added a commit that referenced this issue Sep 1, 2020
…oved column

Add fluent overloads to specify column types for Insert/Update/Delete operations

Fixes #21886
Fixes #22302
AndriySvyryd added a commit that referenced this issue Sep 1, 2020
…oved column

Add fluent overloads to specify column types for Insert/Update/Delete operations

Fixes #21886
Fixes #22302
@AndriySvyryd AndriySvyryd added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Sep 1, 2020
@AndriySvyryd AndriySvyryd removed their assignment Sep 1, 2020
@AndriySvyryd AndriySvyryd modified the milestones: 5.0.0, 5.0.0-rc1 Sep 1, 2020
AndriySvyryd added a commit that referenced this issue Sep 1, 2020
…oved column

Add fluent overloads to specify column types for Insert/Update/Delete operations

Fixes #21886
Fixes #22302
@ajcvickers ajcvickers modified the milestones: 5.0.0-rc1, 5.0.0 Nov 7, 2020
@fearhq
Copy link

fearhq commented Nov 26, 2020

It looks like the column type overload is ignored for InsertData

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-migrations closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants