79275774

Date: 2024-12-12 16:07:01
Score: 1.5
Natty:
Report link

Make all the necessary changes to the database

Alter table t add column id2 not null default 0;

update t set id2=id;

delete all foreign keys constraints;

alter table drop constraint tpk;

alter table drop column id;

sp_rename 'table.id2','id','COLUMN'

alter table add constraint tpk primary key (id);

recreate all foreign keys constraints;

Delete the identity annotation from the migration file in which this table was created

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Pablo Sanz