I have some issue with an Oracle database. When I run my Windows Forms application using Entity Framework 6 to apply all database related changes to the Oracle database, I get this error:
Automatic migrations that affect the location of the migrations history system table (such as default schema changes) are not supported.
Please use code-based migrations for operations that affect the location of the migrations history system table.
Oracle database version: "Oracle Database 18c Express Edition Release 18.0.0.0.0
- Production Version 18.4.0.0.0
"
I am using a code-first approach with auto migration enabled. This code first approach working perfectly when I connect to SQL Server database (note: SQL Server database connection only for cross check) but have this issue with Oracle.
What I tried from my side
I added code-based migration script i.e. Add-Migration CreateNewDB
and then applied this migration to Oracle database and it works.
But I want to auto-update the database and apply any changes to the Oracle database which is still not working automatically (auto migration). Currently I need to create a code-based migration and apply that to Oracle database every time.
Sample code on model create
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.HasDefaultSchema("PDBADMIN");
modelBuilder.Entity<ADHOCCHECK>()
.Property(e => e.sortrev)
.IsUnicode(false);
modelBuilder.Entity<ADHOCCONSTRAINT>()
.Property(e => e.fldtype)
.IsUnicode(false);
modelBuilder.Entity<ADHOCCONSTRAINT>()
.Property(e => e.fldstr1)
.IsUnicode(false);
}
Any help would be appreciated.
Thanks!