-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extension point needed after applying migrations programmatically #17568
Milestone
Comments
Possibly covered by #24710 |
This can also be used for seeding. |
This was referenced May 16, 2024
The callback will be executed in a transaction, and it needs to be idempotent. |
AndriySvyryd
added
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
and removed
needs-design
labels
Jul 10, 2024
AndriySvyryd
removed
the
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
label
Aug 9, 2024
This was the proposed API for providers and extensions: public interface IMigratorPlugin
{
void Migrated(DbContext context, IMigratorData data);
Task MigratedAsync(DbContext context, IMigratorData data, CancellationToken cancellationToken = default(CancellationToken));
void Migrating(DbContext context, IMigratorData data);
Task MigratingAsync(DbContext context, IMigratorData data, CancellationToken cancellationToken = default(CancellationToken));
}
public interface IMigratorData
{
IReadOnlyList<Migration> AppliedMigrations { get; }
IReadOnlyList<Migration> RevertedMigrations { get; }
Migration TargetMigration { get; }
} However, we decided to revisit this when we have a better understanding of the provider and extension scenarios that this will enable. |
Note: this is needed in order to fix #33279 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Original issue: npgsql/efcore.pg#292
tl;dr PostgreSQL has extensions, which can be added via the regular migration process. However, since extensions can add database types, the ADO layer must be instructed to reload types.
EFCore.PG does this if the migration is applied when first creating a database, since RelationalDatabaseCreator is public. However, for users applying migrations programmatically (
context.Database.Migrate()
) this would currently require extending Migrator, which is an internal type.This is a non-critical issue - users can work around it by triggering type reloading themselves. Npgsql can also extend Migrator for now even though it's internal.
The text was updated successfully, but these errors were encountered: