An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

nuget.org : postgresql.efcore.automaticmigrations.npgsql

Enable automatic Entity Framework Core migrations for PostgreSQL databases without manual migration files. This package is specifically optimized for PostgreSQL with support for schemas, bytea storage, UUID extensions, and PostgreSQL-specific data types. How to use: /// Migrations Options public class DbMigrationsOptions { /// <summary> /// Allow auto migration with data lost /// </summary> public bool AutomaticMigrationDataLossAllowed { get; set; } = false; /// <summary> /// Enable to execute auto migration /// </summary> public bool AutomaticMigrationsEnabled { get; set; } = true; /// <summary> /// Drop all tables from database and recreate based on model snapshot. Useful in scenarios when the data is transient and can be dropped when the schema changes. For example during prototyping, in tests, or for local changes. /// </summary> public bool ResetDatabaseSchema { get; set; } = false; /// <summary> /// Allow to update snapshot.The key will pe replaced with value for each KeyValuePair /// </summary> public Dictionary<![CDATA[string, string]]> UpdateSnapshot { get; set; } = new Dictionary<![CDATA[string, string]]>; /// <summary> /// The schema of the table of migration table. If not specified, the model schema will be used /// </summary> public string Schema { get; set; } } Option 1 (using method): MigrateDatabaseToLatestVersion.Execute(context); MigrateDatabaseToLatestVersion.Execute(context, new DbMigrationsOptions { ResetDatabaseSchema = true }); Option 2 (using context extension) context.MigrateToLatestVersion(); context.MigrateToLatestVersion(new DbMigrationsOptions { ResetDatabaseSchema = true });

Registry - Source - JSON - codemeta.json
purl: pkg:nuget/postgresql.efcore.automaticmigrations.npgsql
Keywords: Automatic , Migrations , PostgreSQL , Npgsql , AutomaticMigrations , Entity , Framework , Core , Auto , AutoMigrations
License: MIT
Latest release: 3 months ago
First release: 3 months ago
Downloads: 817 total
Last synced: 26 days ago

    Loading...
    Readme
    Loading...