-
Notifications
You must be signed in to change notification settings - Fork 648
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
.PrimaryKey()
doesn't work on Alter.Table()
syntax root
#1438
Comments
.PrimaryKey()
doesn't work on Alter.Table()
syntax root
This came up for me recently. |
From a technical literal perspective, the reason this is an issue is that the tagless final interpreter GenericGenerator does not implement it but the interface suggests it's possible. From a technical SQL perspective, ANSI SQL, there is no direct analog for this because Primary keys cannot be nullable, so there is limited value in the standard providing syntax to add a column with primary key in one shot, given the table would have to have zero rows. From a technical Fluentmigrator perspective, it would be nice to:
From a human perspective, someone has to do the work and submit a PR. I'm not paid for my work here, and this is a relatively mild annoyance. |
Describe the bug
.PrimaryKey()
doesn't work onAlter.Table()
syntax root..PrimaryKey()
does work onCreate.Table()
syntax root.This probably doesn't come up very often, but in my scenario, I was fixing a table someone created using natural keys and making it use synthetic keys created via
IDENTITY
auto-incrementing values.SQL Server does support the underlying syntax to make this easy:
To Reproduce
This generates the following SQL in SQL Profiler:
Expected behavior
A clear and concise description of what you expected to happen.
Information (please complete the following information):
Additional context
Sample .targets file:
The text was updated successfully, but these errors were encountered: