When using Entity Framework 6 Code-First approach, can I create index directly from database?

891 Views Asked by At

I have a recommendation from Azure to create the following index:

CREATE NONCLUSTERED INDEX [nci_wi_Transactions_71EA7D20388C3F47A9B9EBF2A1C7BA0C] ON [dbo].[Transactions] ([Client_Id]) INCLUDE ([Date], [Description], [Size], [Type]) WITH (ONLINE = ON)

Is it possible to execute this SQL directly from MSSQL without affecting my applications work? Or do I need to apply some migrations from code-first to keep database context with the correct state anyway?

1

There are 1 best solutions below

0
arteny On

Actually, @Steve in comment answered and I checked in runtime and Yes, it is safe to create an index directly from a database, which will not affect applications, used not changed DbContext.