T/F?:Unresolved conflicts in RedGate Source Control create migration scripts that even drops tables!

We lost a chunk of data in our QA environment and that led to this repro:
Unresolved conflicts in RedGate Source Control create BAD migration scripts that even drops tables!

scenario: 
Table A has a schema conflict
I create a blank migration script and put in a data change for Table A.
I commit my change and push.

Result:
The .patch file has the table as not required, i.e. prepended with - .
When run, it drops the table.

Expected:
It should not let me commit if I have conflict on the table.

Can you confirm that this bug exists and can be reproduced on your side?
Tagged:

Answers

  • Hi @Sumanta

    Can you confirm the full version number of your SQL Source Control?

    We appreciate if you can come up with a reproduction and let us know the steps.
    Kind regards

    Tianjiao Li | Redgate Software
    Have you visited our Help Center?
  • SumantaSumanta Posts: 12 Bronze 1
    Unfortunately we have two versions of RedGate SQL Source Control (calling it RGSSC below) being used by devs. 6.1.8.7184 is one of them

    As per the repro steps we are fairly certain of the original repro steps as our workarounds to ask developers to ensure they have no unresolved conflicts in RGSSC before they create migration scripts is working so far.
  • SumantaSumanta Posts: 12 Bronze 1
    Thank you fo your help so far by the way @Tianjiao_Li

  • @Sumanta

    Thanks for your replies. I tried with the repo steps. SQL Source Control appears to allow me to commit a migration script for the table that is in conflict as well. However, it didn't drop the table and the migration script didn't do anything although it was committed successfully. I tested in 6.1.8 and 6.3.1.

    Please let me know if I'm missing anything. Thanks!

    Here is my test scripts:
    <div>CREATE TABLE [dbo].[foo]</div><div>(</div><div>[id] [int] NOT NULL,</div><div>[boo] [varchar] (1) COLLATE Latin1_General_CI_AS NOT NULL CONSTRAINT [DF_foo_boo] DEFAULT ('f')</div><div>) ON [PRIMARY]</div><div>GO</div><div><br></div><div>ALTER TABLE [dbo].[foo] ADD CONSTRAINT [id_PK] PRIMARY KEY CLUSTERED&nbsp; ([id]) ON [PRIMARY]</div><div>GO
    
    INSERT INTO dbo.foo ( id, boo )
    VALUES
     (
      1 -- id - int
     , a -- boo - varchar(1)
     )
    </div>
    -- migration script
    UPDATE foo
    SET  boo='b' 
    WHERE id=1;
    
    
    Kind regards

    Tianjiao Li | Redgate Software
    Have you visited our Help Center?
Sign In or Register to comment.