-
Notifications
You must be signed in to change notification settings - Fork 9
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
Database column: 'Allow Nulls' is not being changed during a migration #77
Comments
Hi @InteXX, Here is the project I used to do the tests. It uses version 6.0.7 of the official SqlServer provider. You can use the command The SQL script is generated by the database provider from the migration file. If the generated migration file looks correct, the problem may be with the provider. |
I'll give it another go. |
@InteXX Did you ever investigate this further? |
Due to time constraints, I did not. But I will try again to get to it soon. |
I am unsure as to whether this problem is within the scope of this library.
I generated a migration, not providing any configurations:
I ran
Update-Database
and ended up with a schema that looked like this:I then added a few configurations:
The new migration looks like this:
After running the migration, however, certain elements of the schema remained unchanged:
The default constraints were added as expected:
...but the 'Allow Nulls' and column length properties were not altered.
Here's the SQL code that ran during the second migration:
As we can see, the migration instructions for altering the column length and 'Allow Nulls' setting were not sent to the database.
I next undertook to separate the default constraint configurations into their own migration, and then the 'Allow Nulls' and column length configurations into a third migration. This time all schema updates were processed as expected:
Again, I am unsure as to whether this behavior is expected or whether this issue is within the scope of this library.
The text was updated successfully, but these errors were encountered: