I have code-based migration implementation in my project (Windows Form Application - Entity Framework 6)
. I want to change(update) Default Schema name
dynamically in Migration .resx
file.
What i tried from my side
Already tried with this things but not working when i want to set schema name different
i.e. Migration generated with Oracle database schema name PDBADMIN
and want to change PDBTEST
schema name in migration file dynamically. I set dynamic schema name at all place in Migration file also. But when migration executed with new database then all table created successfully except __MigrationHistory
.Because i found in Migration .resx
file have some fix default schema name. So, i want to resolve this with some dynamically change(update) default schema name in .resx
file.
Example code (Not works)
I manually replaced default schema name in .resx
file but not allow to apply same migration to another database in Oracle (After migration execute database permission revoked - You can not use that database with your project only when you want to use Oracle) .
base.OnModelCreating(modelBuilder); modelBuilder.HasDefaultSchema("Name");
Looking some good solutions to update migration file generated .resx default schema name dynamically through code and it will apply during migration execution.
Any help would be appreciated.
Thanks!