I suddenly felt into issue when schema which I have edited for table doesnt applied on server. Found that out when wrote seed script and it crashed: I've changed most fields to null so script inserts only NOT NULL values. But in runtime it crashes with 'Expected value in column, seems it is NOT NULL'.
Again,
- I have table modified to NULL for columns
- Wrote seed script against it
- asked for 'Publish'
- script fails since table schema still requires NOT NULL in most columns
I did:
- removed bin/obj,
- removed .refactorlog and .dbml so ended up with broken build since it requires .refactorlog.
Then I DROPed table. Still no changes detected! Since table doesnt exist I ran CREATE manually and seems any later (subsequently, afterwards) changes been detected.
So question is - what am I doing wrong? I thought SSDT will analyze static code against target schema. But seems not. I dont wanna run into such issue out of sudden I need bullet-proof schema migration.
Environment:
- VS 2017 15.6.6
- Sql Server EXPRESS 2014 (12.0.2000)
Found only this but it seems not my case (Hovewer, generated script sets SET ANSI_NULLS ON).
Much appreciate explanation of this issue!