Skip to content

Add extensions methods for the MigrationBuilder #8

@GillesTourreau

Description

@GillesTourreau

Creates a new package called PosInformatique.EntityFrameworkCore.Migrations to include the following extension methods:

public static OperationBuilder<SqlOperation> RenameForeignKey(this MigrationBuilder migrationBuilder, string name, string newName)
{
    return migrationBuilder.Sql($"EXECUTE sp_rename '{name}', '{newName}', 'OBJECT'");
}

public static OperationBuilder<SqlOperation> RenamePrimaryKey(this MigrationBuilder migrationBuilder, string name, string newName)
{
    return migrationBuilder.Sql($"EXECUTE sp_rename '{name}', '{newName}', 'OBJECT'");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions