dotnet / dotnet/efcore

Open up MigrationHistoryTable's model building for provider extensibility (or rethink the design)

Open
#34,991 1 comment 0 reactions 0 assignees View on GitHub
area-migrations consider-for-next-release customer-reported
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

MigrationHistoryTable constructs a mini-model in order to generate the migration command for the creation of the history table in the database ([code](https://github.com/dotnet/efcore/blob/main/src/EFCore.Relational/Migrations/HistoryRepository.cs#L94)). It removes some specific conventions in order to avoid creating other tables at that point (only the migration history table).

The problem is, providers may have their own conventions which add things to the database. For example, Npgsql has conventions which create database extensions, enums, and possibly collations - all these operations shouldn't happen at this point (where all we want is to create the history table); this is the cause of https://github.com/npgsql/efcore.pg/issues/3324. But the code that generates the model - and selectively removes the conventions - is private.

We should open this up for extensibility, or possibly rethink the design here.

/cc @AndriySvyryd

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.