Warning "No default value" despite using migration script
mfearby
Posts: 24
This is my first attempt at a migration script, and my scenario is exactly the one documented here: http://documentation.red-gate.com/display/SOC3/Worked+example+-+deploying+with+migration+scripts, that is, adding a column that doesn't allow nulls.
So I followed the guide faithfully and now that I'm checking in my changes, SQL Source Control 3.6.3.149 is still warning me as follows:
Severity: High
Object: tbMyTable
Title: The column [field_type] on table [dbo].[tbMyTable] must be added but has no default and does not allow NULL values. The table must be rebuilt. If the table contains data then the deployment script will fail.
Does this warning always show up, regardless of whether a migration script is present, or have I perhaps done something wrong? The guide makes no mention of this warning still being displayed.
So I followed the guide faithfully and now that I'm checking in my changes, SQL Source Control 3.6.3.149 is still warning me as follows:
Severity: High
Object: tbMyTable
Title: The column [field_type] on table [dbo].[tbMyTable] must be added but has no default and does not allow NULL values. The table must be rebuilt. If the table contains data then the deployment script will fail.
Does this warning always show up, regardless of whether a migration script is present, or have I perhaps done something wrong? The guide makes no mention of this warning still being displayed.
I don't always test my code, but when I do, I do it in production :-p
Comments
1 of 1 warning: Error retrieving migration scripts
The migration script was saved successfully to the repo because I did an SVN Update with TortoiseSVN on my computer and it brought down the new folder created especially for these scripts.
Now I am well and truly at a loss. I'll probably run my script customisations manually and just remove the allow nulls on the field afterwards, I guess. I'd still like to know why things are failing miserably. I don't think I'm asking too much of it :-) THanks.
http://documentation.red-gate.com/displ ... n+warnings
I do actually want to use a migration script, but it won't let me and won't tell me why. :-(
Severity: High
Title: An error occurred connecting to source control; migration scripts could not be retrieved.
If you do not want SQL Compare to try and retrieve migration scripts for future comparisons with this project, edit the project and
select the Ignore migration scripts for databases project option.
Severity: Low
Title: SQL Compare cannot verify database is identical to associated revision.
Damn, these migrations scripts don't seem like a good idea at all! :-(
And yes, I am aware that I appear to be talking to myself here!
I'm sorry you are having a problem with SQL Compare - it should tell you about the connection problem but it does not. There was a short-lived version of SQL Compare 10.5 that could not retrieve migration scripts, so consider upgrading if you are on that version.
I will reply to you via email with some debugging instructions to try to find the sepcific failure cause if you are on SQL Compare 10.7.
C:\Windows\System32\runas.exe /user:my_domain\!other_account "M:\Program Files (x86)\Red Gate\SQL Compare 10\RedGate.SQLCompare.UI.exe"
We've decided that it's now more trouble than it's worth (not to mention I have to enter my credentials too often), and now that we've given my everyday account access to the production SQL Server, everything is OK :-)
Thanks.