Forum Stats

  • 3,767,914 Users
  • 2,252,729 Discussions


How to configure EFCore so it creates a schema (user with no login priviledges)?

Mike N
Mike N Member Posts: 16 Green Ribbon
edited Nov 11, 2019 3:24AM in Oracle Providers for ASP.NET

We're using schemas to separate the tables in the database. I'd like to from EF Core manage such tables.

I found a call `modelBuilder.HasDefaultSchema`, which seems to be applying the schema on all tables but the migration history, which is created under the login user (which is not too good, as different applications access the different parts of the database, and different users can release the same application). But if the user is not created upfront, the migration fails.

So, is it possible to instruct Oracle via EF Core to create the said schema/user?

And a bonus question - can one move the migration history table inside a schema?