mirror of https://github.com/abpframework/abp.git
12 changed files with 327 additions and 8 deletions
@ -0,0 +1,113 @@ |
|||||
|
// <auto-generated />
|
||||
|
using AbpDesk.EntityFrameworkCore; |
||||
|
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; |
||||
|
|
||||
|
namespace AbpDesk.EntityFrameworkCore.Migrations |
||||
|
{ |
||||
|
[DbContext(typeof(AbpDeskDbContext))] |
||||
|
[Migration("20180218143334_Made_Permission_Entity_MultiTenant")] |
||||
|
partial class Made_Permission_Entity_MultiTenant |
||||
|
{ |
||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
||||
|
{ |
||||
|
#pragma warning disable 612, 618
|
||||
|
modelBuilder |
||||
|
.HasAnnotation("ProductVersion", "2.0.1-rtm-125") |
||||
|
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); |
||||
|
|
||||
|
modelBuilder.Entity("AbpDesk.Tickets.Ticket", b => |
||||
|
{ |
||||
|
b.Property<int>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<string>("Body") |
||||
|
.HasMaxLength(65536); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken(); |
||||
|
|
||||
|
b.Property<string>("Title") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.ToTable("DskTickets"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.MultiTenancy.Tenant", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("Name") |
||||
|
.IsUnique(); |
||||
|
|
||||
|
b.ToTable("MtTenants"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => |
||||
|
{ |
||||
|
b.Property<Guid>("TenantId"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.HasMaxLength(128); |
||||
|
|
||||
|
b.Property<string>("Value") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(1024); |
||||
|
|
||||
|
b.HasKey("TenantId", "Name"); |
||||
|
|
||||
|
b.ToTable("MtTenantConnectionStrings"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.Permissions.PermissionGrant", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(128); |
||||
|
|
||||
|
b.Property<string>("ProviderKey") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<string>("ProviderName") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("Name", "ProviderName", "ProviderKey"); |
||||
|
|
||||
|
b.ToTable("AbpPermissionGrants"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.MultiTenancy.TenantConnectionString", b => |
||||
|
{ |
||||
|
b.HasOne("Volo.Abp.MultiTenancy.Tenant") |
||||
|
.WithMany("ConnectionStrings") |
||||
|
.HasForeignKey("TenantId") |
||||
|
.OnDelete(DeleteBehavior.Cascade); |
||||
|
}); |
||||
|
#pragma warning restore 612, 618
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,24 @@ |
|||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
|
||||
|
namespace AbpDesk.EntityFrameworkCore.Migrations |
||||
|
{ |
||||
|
public partial class Made_Permission_Entity_MultiTenant : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.AddColumn<Guid>( |
||||
|
name: "TenantId", |
||||
|
table: "AbpPermissionGrants", |
||||
|
nullable: true); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropColumn( |
||||
|
name: "TenantId", |
||||
|
table: "AbpPermissionGrants"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,52 @@ |
|||||
|
// <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.Permissions.EntityFrameworkCore; |
||||
|
|
||||
|
namespace Volo.Abp.Permissions.EntityFrameworkCore.Migrations |
||||
|
{ |
||||
|
[DbContext(typeof(AbpPermissionsDbContext))] |
||||
|
[Migration("20180218143233_Made_Permission_Entity_MultiTenant")] |
||||
|
partial class Made_Permission_Entity_MultiTenant |
||||
|
{ |
||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
||||
|
{ |
||||
|
#pragma warning disable 612, 618
|
||||
|
modelBuilder |
||||
|
.HasAnnotation("ProductVersion", "2.0.1-rtm-125") |
||||
|
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.Permissions.PermissionGrant", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(128); |
||||
|
|
||||
|
b.Property<string>("ProviderKey") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<string>("ProviderName") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("Name", "ProviderName", "ProviderKey"); |
||||
|
|
||||
|
b.ToTable("AbpPermissionGrants"); |
||||
|
}); |
||||
|
#pragma warning restore 612, 618
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,38 @@ |
|||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
|
||||
|
namespace Volo.Abp.Permissions.EntityFrameworkCore.Migrations |
||||
|
{ |
||||
|
public partial class Made_Permission_Entity_MultiTenant : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpPermissionGrants", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(nullable: false), |
||||
|
Name = table.Column<string>(maxLength: 128, nullable: false), |
||||
|
ProviderKey = table.Column<string>(maxLength: 64, nullable: false), |
||||
|
ProviderName = table.Column<string>(maxLength: 64, nullable: false), |
||||
|
TenantId = table.Column<Guid>(nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey", |
||||
|
table: "AbpPermissionGrants", |
||||
|
columns: new[] { "Name", "ProviderName", "ProviderKey" }); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropTable( |
||||
|
name: "AbpPermissionGrants"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,51 @@ |
|||||
|
// <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.Permissions.EntityFrameworkCore; |
||||
|
|
||||
|
namespace Volo.Abp.Permissions.EntityFrameworkCore.Migrations |
||||
|
{ |
||||
|
[DbContext(typeof(AbpPermissionsDbContext))] |
||||
|
partial class AbpPermissionsDbContextModelSnapshot : ModelSnapshot |
||||
|
{ |
||||
|
protected override void BuildModel(ModelBuilder modelBuilder) |
||||
|
{ |
||||
|
#pragma warning disable 612, 618
|
||||
|
modelBuilder |
||||
|
.HasAnnotation("ProductVersion", "2.0.1-rtm-125") |
||||
|
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.Permissions.PermissionGrant", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd(); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(128); |
||||
|
|
||||
|
b.Property<string>("ProviderKey") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<string>("ProviderName") |
||||
|
.IsRequired() |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("Name", "ProviderName", "ProviderKey"); |
||||
|
|
||||
|
b.ToTable("AbpPermissionGrants"); |
||||
|
}); |
||||
|
#pragma warning restore 612, 618
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore.Design; |
||||
|
|
||||
|
namespace Volo.Abp.Permissions.EntityFrameworkCore |
||||
|
{ |
||||
|
/* This class is needed for EF Core command line tooling */ |
||||
|
|
||||
|
public class AbpPermissionsDbContextFactory : IDesignTimeDbContextFactory<AbpPermissionsDbContext> |
||||
|
{ |
||||
|
public AbpPermissionsDbContext CreateDbContext(string[] args) |
||||
|
{ |
||||
|
//TODO: Remove all SqlServer references from EFCore packages and find a way of creating factory inside this.
|
||||
|
var builder = new DbContextOptionsBuilder<AbpPermissionsDbContext>(); |
||||
|
builder.UseSqlServer("Server=localhost;Database=AbpDesk;Trusted_Connection=True;"); |
||||
|
return new AbpPermissionsDbContext(builder.Options); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue