7 changed files with 758 additions and 2 deletions
@ -0,0 +1,208 @@ |
|||||
|
// <auto-generated />
|
||||
|
using System; |
||||
|
using BaseService.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore.Infrastructure; |
||||
|
using Microsoft.EntityFrameworkCore.Metadata; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
|
||||
|
namespace BaseService.Migrations |
||||
|
{ |
||||
|
[DbContext(typeof(BaseServiceDbContext))] |
||||
|
[Migration("20230822033456_202308220001")] |
||||
|
partial class _202308220001 |
||||
|
{ |
||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
||||
|
{ |
||||
|
#pragma warning disable 612, 618
|
||||
|
modelBuilder |
||||
|
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) |
||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128) |
||||
|
.HasAnnotation("ProductVersion", "5.0.17") |
||||
|
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); |
||||
|
|
||||
|
modelBuilder.Entity("BaseService.BaseData.Branch", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.Property<string>("CascadeId") |
||||
|
.HasColumnType("nvarchar(max)"); |
||||
|
|
||||
|
b.Property<short>("CategoryId") |
||||
|
.HasColumnType("smallint"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("nvarchar(40)") |
||||
|
.HasColumnName("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime2") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("uniqueidentifier") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<bool>("Enabled") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("bit") |
||||
|
.HasDefaultValue(false); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("nvarchar(max)") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<string>("FullName") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(128) |
||||
|
.HasColumnType("nvarchar(128)"); |
||||
|
|
||||
|
b.Property<bool>("IsDeleted") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("bit") |
||||
|
.HasDefaultValue(false) |
||||
|
.HasColumnName("IsDeleted"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnType("datetime2") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnType("uniqueidentifier") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<bool>("Leaf") |
||||
|
.HasColumnType("bit"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(50) |
||||
|
.HasColumnType("nvarchar(50)"); |
||||
|
|
||||
|
b.Property<Guid?>("Pid") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.Property<int>("Sort") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("Pid"); |
||||
|
|
||||
|
b.ToTable("base_branches"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("BaseService.BaseData.UserBranch", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.Property<Guid>("BranchId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("nvarchar(40)") |
||||
|
.HasColumnName("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime2") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("uniqueidentifier") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("nvarchar(max)") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnType("datetime2") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnType("uniqueidentifier") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<Guid>("UserId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.ToTable("base_user_branches"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("BaseService.RelationBaseData.BranchRole", b => |
||||
|
{ |
||||
|
b.Property<Guid>("BranchId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.Property<Guid>("RoleId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime2") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("uniqueidentifier") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.HasKey("BranchId", "RoleId"); |
||||
|
|
||||
|
b.ToTable("base_branch_role"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("BaseService.BaseData.UserBranch", b => |
||||
|
{ |
||||
|
b.OwnsMany("BaseService.BaseData.UserBranchRole", "Roles", b1 => |
||||
|
{ |
||||
|
b1.Property<Guid>("UserBranchId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b1.Property<int>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("int") |
||||
|
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); |
||||
|
|
||||
|
b1.Property<Guid>("RoleId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b1.HasKey("UserBranchId", "Id"); |
||||
|
|
||||
|
b1.ToTable("base_user_branch_role"); |
||||
|
|
||||
|
b1.WithOwner() |
||||
|
.HasForeignKey("UserBranchId"); |
||||
|
}); |
||||
|
|
||||
|
b.Navigation("Roles"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("BaseService.RelationBaseData.BranchRole", b => |
||||
|
{ |
||||
|
b.HasOne("BaseService.BaseData.Branch", null) |
||||
|
.WithMany("Roles") |
||||
|
.HasForeignKey("BranchId") |
||||
|
.OnDelete(DeleteBehavior.Cascade) |
||||
|
.IsRequired(); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("BaseService.BaseData.Branch", b => |
||||
|
{ |
||||
|
b.Navigation("Roles"); |
||||
|
}); |
||||
|
#pragma warning restore 612, 618
|
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,117 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
namespace BaseService.Migrations |
||||
|
{ |
||||
|
public partial class _202308220001 : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "base_branches", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
CategoryId = table.Column<short>(type: "smallint", nullable: false), |
||||
|
Pid = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false), |
||||
|
FullName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false), |
||||
|
Sort = table.Column<int>(type: "int", nullable: false), |
||||
|
Leaf = table.Column<bool>(type: "bit", nullable: false), |
||||
|
CascadeId = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
Enabled = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
||||
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
||||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true), |
||||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), |
||||
|
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_base_branches", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "base_user_branches", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true), |
||||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), |
||||
|
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_base_user_branches", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "base_branch_role", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_base_branch_role", x => new { x.BranchId, x.RoleId }); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_base_branch_role_base_branches_BranchId", |
||||
|
column: x => x.BranchId, |
||||
|
principalTable: "base_branches", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "base_user_branch_role", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
UserBranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
Id = table.Column<int>(type: "int", nullable: false) |
||||
|
.Annotation("SqlServer:Identity", "1, 1"), |
||||
|
RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_base_user_branch_role", x => new { x.UserBranchId, x.Id }); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_base_user_branch_role_base_user_branches_UserBranchId", |
||||
|
column: x => x.UserBranchId, |
||||
|
principalTable: "base_user_branches", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_base_branches_Pid", |
||||
|
table: "base_branches", |
||||
|
column: "Pid"); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropTable( |
||||
|
name: "base_branch_role"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "base_user_branch_role"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "base_branches"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "base_user_branches"); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,208 @@ |
|||||
|
// <auto-generated />
|
||||
|
using System; |
||||
|
using BaseService.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore.Infrastructure; |
||||
|
using Microsoft.EntityFrameworkCore.Metadata; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
|
||||
|
namespace BaseService.Migrations |
||||
|
{ |
||||
|
[DbContext(typeof(BaseServiceDbContext))] |
||||
|
[Migration("20230822034321_2023082200001")] |
||||
|
partial class _2023082200001 |
||||
|
{ |
||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
||||
|
{ |
||||
|
#pragma warning disable 612, 618
|
||||
|
modelBuilder |
||||
|
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) |
||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128) |
||||
|
.HasAnnotation("ProductVersion", "5.0.17") |
||||
|
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); |
||||
|
|
||||
|
modelBuilder.Entity("BaseService.BaseData.Branch", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.Property<string>("CascadeId") |
||||
|
.HasColumnType("nvarchar(max)"); |
||||
|
|
||||
|
b.Property<short>("CategoryId") |
||||
|
.HasColumnType("smallint"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("nvarchar(40)") |
||||
|
.HasColumnName("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime2") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("uniqueidentifier") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<bool>("Enabled") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("bit") |
||||
|
.HasDefaultValue(false); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("nvarchar(max)") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<string>("FullName") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(128) |
||||
|
.HasColumnType("nvarchar(128)"); |
||||
|
|
||||
|
b.Property<bool>("IsDeleted") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("bit") |
||||
|
.HasDefaultValue(false) |
||||
|
.HasColumnName("IsDeleted"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnType("datetime2") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnType("uniqueidentifier") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<bool>("Leaf") |
||||
|
.HasColumnType("bit"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(50) |
||||
|
.HasColumnType("nvarchar(50)"); |
||||
|
|
||||
|
b.Property<Guid?>("Pid") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.Property<int>("Sort") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("Pid"); |
||||
|
|
||||
|
b.ToTable("base_branches"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("BaseService.BaseData.UserBranch", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.Property<Guid>("BranchId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("nvarchar(40)") |
||||
|
.HasColumnName("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime2") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("uniqueidentifier") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("nvarchar(max)") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnType("datetime2") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnType("uniqueidentifier") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<Guid>("UserId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.ToTable("base_user_branches"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("BaseService.RelationBaseData.BranchRole", b => |
||||
|
{ |
||||
|
b.Property<Guid>("BranchId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.Property<Guid>("RoleId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime2") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("uniqueidentifier") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.HasKey("BranchId", "RoleId"); |
||||
|
|
||||
|
b.ToTable("base_branch_role"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("BaseService.BaseData.UserBranch", b => |
||||
|
{ |
||||
|
b.OwnsMany("BaseService.BaseData.UserBranchRole", "Roles", b1 => |
||||
|
{ |
||||
|
b1.Property<Guid>("UserBranchId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b1.Property<int>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("int") |
||||
|
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); |
||||
|
|
||||
|
b1.Property<Guid>("RoleId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b1.HasKey("UserBranchId", "Id"); |
||||
|
|
||||
|
b1.ToTable("base_user_branch_role"); |
||||
|
|
||||
|
b1.WithOwner() |
||||
|
.HasForeignKey("UserBranchId"); |
||||
|
}); |
||||
|
|
||||
|
b.Navigation("Roles"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("BaseService.RelationBaseData.BranchRole", b => |
||||
|
{ |
||||
|
b.HasOne("BaseService.BaseData.Branch", null) |
||||
|
.WithMany("Roles") |
||||
|
.HasForeignKey("BranchId") |
||||
|
.OnDelete(DeleteBehavior.Cascade) |
||||
|
.IsRequired(); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("BaseService.BaseData.Branch", b => |
||||
|
{ |
||||
|
b.Navigation("Roles"); |
||||
|
}); |
||||
|
#pragma warning restore 612, 618
|
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
namespace BaseService.Migrations |
||||
|
{ |
||||
|
public partial class _2023082200001 : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,206 @@ |
|||||
|
// <auto-generated />
|
||||
|
using System; |
||||
|
using BaseService.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore.Infrastructure; |
||||
|
using Microsoft.EntityFrameworkCore.Metadata; |
||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
|
||||
|
namespace BaseService.Migrations |
||||
|
{ |
||||
|
[DbContext(typeof(BaseServiceDbContext))] |
||||
|
partial class BaseServiceDbContextModelSnapshot : ModelSnapshot |
||||
|
{ |
||||
|
protected override void BuildModel(ModelBuilder modelBuilder) |
||||
|
{ |
||||
|
#pragma warning disable 612, 618
|
||||
|
modelBuilder |
||||
|
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) |
||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128) |
||||
|
.HasAnnotation("ProductVersion", "5.0.17") |
||||
|
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); |
||||
|
|
||||
|
modelBuilder.Entity("BaseService.BaseData.Branch", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.Property<string>("CascadeId") |
||||
|
.HasColumnType("nvarchar(max)"); |
||||
|
|
||||
|
b.Property<short>("CategoryId") |
||||
|
.HasColumnType("smallint"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("nvarchar(40)") |
||||
|
.HasColumnName("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime2") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("uniqueidentifier") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<bool>("Enabled") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("bit") |
||||
|
.HasDefaultValue(false); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("nvarchar(max)") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<string>("FullName") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(128) |
||||
|
.HasColumnType("nvarchar(128)"); |
||||
|
|
||||
|
b.Property<bool>("IsDeleted") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("bit") |
||||
|
.HasDefaultValue(false) |
||||
|
.HasColumnName("IsDeleted"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnType("datetime2") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnType("uniqueidentifier") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<bool>("Leaf") |
||||
|
.HasColumnType("bit"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(50) |
||||
|
.HasColumnType("nvarchar(50)"); |
||||
|
|
||||
|
b.Property<Guid?>("Pid") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.Property<int>("Sort") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("Pid"); |
||||
|
|
||||
|
b.ToTable("base_branches"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("BaseService.BaseData.UserBranch", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.Property<Guid>("BranchId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasMaxLength(40) |
||||
|
.HasColumnType("nvarchar(40)") |
||||
|
.HasColumnName("ConcurrencyStamp"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime2") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("uniqueidentifier") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnType("nvarchar(max)") |
||||
|
.HasColumnName("ExtraProperties"); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnType("datetime2") |
||||
|
.HasColumnName("LastModificationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnType("uniqueidentifier") |
||||
|
.HasColumnName("LastModifierId"); |
||||
|
|
||||
|
b.Property<Guid>("UserId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.ToTable("base_user_branches"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("BaseService.RelationBaseData.BranchRole", b => |
||||
|
{ |
||||
|
b.Property<Guid>("BranchId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.Property<Guid>("RoleId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnType("datetime2") |
||||
|
.HasColumnName("CreationTime"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnType("uniqueidentifier") |
||||
|
.HasColumnName("CreatorId"); |
||||
|
|
||||
|
b.HasKey("BranchId", "RoleId"); |
||||
|
|
||||
|
b.ToTable("base_branch_role"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("BaseService.BaseData.UserBranch", b => |
||||
|
{ |
||||
|
b.OwnsMany("BaseService.BaseData.UserBranchRole", "Roles", b1 => |
||||
|
{ |
||||
|
b1.Property<Guid>("UserBranchId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b1.Property<int>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("int") |
||||
|
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); |
||||
|
|
||||
|
b1.Property<Guid>("RoleId") |
||||
|
.HasColumnType("uniqueidentifier"); |
||||
|
|
||||
|
b1.HasKey("UserBranchId", "Id"); |
||||
|
|
||||
|
b1.ToTable("base_user_branch_role"); |
||||
|
|
||||
|
b1.WithOwner() |
||||
|
.HasForeignKey("UserBranchId"); |
||||
|
}); |
||||
|
|
||||
|
b.Navigation("Roles"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("BaseService.RelationBaseData.BranchRole", b => |
||||
|
{ |
||||
|
b.HasOne("BaseService.BaseData.Branch", null) |
||||
|
.WithMany("Roles") |
||||
|
.HasForeignKey("BranchId") |
||||
|
.OnDelete(DeleteBehavior.Cascade) |
||||
|
.IsRequired(); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("BaseService.BaseData.Branch", b => |
||||
|
{ |
||||
|
b.Navigation("Roles"); |
||||
|
}); |
||||
|
#pragma warning restore 612, 618
|
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue