How can we help you today? How can we help you today?

Build doesn't see schema changes

Hello,

I have the database called MyDB. In it I have a table MyDB.cfg.App_Module. I made a change in that table to add SecurityAdmin column. In the same changeset (I use TFS) I changed a stored proc to use SecurityAdmin column. When I ran it DLM Build give me this error:
[11:44:28][Step 1/3] WARNING: The error 'Invalid column name 'SecurityAdmin'.' occurred when 
[11:44:28][Step 1/3] executing the following SQL:
---
[11:44:28][Step 1/3]  SELECT 'ModuleList' AS RS_Type, ModuleId, ModuleDesc
[11:44:28][Step 1/3]  FROM MyDB.cfg.App_Module
[11:44:28][Step 1/3]  WHERE ModuleStatus = 2 AND SecurityAdmin = 2
[11:44:28][Step 1/3]  ORDER BY ModuleId


I checked that the same changeset has changes for the table and the stored proc. Here is log lines that confirms that the table was created before stored proc update.
[11:44:19][Step 1/3] VERBOSE: Creating [cfg].[X_App_Module]
[11:44:19][Step 1/3] VERBOSE: Creating primary key [PK_X_App_Module] on [cfg].[X_App_Module]


How to see the script that SQL Compare uses to update/validate DB? Where can I find source code of Invoke-DlmDatabaseSchemaValidation? What might be the source of the problem?
Daulet
0

Comments

3 comments

  • brucevanhorn2
    I know this doesn't help you, but I'm having the same problem. I have a very different setup though. In my case DLM is just ignoring my changes. I can see them in the octopus package (I use team city and octopus deploy) but it just breezes past the changes and says "There are no sql statements in the update script".
    brucevanhorn2
    0
  • Daulet
    I know this doesn't help you, but I'm having the same problem. I have a very different setup though. In my case DLM is just ignoring my changes. I can see them in the octopus package (I use team city and octopus deploy) but it just breezes past the changes and says "There are no sql statements in the update script".

    I had to merge schema change manually then I got schema error for DLM Sync. I removed IgnoreChecks from options and it helped for that case but I am not sure if it works for DLM Build.

    https://documentation.red-gate.com/display/SC12/Options+used+in+the+command+line#Optionsusedinthecommandline-IgnoreChecks
    Daulet
    0
  • Sergio R
    Hi Daulet,

    The best way to get the script would be to use SQL Compare Pro: you can then start a comparison between Source Control and an empty DB (which simulates the behavior of Invoke-DlmDatabaseSchemaValidation) and generate a script.

    For more information on this cmdlet please read http://documentation.red-gate.com/display/DLMA2/Invoke-DlmDatabaseSchemaValidation

    Thank you,
    Sergio R
    0

Add comment

Please sign in to leave a comment.