If I run Perform on existing DB, profiler showing some odd queries, like this

ALTER TABLE [dbo].[Entity] DROP CONSTRAINT [FK_Entity_Field_Entity2];


EXEC sp_rename '[DB].[dbo].[Entity].[Field_Id]', 'TempField_Id', 'COLUMN';
ALTER TABLE [dbo].[Entity] ADD [Field_Id] uniqueidentifier;
UPDATE [dbo].[Entity] SET [Field_Id] = CAST([Entity].[TempField_Id]  AS uniqueidentifier);
CREATE INDEX [Entity1_FK_Entity2] ON [dbo].[Entity] ([Field_Id] ASC);

and finally

ALTER TABLE [dbo].[Entity] DROP CONSTRAINT [DF__Entity__FileVers__023D5A04];
ALTER TABLE [dbo].[Entity] DROP COLUMN [Field_Id];

Similar queries execute for many (all) linked fields and fields included in custom indexes

It seems that DO drop/create all indexed fields and rebuild all indexes


asked Apr 02 '14 at 08:26

Anton%20Guschin's gravatar image

Anton Guschin

Hello Anton, it seems that due to some reason DO considers this column was changed. This leads to recreation of related indexes and constraints on this column. If you can provide some model snippet causing this behavior we'll definitely investigate that.

(Apr 02 '14 at 08:47) Denis Krjuchkov Denis%20Krjuchkov's gravatar image

Thx I'll try repeate it in test application

(Apr 03 '14 at 01:22) Anton Guschin Anton%20Guschin's gravatar image
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA