Is there an easy way to add a custom migration script to SQL Compare?

In my work, we are currently experiencing serious problems that push our database changes in different environments. The problem begins to appear when we create a new column with invalid values ​​in the existing table. The script that creates SQL Compare creates the column as invalid, so it always fails. I was hoping there is some alternative to manually editing the script. Is there any way around this? If not, how do you guys handle this?

+3
source share
3 answers

Create table:

create table #bingo ( id int )

Add value:

insert into #bingo values (1)

Add new column:

alter table #bingo add userid int

:

update #bingo set userid = 1 where id = 1

:

alter table #bingo alter column userid int not null

RedGate Sql Compare, .

0

NOT NULL? , SQL Compare , , .

DEFAULT, , , .

0

, , ? , .

0

Source: https://habr.com/ru/post/1708356/


All Articles