trying to add a new NETCore v3.6.2 project which will share the same database with a NET461 project v3.4 but confused/blocked on the EF migration as AbpUser NETCore of v3.6.2 added some new fields below while the NET461 abp of same version 3.6.2 doesn't have these fields.
what process should I follow to make the two projects work on same database?
I haven't tried it out on the following approach yet.
The most straight forward way will be upgrading the Abp.Zero packages to Abp.ZeroCore packages in your NET461 project.
e.g Abp.Zero -> Abp.ZerCore
Abp.Zero.EntityFramwork -> Abp.ZerCore.EntityFramework
Abp.Zero.EntityFramworkCore -> Abp.ZerCore.EntityFrameworkCore
Since netstandard2.0 is compatible with NET461, in theory, Abp.ZeroCore should be fine with net461 project.
OK I decided to upgrade the NET 461 project to Core and thus can use same version of abp database schema with Core project. Here's summary of what I have tired:
Current: NET461, Abp 3.4 + ModuleZero + EF
New: Core, Abp 3.8 + ModuleZero + EF Core
Challenge:
How:
Upgrade database schema from NET461 abp 3.8 to Core abp 3.8
a. download latest net461 template (3.8)
b. replace Abp.Zero with Abp.ZeroCore and Abp.EntityFramework with Abp.EntityFrameworkCore
c. change the MyProjectDBContext to inherits from AbpDbContext and put all module zero entities as DbSet in MyProjectDBContext.
d. Add-Migration to generate the migration file from NET461 abp 3.8 to Core abp 3.8
e. generate sql script of this migration and run against the Current project database
Migrate to EF Core from EF
a. download latest core template (3.8)
b. delete all migrations in the template
c. add entities from Current NET461 project to this Core project and DbSet in db context file.
d. Add-Migration to create the migration and the EF Core snapshot file
e. empty the Up and Down method in the migration file (as per https://docs.microsoft.com/en-us/ef/efcore-and-ef6/porting/port-code)
Move other code from Current NET461 to the new Core project
update AbpRoles set NormalizedName = UPPER(Name);
Most helpful comment
OK I decided to upgrade the NET 461 project to Core and thus can use same version of abp database schema with Core project. Here's summary of what I have tired:
Current: NET461, Abp 3.4 + ModuleZero + EF
New: Core, Abp 3.8 + ModuleZero + EF Core
Challenge:
How:
a. Upgrade nugets of current project to 3.8
b. Add-Migration and Update-Database
Upgrade database schema from NET461 abp 3.8 to Core abp 3.8
a. download latest net461 template (3.8)
b. replace Abp.Zero with Abp.ZeroCore and Abp.EntityFramework with Abp.EntityFrameworkCore
c. change the MyProjectDBContext to inherits from AbpDbContext and put all module zero entities as DbSet in MyProjectDBContext.
d. Add-Migration to generate the migration file from NET461 abp 3.8 to Core abp 3.8
e. generate sql script of this migration and run against the Current project database
Migrate to EF Core from EF
a. download latest core template (3.8)
b. delete all migrations in the template
c. add entities from Current NET461 project to this Core project and DbSet in db context file.
d. Add-Migration to create the migration and the EF Core snapshot file
e. empty the Up and Down method in the migration file (as per https://docs.microsoft.com/en-us/ef/efcore-and-ef6/porting/port-code)
Move other code from Current NET461 to the new Core project