mirror of https://github.com/abpframework/abp.git
7 changed files with 102 additions and 8 deletions
@ -1,8 +0,0 @@ |
|||
using System; |
|||
|
|||
namespace Volo.Abp.EntityFrameworkCore.Tests.SecondContext |
|||
{ |
|||
public class Class1 |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,49 @@ |
|||
// <auto-generated />
|
|||
using Microsoft.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore.Infrastructure; |
|||
using Microsoft.EntityFrameworkCore.Metadata; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
using Microsoft.EntityFrameworkCore.Storage; |
|||
using Microsoft.EntityFrameworkCore.Storage.Internal; |
|||
using System; |
|||
using Volo.Abp.EntityFrameworkCore.TestApp.SecondContext; |
|||
|
|||
namespace Volo.Abp.EntityFrameworkCore.Tests.SecondContext.Migrations |
|||
{ |
|||
[DbContext(typeof(SecondDbContext))] |
|||
[Migration("20170927100405_Added_PhoneInSecondDbContext")] |
|||
partial class Added_PhoneInSecondDbContext |
|||
{ |
|||
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
|||
{ |
|||
#pragma warning disable 612, 618
|
|||
modelBuilder |
|||
.HasAnnotation("ProductVersion", "2.0.0-rtm-26452"); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.EntityFrameworkCore.TestApp.SecondContext.BookInSecondDbContext", b => |
|||
{ |
|||
b.Property<Guid>("Id") |
|||
.ValueGeneratedOnAdd(); |
|||
|
|||
b.Property<string>("Name"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.ToTable("Books"); |
|||
}); |
|||
|
|||
modelBuilder.Entity("Volo.Abp.EntityFrameworkCore.TestApp.SecondContext.PhoneInSecondDbContext", b => |
|||
{ |
|||
b.Property<long>("Id") |
|||
.ValueGeneratedOnAdd(); |
|||
|
|||
b.Property<string>("Number"); |
|||
|
|||
b.HasKey("Id"); |
|||
|
|||
b.ToTable("AppPhones"); |
|||
}); |
|||
#pragma warning restore 612, 618
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Volo.Abp.EntityFrameworkCore.Tests.SecondContext.Migrations |
|||
{ |
|||
public partial class Added_PhoneInSecondDbContext : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
/* SecondDbContext depends on TestAppDbContext, |
|||
so no need to add migration for phones since TestAppDbContext already contains it */ |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using Volo.Abp.Domain.Entities; |
|||
|
|||
namespace Volo.Abp.EntityFrameworkCore.TestApp.SecondContext |
|||
{ |
|||
[Table("AppPhones")] |
|||
public class PhoneInSecondDbContext : AggregateRoot<long> |
|||
{ |
|||
public virtual string Number { get; set; } |
|||
} |
|||
} |
|||
Loading…
Reference in new issue