Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

EF Core -> Split one Model into two

$
0
0

Hello,

I have an API that has one schema that references dbo. I need to make 2 different APIs that will be two new schemas now and remove all tables from dbo.

I also need to remove about 5 tables/a couple of fields 100% from the model and database forever.

I have one ContextModel.cs and one ContextModelSnapshot.

I need to move all the tables into dbo into 2 new schemas.

The two new APIs/Schemas are: CORE API and MAIN API.

The Entities/Classes and Entities/Models are the same in both APIs.

I now need to remove X tables from CORE API and X tables from MAIN API.

Do I just work on one (CORE) API, delete the necessary items that need to be removed, and then run add-migration to get what truly needs to be deleted on the first API -> meaning keep what is in the UP()?

Then delete all the tables that are in the other API (MAIN) from the first API (CORE), run add-migration and just remove all the items from the Up() / Down() since those will still need to be in the other API/Database Schema?

Then do the same thing on the 2nd API (MAIN) -> remove all the tables that are in the 1st API (CORE), run add-migration, then delete everything from Up() / Down(). 

Then make a migration on both APIs that will move the tables from dbo to their necessary schemas (CORE/MAIN)?


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>