Skip to content

When using SQL server replication when renaming a column the migration uses sp_rename which fails on db update. #37662

@sommmen

Description

@sommmen

What problem are you trying to solve?

Just had the following case:

Replication db setup in /prod/ not in /dev/ environment using mssql.
Applying the migration to /dev/ works but fails for /prod/ with the following message:

Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot rename the table because it is published for replication.

Describe the solution you'd like

I'd like to be able to mark my context as 'being replicated'.
Then migrations should not use the RenameColumn method in the generated migration.
It should either fault or generate an delete update.

Also a mention of this on the docs pages would be helpful:
https://learn.microsoft.com/en-us/ef/core/managing-schemas/migrations/managing?tabs=dotnet-core-cli#column-renames

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions