mirror of https://github.com/abpframework/abp.git
107 changed files with 2929 additions and 3028 deletions
@ -1,500 +1,484 @@ |
|||||
using System; |
using System; |
||||
using Microsoft.EntityFrameworkCore.Migrations; |
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement.DemoApp.Migrations |
namespace Volo.Abp.SettingManagement.DemoApp.Migrations; |
||||
|
|
||||
|
public partial class init : Migration |
||||
{ |
{ |
||||
public partial class init : Migration |
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpClaimTypes", |
||||
|
columns: table => new { |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
Name = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
||||
|
Required = table.Column<bool>(type: "bit", nullable: false), |
||||
|
IsStatic = table.Column<bool>(type: "bit", nullable: false), |
||||
|
Regex = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true), |
||||
|
RegexDescription = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true), |
||||
|
Description = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), |
||||
|
ValueType = table.Column<int>(type: "int", nullable: false), |
||||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpLinkUsers", |
||||
|
columns: table => new { |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
SourceUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
SourceTenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
TargetUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
TargetTenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpLinkUsers", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpOrganizationUnits", |
||||
|
columns: table => new { |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
ParentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
Code = table.Column<string>(type: "nvarchar(95)", maxLength: 95, nullable: false), |
||||
|
DisplayName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, 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), |
||||
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
||||
|
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpOrganizationUnits", x => x.Id); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_AbpOrganizationUnits_AbpOrganizationUnits_ParentId", |
||||
|
column: x => x.ParentId, |
||||
|
principalTable: "AbpOrganizationUnits", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Restrict); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpPermissionGrants", |
||||
|
columns: table => new { |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false), |
||||
|
ProviderName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
||||
|
ProviderKey = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpRoles", |
||||
|
columns: table => new { |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
Name = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
||||
|
NormalizedName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
||||
|
IsDefault = table.Column<bool>(type: "bit", nullable: false), |
||||
|
IsStatic = table.Column<bool>(type: "bit", nullable: false), |
||||
|
IsPublic = table.Column<bool>(type: "bit", nullable: false), |
||||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpRoles", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpSecurityLogs", |
||||
|
columns: table => new { |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
ApplicationName = table.Column<string>(type: "nvarchar(96)", maxLength: 96, nullable: true), |
||||
|
Identity = table.Column<string>(type: "nvarchar(96)", maxLength: 96, nullable: true), |
||||
|
Action = table.Column<string>(type: "nvarchar(96)", maxLength: 96, nullable: true), |
||||
|
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), |
||||
|
TenantName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
ClientId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
CorrelationId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
ClientIpAddress = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
BrowserInfo = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true), |
||||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpSecurityLogs", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpSettings", |
||||
|
columns: table => new { |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false), |
||||
|
Value = table.Column<string>(type: "nvarchar(2048)", maxLength: 2048, nullable: false), |
||||
|
ProviderName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
ProviderKey = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpSettings", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpUsers", |
||||
|
columns: table => new { |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
||||
|
NormalizedUserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
||||
|
Name = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
Surname = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
Email = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
||||
|
NormalizedEmail = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
||||
|
EmailConfirmed = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
||||
|
PasswordHash = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), |
||||
|
SecurityStamp = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
||||
|
IsExternal = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
||||
|
PhoneNumber = table.Column<string>(type: "nvarchar(16)", maxLength: 16, nullable: true), |
||||
|
PhoneNumberConfirmed = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
||||
|
TwoFactorEnabled = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
||||
|
LockoutEnd = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true), |
||||
|
LockoutEnabled = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
||||
|
AccessFailedCount = table.Column<int>(type: "int", nullable: false, defaultValue: 0), |
||||
|
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), |
||||
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
||||
|
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpUsers", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpOrganizationUnitRoles", |
||||
|
columns: table => new { |
||||
|
RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
OrganizationUnitId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpOrganizationUnitRoles", x => new { x.OrganizationUnitId, x.RoleId }); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_AbpOrganizationUnitRoles_AbpOrganizationUnits_OrganizationUnitId", |
||||
|
column: x => x.OrganizationUnitId, |
||||
|
principalTable: "AbpOrganizationUnits", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_AbpOrganizationUnitRoles_AbpRoles_RoleId", |
||||
|
column: x => x.RoleId, |
||||
|
principalTable: "AbpRoles", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpRoleClaims", |
||||
|
columns: table => new { |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
ClaimType = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
||||
|
ClaimValue = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpRoleClaims", x => x.Id); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_AbpRoleClaims_AbpRoles_RoleId", |
||||
|
column: x => x.RoleId, |
||||
|
principalTable: "AbpRoles", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpUserClaims", |
||||
|
columns: table => new { |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
ClaimType = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
||||
|
ClaimValue = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpUserClaims", x => x.Id); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_AbpUserClaims_AbpUsers_UserId", |
||||
|
column: x => x.UserId, |
||||
|
principalTable: "AbpUsers", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpUserLogins", |
||||
|
columns: table => new { |
||||
|
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
LoginProvider = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
ProviderKey = table.Column<string>(type: "nvarchar(196)", maxLength: 196, nullable: false), |
||||
|
ProviderDisplayName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpUserLogins", x => new { x.UserId, x.LoginProvider }); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_AbpUserLogins_AbpUsers_UserId", |
||||
|
column: x => x.UserId, |
||||
|
principalTable: "AbpUsers", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpUserOrganizationUnits", |
||||
|
columns: table => new { |
||||
|
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
OrganizationUnitId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpUserOrganizationUnits", x => new { x.OrganizationUnitId, x.UserId }); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_AbpUserOrganizationUnits_AbpOrganizationUnits_OrganizationUnitId", |
||||
|
column: x => x.OrganizationUnitId, |
||||
|
principalTable: "AbpOrganizationUnits", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_AbpUserOrganizationUnits_AbpUsers_UserId", |
||||
|
column: x => x.UserId, |
||||
|
principalTable: "AbpUsers", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpUserRoles", |
||||
|
columns: table => new { |
||||
|
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpUserRoles", x => new { x.UserId, x.RoleId }); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_AbpUserRoles_AbpRoles_RoleId", |
||||
|
column: x => x.RoleId, |
||||
|
principalTable: "AbpRoles", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_AbpUserRoles_AbpUsers_UserId", |
||||
|
column: x => x.UserId, |
||||
|
principalTable: "AbpUsers", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpUserTokens", |
||||
|
columns: table => new { |
||||
|
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
LoginProvider = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
||||
|
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
Value = table.Column<string>(type: "nvarchar(max)", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_AbpUserTokens_AbpUsers_UserId", |
||||
|
column: x => x.UserId, |
||||
|
principalTable: "AbpUsers", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpLinkUsers_SourceUserId_SourceTenantId_TargetUserId_TargetTenantId", |
||||
|
table: "AbpLinkUsers", |
||||
|
columns: new[] { "SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId" }, |
||||
|
unique: true, |
||||
|
filter: "[SourceTenantId] IS NOT NULL AND [TargetTenantId] IS NOT NULL"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpOrganizationUnitRoles_RoleId_OrganizationUnitId", |
||||
|
table: "AbpOrganizationUnitRoles", |
||||
|
columns: new[] { "RoleId", "OrganizationUnitId" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpOrganizationUnits_Code", |
||||
|
table: "AbpOrganizationUnits", |
||||
|
column: "Code"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpOrganizationUnits_ParentId", |
||||
|
table: "AbpOrganizationUnits", |
||||
|
column: "ParentId"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey", |
||||
|
table: "AbpPermissionGrants", |
||||
|
columns: new[] { "Name", "ProviderName", "ProviderKey" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpRoleClaims_RoleId", |
||||
|
table: "AbpRoleClaims", |
||||
|
column: "RoleId"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpRoles_NormalizedName", |
||||
|
table: "AbpRoles", |
||||
|
column: "NormalizedName"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpSecurityLogs_TenantId_Action", |
||||
|
table: "AbpSecurityLogs", |
||||
|
columns: new[] { "TenantId", "Action" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpSecurityLogs_TenantId_ApplicationName", |
||||
|
table: "AbpSecurityLogs", |
||||
|
columns: new[] { "TenantId", "ApplicationName" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpSecurityLogs_TenantId_Identity", |
||||
|
table: "AbpSecurityLogs", |
||||
|
columns: new[] { "TenantId", "Identity" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpSecurityLogs_TenantId_UserId", |
||||
|
table: "AbpSecurityLogs", |
||||
|
columns: new[] { "TenantId", "UserId" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpSettings_Name_ProviderName_ProviderKey", |
||||
|
table: "AbpSettings", |
||||
|
columns: new[] { "Name", "ProviderName", "ProviderKey" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpUserClaims_UserId", |
||||
|
table: "AbpUserClaims", |
||||
|
column: "UserId"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpUserLogins_LoginProvider_ProviderKey", |
||||
|
table: "AbpUserLogins", |
||||
|
columns: new[] { "LoginProvider", "ProviderKey" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpUserOrganizationUnits_UserId_OrganizationUnitId", |
||||
|
table: "AbpUserOrganizationUnits", |
||||
|
columns: new[] { "UserId", "OrganizationUnitId" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpUserRoles_RoleId_UserId", |
||||
|
table: "AbpUserRoles", |
||||
|
columns: new[] { "RoleId", "UserId" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpUsers_Email", |
||||
|
table: "AbpUsers", |
||||
|
column: "Email"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpUsers_NormalizedEmail", |
||||
|
table: "AbpUsers", |
||||
|
column: "NormalizedEmail"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpUsers_NormalizedUserName", |
||||
|
table: "AbpUsers", |
||||
|
column: "NormalizedUserName"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpUsers_UserName", |
||||
|
table: "AbpUsers", |
||||
|
column: "UserName"); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
{ |
{ |
||||
protected override void Up(MigrationBuilder migrationBuilder) |
migrationBuilder.DropTable( |
||||
{ |
name: "AbpClaimTypes"); |
||||
migrationBuilder.CreateTable( |
|
||||
name: "AbpClaimTypes", |
migrationBuilder.DropTable( |
||||
columns: table => new |
name: "AbpLinkUsers"); |
||||
{ |
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
migrationBuilder.DropTable( |
||||
Name = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
name: "AbpOrganizationUnitRoles"); |
||||
Required = table.Column<bool>(type: "bit", nullable: false), |
|
||||
IsStatic = table.Column<bool>(type: "bit", nullable: false), |
migrationBuilder.DropTable( |
||||
Regex = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true), |
name: "AbpPermissionGrants"); |
||||
RegexDescription = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true), |
|
||||
Description = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), |
migrationBuilder.DropTable( |
||||
ValueType = table.Column<int>(type: "int", nullable: false), |
name: "AbpRoleClaims"); |
||||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|
||||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true) |
migrationBuilder.DropTable( |
||||
}, |
name: "AbpSecurityLogs"); |
||||
constraints: table => |
|
||||
{ |
migrationBuilder.DropTable( |
||||
table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); |
name: "AbpSettings"); |
||||
}); |
|
||||
|
migrationBuilder.DropTable( |
||||
migrationBuilder.CreateTable( |
name: "AbpUserClaims"); |
||||
name: "AbpLinkUsers", |
|
||||
columns: table => new |
migrationBuilder.DropTable( |
||||
{ |
name: "AbpUserLogins"); |
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
SourceUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
migrationBuilder.DropTable( |
||||
SourceTenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
name: "AbpUserOrganizationUnits"); |
||||
TargetUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
TargetTenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true) |
migrationBuilder.DropTable( |
||||
}, |
name: "AbpUserRoles"); |
||||
constraints: table => |
|
||||
{ |
|
||||
table.PrimaryKey("PK_AbpLinkUsers", x => x.Id); |
|
||||
}); |
|
||||
|
|
||||
migrationBuilder.CreateTable( |
|
||||
name: "AbpOrganizationUnits", |
|
||||
columns: table => new |
|
||||
{ |
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|
||||
ParentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|
||||
Code = table.Column<string>(type: "nvarchar(95)", maxLength: 95, nullable: false), |
|
||||
DisplayName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, 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), |
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
|
||||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true) |
|
||||
}, |
|
||||
constraints: table => |
|
||||
{ |
|
||||
table.PrimaryKey("PK_AbpOrganizationUnits", x => x.Id); |
|
||||
table.ForeignKey( |
|
||||
name: "FK_AbpOrganizationUnits_AbpOrganizationUnits_ParentId", |
|
||||
column: x => x.ParentId, |
|
||||
principalTable: "AbpOrganizationUnits", |
|
||||
principalColumn: "Id", |
|
||||
onDelete: ReferentialAction.Restrict); |
|
||||
}); |
|
||||
|
|
||||
migrationBuilder.CreateTable( |
|
||||
name: "AbpPermissionGrants", |
|
||||
columns: table => new |
|
||||
{ |
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|
||||
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false), |
|
||||
ProviderName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|
||||
ProviderKey = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false) |
|
||||
}, |
|
||||
constraints: table => |
|
||||
{ |
|
||||
table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); |
|
||||
}); |
|
||||
|
|
||||
migrationBuilder.CreateTable( |
|
||||
name: "AbpRoles", |
|
||||
columns: table => new |
|
||||
{ |
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|
||||
Name = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
|
||||
NormalizedName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
|
||||
IsDefault = table.Column<bool>(type: "bit", nullable: false), |
|
||||
IsStatic = table.Column<bool>(type: "bit", nullable: false), |
|
||||
IsPublic = table.Column<bool>(type: "bit", nullable: false), |
|
||||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|
||||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true) |
|
||||
}, |
|
||||
constraints: table => |
|
||||
{ |
|
||||
table.PrimaryKey("PK_AbpRoles", x => x.Id); |
|
||||
}); |
|
||||
|
|
||||
migrationBuilder.CreateTable( |
|
||||
name: "AbpSecurityLogs", |
|
||||
columns: table => new |
|
||||
{ |
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|
||||
ApplicationName = table.Column<string>(type: "nvarchar(96)", maxLength: 96, nullable: true), |
|
||||
Identity = table.Column<string>(type: "nvarchar(96)", maxLength: 96, nullable: true), |
|
||||
Action = table.Column<string>(type: "nvarchar(96)", maxLength: 96, nullable: true), |
|
||||
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|
||||
UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), |
|
||||
TenantName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|
||||
ClientId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|
||||
CorrelationId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|
||||
ClientIpAddress = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|
||||
BrowserInfo = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true), |
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
|
||||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|
||||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true) |
|
||||
}, |
|
||||
constraints: table => |
|
||||
{ |
|
||||
table.PrimaryKey("PK_AbpSecurityLogs", x => x.Id); |
|
||||
}); |
|
||||
|
|
||||
migrationBuilder.CreateTable( |
|
||||
name: "AbpSettings", |
|
||||
columns: table => new |
|
||||
{ |
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false), |
|
||||
Value = table.Column<string>(type: "nvarchar(2048)", maxLength: 2048, nullable: false), |
|
||||
ProviderName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|
||||
ProviderKey = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true) |
|
||||
}, |
|
||||
constraints: table => |
|
||||
{ |
|
||||
table.PrimaryKey("PK_AbpSettings", x => x.Id); |
|
||||
}); |
|
||||
|
|
||||
migrationBuilder.CreateTable( |
|
||||
name: "AbpUsers", |
|
||||
columns: table => new |
|
||||
{ |
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|
||||
UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
|
||||
NormalizedUserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
|
||||
Name = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|
||||
Surname = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|
||||
Email = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
|
||||
NormalizedEmail = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
|
||||
EmailConfirmed = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
|
||||
PasswordHash = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), |
|
||||
SecurityStamp = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
|
||||
IsExternal = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
|
||||
PhoneNumber = table.Column<string>(type: "nvarchar(16)", maxLength: 16, nullable: true), |
|
||||
PhoneNumberConfirmed = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
|
||||
TwoFactorEnabled = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
|
||||
LockoutEnd = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true), |
|
||||
LockoutEnabled = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
|
||||
AccessFailedCount = table.Column<int>(type: "int", nullable: false, defaultValue: 0), |
|
||||
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), |
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
|
||||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true) |
|
||||
}, |
|
||||
constraints: table => |
|
||||
{ |
|
||||
table.PrimaryKey("PK_AbpUsers", x => x.Id); |
|
||||
}); |
|
||||
|
|
||||
migrationBuilder.CreateTable( |
|
||||
name: "AbpOrganizationUnitRoles", |
|
||||
columns: table => new |
|
||||
{ |
|
||||
RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
OrganizationUnitId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true) |
|
||||
}, |
|
||||
constraints: table => |
|
||||
{ |
|
||||
table.PrimaryKey("PK_AbpOrganizationUnitRoles", x => new { x.OrganizationUnitId, x.RoleId }); |
|
||||
table.ForeignKey( |
|
||||
name: "FK_AbpOrganizationUnitRoles_AbpOrganizationUnits_OrganizationUnitId", |
|
||||
column: x => x.OrganizationUnitId, |
|
||||
principalTable: "AbpOrganizationUnits", |
|
||||
principalColumn: "Id", |
|
||||
onDelete: ReferentialAction.Cascade); |
|
||||
table.ForeignKey( |
|
||||
name: "FK_AbpOrganizationUnitRoles_AbpRoles_RoleId", |
|
||||
column: x => x.RoleId, |
|
||||
principalTable: "AbpRoles", |
|
||||
principalColumn: "Id", |
|
||||
onDelete: ReferentialAction.Cascade); |
|
||||
}); |
|
||||
|
|
||||
migrationBuilder.CreateTable( |
|
||||
name: "AbpRoleClaims", |
|
||||
columns: table => new |
|
||||
{ |
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|
||||
ClaimType = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
|
||||
ClaimValue = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: true) |
|
||||
}, |
|
||||
constraints: table => |
|
||||
{ |
|
||||
table.PrimaryKey("PK_AbpRoleClaims", x => x.Id); |
|
||||
table.ForeignKey( |
|
||||
name: "FK_AbpRoleClaims_AbpRoles_RoleId", |
|
||||
column: x => x.RoleId, |
|
||||
principalTable: "AbpRoles", |
|
||||
principalColumn: "Id", |
|
||||
onDelete: ReferentialAction.Cascade); |
|
||||
}); |
|
||||
|
|
||||
migrationBuilder.CreateTable( |
|
||||
name: "AbpUserClaims", |
|
||||
columns: table => new |
|
||||
{ |
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|
||||
ClaimType = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false), |
|
||||
ClaimValue = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: true) |
|
||||
}, |
|
||||
constraints: table => |
|
||||
{ |
|
||||
table.PrimaryKey("PK_AbpUserClaims", x => x.Id); |
|
||||
table.ForeignKey( |
|
||||
name: "FK_AbpUserClaims_AbpUsers_UserId", |
|
||||
column: x => x.UserId, |
|
||||
principalTable: "AbpUsers", |
|
||||
principalColumn: "Id", |
|
||||
onDelete: ReferentialAction.Cascade); |
|
||||
}); |
|
||||
|
|
||||
migrationBuilder.CreateTable( |
|
||||
name: "AbpUserLogins", |
|
||||
columns: table => new |
|
||||
{ |
|
||||
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
LoginProvider = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|
||||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|
||||
ProviderKey = table.Column<string>(type: "nvarchar(196)", maxLength: 196, nullable: false), |
|
||||
ProviderDisplayName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true) |
|
||||
}, |
|
||||
constraints: table => |
|
||||
{ |
|
||||
table.PrimaryKey("PK_AbpUserLogins", x => new { x.UserId, x.LoginProvider }); |
|
||||
table.ForeignKey( |
|
||||
name: "FK_AbpUserLogins_AbpUsers_UserId", |
|
||||
column: x => x.UserId, |
|
||||
principalTable: "AbpUsers", |
|
||||
principalColumn: "Id", |
|
||||
onDelete: ReferentialAction.Cascade); |
|
||||
}); |
|
||||
|
|
||||
migrationBuilder.CreateTable( |
|
||||
name: "AbpUserOrganizationUnits", |
|
||||
columns: table => new |
|
||||
{ |
|
||||
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
OrganizationUnitId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true) |
|
||||
}, |
|
||||
constraints: table => |
|
||||
{ |
|
||||
table.PrimaryKey("PK_AbpUserOrganizationUnits", x => new { x.OrganizationUnitId, x.UserId }); |
|
||||
table.ForeignKey( |
|
||||
name: "FK_AbpUserOrganizationUnits_AbpOrganizationUnits_OrganizationUnitId", |
|
||||
column: x => x.OrganizationUnitId, |
|
||||
principalTable: "AbpOrganizationUnits", |
|
||||
principalColumn: "Id", |
|
||||
onDelete: ReferentialAction.Cascade); |
|
||||
table.ForeignKey( |
|
||||
name: "FK_AbpUserOrganizationUnits_AbpUsers_UserId", |
|
||||
column: x => x.UserId, |
|
||||
principalTable: "AbpUsers", |
|
||||
principalColumn: "Id", |
|
||||
onDelete: ReferentialAction.Cascade); |
|
||||
}); |
|
||||
|
|
||||
migrationBuilder.CreateTable( |
|
||||
name: "AbpUserRoles", |
|
||||
columns: table => new |
|
||||
{ |
|
||||
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true) |
|
||||
}, |
|
||||
constraints: table => |
|
||||
{ |
|
||||
table.PrimaryKey("PK_AbpUserRoles", x => new { x.UserId, x.RoleId }); |
|
||||
table.ForeignKey( |
|
||||
name: "FK_AbpUserRoles_AbpRoles_RoleId", |
|
||||
column: x => x.RoleId, |
|
||||
principalTable: "AbpRoles", |
|
||||
principalColumn: "Id", |
|
||||
onDelete: ReferentialAction.Cascade); |
|
||||
table.ForeignKey( |
|
||||
name: "FK_AbpUserRoles_AbpUsers_UserId", |
|
||||
column: x => x.UserId, |
|
||||
principalTable: "AbpUsers", |
|
||||
principalColumn: "Id", |
|
||||
onDelete: ReferentialAction.Cascade); |
|
||||
}); |
|
||||
|
|
||||
migrationBuilder.CreateTable( |
|
||||
name: "AbpUserTokens", |
|
||||
columns: table => new |
|
||||
{ |
|
||||
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|
||||
LoginProvider = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|
||||
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false), |
|
||||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|
||||
Value = table.Column<string>(type: "nvarchar(max)", nullable: true) |
|
||||
}, |
|
||||
constraints: table => |
|
||||
{ |
|
||||
table.PrimaryKey("PK_AbpUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); |
|
||||
table.ForeignKey( |
|
||||
name: "FK_AbpUserTokens_AbpUsers_UserId", |
|
||||
column: x => x.UserId, |
|
||||
principalTable: "AbpUsers", |
|
||||
principalColumn: "Id", |
|
||||
onDelete: ReferentialAction.Cascade); |
|
||||
}); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpLinkUsers_SourceUserId_SourceTenantId_TargetUserId_TargetTenantId", |
|
||||
table: "AbpLinkUsers", |
|
||||
columns: new[] { "SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId" }, |
|
||||
unique: true, |
|
||||
filter: "[SourceTenantId] IS NOT NULL AND [TargetTenantId] IS NOT NULL"); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpOrganizationUnitRoles_RoleId_OrganizationUnitId", |
|
||||
table: "AbpOrganizationUnitRoles", |
|
||||
columns: new[] { "RoleId", "OrganizationUnitId" }); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpOrganizationUnits_Code", |
|
||||
table: "AbpOrganizationUnits", |
|
||||
column: "Code"); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpOrganizationUnits_ParentId", |
|
||||
table: "AbpOrganizationUnits", |
|
||||
column: "ParentId"); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey", |
|
||||
table: "AbpPermissionGrants", |
|
||||
columns: new[] { "Name", "ProviderName", "ProviderKey" }); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpRoleClaims_RoleId", |
|
||||
table: "AbpRoleClaims", |
|
||||
column: "RoleId"); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpRoles_NormalizedName", |
|
||||
table: "AbpRoles", |
|
||||
column: "NormalizedName"); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpSecurityLogs_TenantId_Action", |
|
||||
table: "AbpSecurityLogs", |
|
||||
columns: new[] { "TenantId", "Action" }); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpSecurityLogs_TenantId_ApplicationName", |
|
||||
table: "AbpSecurityLogs", |
|
||||
columns: new[] { "TenantId", "ApplicationName" }); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpSecurityLogs_TenantId_Identity", |
|
||||
table: "AbpSecurityLogs", |
|
||||
columns: new[] { "TenantId", "Identity" }); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpSecurityLogs_TenantId_UserId", |
|
||||
table: "AbpSecurityLogs", |
|
||||
columns: new[] { "TenantId", "UserId" }); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpSettings_Name_ProviderName_ProviderKey", |
|
||||
table: "AbpSettings", |
|
||||
columns: new[] { "Name", "ProviderName", "ProviderKey" }); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpUserClaims_UserId", |
|
||||
table: "AbpUserClaims", |
|
||||
column: "UserId"); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpUserLogins_LoginProvider_ProviderKey", |
|
||||
table: "AbpUserLogins", |
|
||||
columns: new[] { "LoginProvider", "ProviderKey" }); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpUserOrganizationUnits_UserId_OrganizationUnitId", |
|
||||
table: "AbpUserOrganizationUnits", |
|
||||
columns: new[] { "UserId", "OrganizationUnitId" }); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpUserRoles_RoleId_UserId", |
|
||||
table: "AbpUserRoles", |
|
||||
columns: new[] { "RoleId", "UserId" }); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpUsers_Email", |
|
||||
table: "AbpUsers", |
|
||||
column: "Email"); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpUsers_NormalizedEmail", |
|
||||
table: "AbpUsers", |
|
||||
column: "NormalizedEmail"); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpUsers_NormalizedUserName", |
|
||||
table: "AbpUsers", |
|
||||
column: "NormalizedUserName"); |
|
||||
|
|
||||
migrationBuilder.CreateIndex( |
|
||||
name: "IX_AbpUsers_UserName", |
|
||||
table: "AbpUsers", |
|
||||
column: "UserName"); |
|
||||
} |
|
||||
|
|
||||
protected override void Down(MigrationBuilder migrationBuilder) |
|
||||
{ |
|
||||
migrationBuilder.DropTable( |
|
||||
name: "AbpClaimTypes"); |
|
||||
|
|
||||
migrationBuilder.DropTable( |
|
||||
name: "AbpLinkUsers"); |
|
||||
|
|
||||
migrationBuilder.DropTable( |
|
||||
name: "AbpOrganizationUnitRoles"); |
|
||||
|
|
||||
migrationBuilder.DropTable( |
|
||||
name: "AbpPermissionGrants"); |
|
||||
|
|
||||
migrationBuilder.DropTable( |
|
||||
name: "AbpRoleClaims"); |
|
||||
|
|
||||
migrationBuilder.DropTable( |
|
||||
name: "AbpSecurityLogs"); |
|
||||
|
|
||||
migrationBuilder.DropTable( |
|
||||
name: "AbpSettings"); |
|
||||
|
|
||||
migrationBuilder.DropTable( |
|
||||
name: "AbpUserClaims"); |
|
||||
|
|
||||
migrationBuilder.DropTable( |
|
||||
name: "AbpUserLogins"); |
|
||||
|
|
||||
migrationBuilder.DropTable( |
migrationBuilder.DropTable( |
||||
name: "AbpUserOrganizationUnits"); |
name: "AbpUserTokens"); |
||||
|
|
||||
migrationBuilder.DropTable( |
|
||||
name: "AbpUserRoles"); |
|
||||
|
|
||||
migrationBuilder.DropTable( |
|
||||
name: "AbpUserTokens"); |
|
||||
|
|
||||
migrationBuilder.DropTable( |
migrationBuilder.DropTable( |
||||
name: "AbpOrganizationUnits"); |
name: "AbpOrganizationUnits"); |
||||
|
|
||||
migrationBuilder.DropTable( |
migrationBuilder.DropTable( |
||||
name: "AbpRoles"); |
name: "AbpRoles"); |
||||
|
|
||||
migrationBuilder.DropTable( |
migrationBuilder.DropTable( |
||||
name: "AbpUsers"); |
name: "AbpUsers"); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,11 +1,10 @@ |
|||||
using Microsoft.AspNetCore.Mvc.RazorPages; |
using Microsoft.AspNetCore.Mvc.RazorPages; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement.DemoApp.Pages |
namespace Volo.Abp.SettingManagement.DemoApp.Pages; |
||||
|
|
||||
|
public class IndexModel : PageModel |
||||
{ |
{ |
||||
public class IndexModel : PageModel |
public void OnGet() |
||||
{ |
{ |
||||
public void OnGet() |
|
||||
{ |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,23 +1,22 @@ |
|||||
namespace Volo.Abp.SettingManagement |
namespace Volo.Abp.SettingManagement; |
||||
|
|
||||
|
public class EmailSettingsDto |
||||
{ |
{ |
||||
public class EmailSettingsDto |
public string SmtpHost { get; set; } |
||||
{ |
|
||||
public string SmtpHost { get; set; } |
|
||||
|
|
||||
public int SmtpPort { get; set; } |
public int SmtpPort { get; set; } |
||||
|
|
||||
public string SmtpUserName { get; set; } |
public string SmtpUserName { get; set; } |
||||
|
|
||||
public string SmtpPassword { get; set; } |
public string SmtpPassword { get; set; } |
||||
|
|
||||
public string SmtpDomain { get; set; } |
public string SmtpDomain { get; set; } |
||||
|
|
||||
public bool SmtpEnableSsl { get; set; } |
public bool SmtpEnableSsl { get; set; } |
||||
|
|
||||
public bool SmtpUseDefaultCredentials { get; set; } |
public bool SmtpUseDefaultCredentials { get; set; } |
||||
|
|
||||
public string DefaultFromAddress { get; set; } |
public string DefaultFromAddress { get; set; } |
||||
|
|
||||
public string DefaultFromDisplayName { get; set; } |
public string DefaultFromDisplayName { get; set; } |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,12 +1,11 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using Volo.Abp.Application.Services; |
using Volo.Abp.Application.Services; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement |
namespace Volo.Abp.SettingManagement; |
||||
|
|
||||
|
public interface IEmailSettingsAppService : IApplicationService |
||||
{ |
{ |
||||
public interface IEmailSettingsAppService : IApplicationService |
Task<EmailSettingsDto> GetAsync(); |
||||
{ |
|
||||
Task<EmailSettingsDto> GetAsync(); |
|
||||
|
|
||||
Task UpdateAsync(UpdateEmailSettingsDto input); |
Task UpdateAsync(UpdateEmailSettingsDto input); |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,16 +1,15 @@ |
|||||
using Volo.Abp.Reflection; |
using Volo.Abp.Reflection; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement |
namespace Volo.Abp.SettingManagement; |
||||
|
|
||||
|
public class SettingManagementPermissions |
||||
{ |
{ |
||||
public class SettingManagementPermissions |
public const string GroupName = "SettingManagement"; |
||||
{ |
|
||||
public const string GroupName = "SettingManagement"; |
|
||||
|
|
||||
public const string Emailing = GroupName + ".Emailing"; |
public const string Emailing = GroupName + ".Emailing"; |
||||
|
|
||||
public static string[] GetAll() |
public static string[] GetAll() |
||||
{ |
{ |
||||
return ReflectionHelper.GetPublicConstantsRecursively(typeof(SettingManagementPermissions)); |
return ReflectionHelper.GetPublicConstantsRecursively(typeof(SettingManagementPermissions)); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,9 +1,8 @@ |
|||||
namespace Volo.Abp.SettingManagement |
namespace Volo.Abp.SettingManagement; |
||||
|
|
||||
|
public class SettingManagementRemoteServiceConsts |
||||
{ |
{ |
||||
public class SettingManagementRemoteServiceConsts |
public const string RemoteServiceName = "SettingManagement"; |
||||
{ |
|
||||
public const string RemoteServiceName = "SettingManagement"; |
|
||||
|
|
||||
public const string ModuleName = "settingManagement"; |
public const string ModuleName = "settingManagement"; |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,38 +1,37 @@ |
|||||
using System.ComponentModel.DataAnnotations; |
using System.ComponentModel.DataAnnotations; |
||||
using Volo.Abp.Auditing; |
using Volo.Abp.Auditing; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement |
namespace Volo.Abp.SettingManagement; |
||||
|
|
||||
|
public class UpdateEmailSettingsDto |
||||
{ |
{ |
||||
public class UpdateEmailSettingsDto |
[MaxLength(256)] |
||||
{ |
public string SmtpHost { get; set; } |
||||
[MaxLength(256)] |
|
||||
public string SmtpHost { get; set; } |
|
||||
|
|
||||
[Range(1, 65535)] |
[Range(1, 65535)] |
||||
public int SmtpPort { get; set; } |
public int SmtpPort { get; set; } |
||||
|
|
||||
[MaxLength(1024)] |
[MaxLength(1024)] |
||||
public string SmtpUserName { get; set; } |
public string SmtpUserName { get; set; } |
||||
|
|
||||
[MaxLength(1024)] |
[MaxLength(1024)] |
||||
[DataType(DataType.Password)] |
[DataType(DataType.Password)] |
||||
[DisableAuditing] |
[DisableAuditing] |
||||
public string SmtpPassword { get; set; } |
public string SmtpPassword { get; set; } |
||||
|
|
||||
[MaxLength(1024)] |
[MaxLength(1024)] |
||||
public string SmtpDomain { get; set; } |
public string SmtpDomain { get; set; } |
||||
|
|
||||
public bool SmtpEnableSsl { get; set; } |
public bool SmtpEnableSsl { get; set; } |
||||
|
|
||||
public bool SmtpUseDefaultCredentials { get; set; } |
public bool SmtpUseDefaultCredentials { get; set; } |
||||
|
|
||||
[MaxLength(1024)] |
[MaxLength(1024)] |
||||
[Required] |
[Required] |
||||
public string DefaultFromAddress { get; set; } |
public string DefaultFromAddress { get; set; } |
||||
|
|
||||
[MaxLength(1024)] |
[MaxLength(1024)] |
||||
[Required] |
[Required] |
||||
public string DefaultFromDisplayName { get; set; } |
public string DefaultFromDisplayName { get; set; } |
||||
} |
|
||||
} |
} |
||||
|
|
||||
|
|||||
@ -1,14 +1,13 @@ |
|||||
using Volo.Abp.Application.Services; |
using Volo.Abp.Application.Services; |
||||
using Volo.Abp.SettingManagement.Localization; |
using Volo.Abp.SettingManagement.Localization; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement |
namespace Volo.Abp.SettingManagement; |
||||
|
|
||||
|
public abstract class SettingManagementAppServiceBase : ApplicationService |
||||
{ |
{ |
||||
public abstract class SettingManagementAppServiceBase : ApplicationService |
protected SettingManagementAppServiceBase() |
||||
{ |
{ |
||||
protected SettingManagementAppServiceBase() |
ObjectMapperContext = typeof(AbpSettingManagementApplicationModule); |
||||
{ |
LocalizationResource = typeof(AbpSettingManagementResource); |
||||
ObjectMapperContext = typeof(AbpSettingManagementApplicationModule); |
|
||||
LocalizationResource = typeof(AbpSettingManagementResource); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,13 +1,12 @@ |
|||||
using Volo.Abp.AspNetCore.Components.Server.Theming; |
using Volo.Abp.AspNetCore.Components.Server.Theming; |
||||
using Volo.Abp.Modularity; |
using Volo.Abp.Modularity; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement.Blazor.Server |
namespace Volo.Abp.SettingManagement.Blazor.Server; |
||||
|
|
||||
|
[DependsOn( |
||||
|
typeof(AbpSettingManagementBlazorModule), |
||||
|
typeof(AbpAspNetCoreComponentsServerThemingModule) |
||||
|
)] |
||||
|
public class AbpSettingManagementBlazorServerModule : AbpModule |
||||
{ |
{ |
||||
[DependsOn( |
|
||||
typeof(AbpSettingManagementBlazorModule), |
|
||||
typeof(AbpAspNetCoreComponentsServerThemingModule) |
|
||||
)] |
|
||||
public class AbpSettingManagementBlazorServerModule : AbpModule |
|
||||
{ |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,14 +1,13 @@ |
|||||
using Volo.Abp.AspNetCore.Components.WebAssembly.Theming; |
using Volo.Abp.AspNetCore.Components.WebAssembly.Theming; |
||||
using Volo.Abp.Modularity; |
using Volo.Abp.Modularity; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement.Blazor.WebAssembly |
namespace Volo.Abp.SettingManagement.Blazor.WebAssembly; |
||||
|
|
||||
|
[DependsOn( |
||||
|
typeof(AbpSettingManagementBlazorModule), |
||||
|
typeof(AbpAspNetCoreComponentsWebAssemblyThemingModule), |
||||
|
typeof(AbpSettingManagementHttpApiClientModule) |
||||
|
)] |
||||
|
public class AbpSettingManagementBlazorWebAssemblyModule : AbpModule |
||||
{ |
{ |
||||
[DependsOn( |
|
||||
typeof(AbpSettingManagementBlazorModule), |
|
||||
typeof(AbpAspNetCoreComponentsWebAssemblyThemingModule), |
|
||||
typeof(AbpSettingManagementHttpApiClientModule) |
|
||||
)] |
|
||||
public class AbpSettingManagementBlazorWebAssemblyModule : AbpModule |
|
||||
{ |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,11 +1,10 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement.Blazor |
namespace Volo.Abp.SettingManagement.Blazor; |
||||
|
|
||||
|
public interface ISettingComponentContributor |
||||
{ |
{ |
||||
public interface ISettingComponentContributor |
Task ConfigureAsync(SettingComponentCreationContext context); |
||||
{ |
|
||||
Task ConfigureAsync(SettingComponentCreationContext context); |
|
||||
|
|
||||
Task<bool> CheckPermissionsAsync(SettingComponentCreationContext context); |
Task<bool> CheckPermissionsAsync(SettingComponentCreationContext context); |
||||
} |
} |
||||
} |
|
||||
|
|||||
@ -1,7 +1,6 @@ |
|||||
namespace Volo.Abp.SettingManagement.Blazor.Menus |
namespace Volo.Abp.SettingManagement.Blazor.Menus; |
||||
|
|
||||
|
public class SettingManagementMenus |
||||
{ |
{ |
||||
public class SettingManagementMenus |
public const string GroupName = "SettingManagement"; |
||||
{ |
} |
||||
public const string GroupName = "SettingManagement"; |
|
||||
} |
|
||||
} |
|
||||
|
|||||
@ -1,39 +1,35 @@ |
|||||
using System; |
using System; |
||||
using JetBrains.Annotations; |
using JetBrains.Annotations; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement.Blazor |
namespace Volo.Abp.SettingManagement.Blazor; |
||||
|
|
||||
|
public class SettingComponentGroup |
||||
{ |
{ |
||||
public class SettingComponentGroup |
public string Id { |
||||
{ |
get => _id; |
||||
public string Id |
set => _id = Check.NotNullOrWhiteSpace(value, nameof(Id)); |
||||
{ |
} |
||||
get => _id; |
private string _id; |
||||
set => _id = Check.NotNullOrWhiteSpace(value, nameof(Id)); |
|
||||
} |
|
||||
private string _id; |
|
||||
|
|
||||
public string DisplayName |
public string DisplayName { |
||||
{ |
get => _displayName; |
||||
get => _displayName; |
set => _displayName = Check.NotNullOrWhiteSpace(value, nameof(DisplayName)); |
||||
set => _displayName = Check.NotNullOrWhiteSpace(value, nameof(DisplayName)); |
} |
||||
} |
private string _displayName; |
||||
private string _displayName; |
|
||||
|
|
||||
public Type ComponentType |
public Type ComponentType { |
||||
{ |
get => _componentType; |
||||
get => _componentType; |
set => _componentType = Check.NotNull(value, nameof(ComponentType)); |
||||
set => _componentType = Check.NotNull(value, nameof(ComponentType)); |
} |
||||
} |
private Type _componentType; |
||||
private Type _componentType; |
|
||||
|
|
||||
public object Parameter { get; set; } |
public object Parameter { get; set; } |
||||
|
|
||||
public SettingComponentGroup([NotNull] string id, [NotNull] string displayName, [NotNull] Type componentType, object parameter = null) |
public SettingComponentGroup([NotNull] string id, [NotNull] string displayName, [NotNull] Type componentType, object parameter = null) |
||||
{ |
{ |
||||
Id = id; |
Id = id; |
||||
DisplayName = displayName; |
DisplayName = displayName; |
||||
ComponentType = componentType; |
ComponentType = componentType; |
||||
Parameter = parameter; |
Parameter = parameter; |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,12 +1,11 @@ |
|||||
using AutoMapper; |
using AutoMapper; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement.Blazor |
namespace Volo.Abp.SettingManagement.Blazor; |
||||
|
|
||||
|
public class SettingManagementBlazorAutoMapperProfile : Profile |
||||
{ |
{ |
||||
public class SettingManagementBlazorAutoMapperProfile : Profile |
public SettingManagementBlazorAutoMapperProfile() |
||||
{ |
{ |
||||
public SettingManagementBlazorAutoMapperProfile() |
CreateMap<EmailSettingsDto, UpdateEmailSettingsDto>(); |
||||
{ |
|
||||
CreateMap<EmailSettingsDto, UpdateEmailSettingsDto>(); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,14 +1,13 @@ |
|||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement.Blazor |
namespace Volo.Abp.SettingManagement.Blazor; |
||||
|
|
||||
|
public class SettingManagementComponentOptions |
||||
{ |
{ |
||||
public class SettingManagementComponentOptions |
public List<ISettingComponentContributor> Contributors { get; } |
||||
{ |
|
||||
public List<ISettingComponentContributor> Contributors { get; } |
|
||||
|
|
||||
public SettingManagementComponentOptions() |
public SettingManagementComponentOptions() |
||||
{ |
{ |
||||
Contributors = new List<ISettingComponentContributor>(); |
Contributors = new List<ISettingComponentContributor>(); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,10 +1,9 @@ |
|||||
using Volo.Abp.Localization; |
using Volo.Abp.Localization; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement.Localization |
namespace Volo.Abp.SettingManagement.Localization; |
||||
|
|
||||
|
[LocalizationResourceName("AbpSettingManagement")] |
||||
|
public class AbpSettingManagementResource |
||||
{ |
{ |
||||
[LocalizationResourceName("AbpSettingManagement")] |
|
||||
public class AbpSettingManagementResource |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,27 +1,26 @@ |
|||||
namespace Volo.Abp.SettingManagement |
namespace Volo.Abp.SettingManagement; |
||||
|
|
||||
|
public static class SettingConsts |
||||
{ |
{ |
||||
public static class SettingConsts |
/// <summary>
|
||||
{ |
/// Default value: 128
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 128
|
public static int MaxNameLength { get; set; } = 128; |
||||
/// </summary>
|
|
||||
public static int MaxNameLength { get; set; } = 128; |
/// <summary>
|
||||
|
/// Default value: 2048
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 2048
|
public static int MaxValueLength { get; set; } = 2048; |
||||
/// </summary>
|
|
||||
public static int MaxValueLength { get; set; } = 2048; |
public static int MaxValueLengthValue { get; set; } = MaxValueLength; |
||||
|
|
||||
public static int MaxValueLengthValue { get; set; } = MaxValueLength; |
/// <summary>
|
||||
|
/// Default value: 64
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 64
|
public static int MaxProviderNameLength { get; set; } = 64; |
||||
/// </summary>
|
|
||||
public static int MaxProviderNameLength { get; set; } = 64; |
/// <summary>
|
||||
|
/// Default value: 64
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 64
|
public static int MaxProviderKeyLength { get; set; } = 64; |
||||
/// </summary>
|
|
||||
public static int MaxProviderKeyLength { get; set; } = 64; |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,11 +1,10 @@ |
|||||
namespace Volo.Abp.SettingManagement |
namespace Volo.Abp.SettingManagement; |
||||
|
|
||||
|
public class SettingManagementFeatures |
||||
{ |
{ |
||||
public class SettingManagementFeatures |
public const string GroupName = "SettingManagement"; |
||||
{ |
|
||||
public const string GroupName = "SettingManagement"; |
|
||||
|
|
||||
public const string Enable = GroupName + ".Enable"; |
public const string Enable = GroupName + ".Enable"; |
||||
|
|
||||
public const string AllowTenantsToChangeEmailSettings = GroupName + ".AllowTenantsToChangeEmailSettings"; |
public const string AllowTenantsToChangeEmailSettings = GroupName + ".AllowTenantsToChangeEmailSettings"; |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,13 +1,12 @@ |
|||||
using Volo.Abp.Data; |
using Volo.Abp.Data; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement |
namespace Volo.Abp.SettingManagement; |
||||
|
|
||||
|
public static class AbpSettingManagementDbProperties |
||||
{ |
{ |
||||
public static class AbpSettingManagementDbProperties |
public static string DbTablePrefix { get; set; } = AbpCommonDbProperties.DbTablePrefix; |
||||
{ |
|
||||
public static string DbTablePrefix { get; set; } = AbpCommonDbProperties.DbTablePrefix; |
|
||||
|
|
||||
public static string DbSchema { get; set; } = AbpCommonDbProperties.DbSchema; |
public static string DbSchema { get; set; } = AbpCommonDbProperties.DbSchema; |
||||
|
|
||||
public const string ConnectionStringName = "AbpSettingManagement"; |
public const string ConnectionStringName = "AbpSettingManagement"; |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,21 +1,20 @@ |
|||||
using Volo.Abp.DependencyInjection; |
using Volo.Abp.DependencyInjection; |
||||
using Volo.Abp.Settings; |
using Volo.Abp.Settings; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement |
namespace Volo.Abp.SettingManagement; |
||||
|
|
||||
|
public class GlobalSettingManagementProvider : SettingManagementProvider, ITransientDependency |
||||
{ |
{ |
||||
public class GlobalSettingManagementProvider : SettingManagementProvider, ITransientDependency |
public override string Name => GlobalSettingValueProvider.ProviderName; |
||||
{ |
|
||||
public override string Name => GlobalSettingValueProvider.ProviderName; |
|
||||
|
|
||||
public GlobalSettingManagementProvider(ISettingManagementStore settingManagementStore) |
public GlobalSettingManagementProvider(ISettingManagementStore settingManagementStore) |
||||
: base(settingManagementStore) |
: base(settingManagementStore) |
||||
{ |
{ |
||||
|
|
||||
} |
} |
||||
|
|
||||
protected override string NormalizeProviderKey(string providerKey) |
protected override string NormalizeProviderKey(string providerKey) |
||||
{ |
{ |
||||
return null; |
return null; |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,14 +1,13 @@ |
|||||
using Volo.Abp.Collections; |
using Volo.Abp.Collections; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement |
namespace Volo.Abp.SettingManagement; |
||||
|
|
||||
|
public class SettingManagementOptions |
||||
{ |
{ |
||||
public class SettingManagementOptions |
public ITypeList<ISettingManagementProvider> Providers { get; } |
||||
{ |
|
||||
public ITypeList<ISettingManagementProvider> Providers { get; } |
|
||||
|
|
||||
public SettingManagementOptions() |
public SettingManagementOptions() |
||||
{ |
{ |
||||
Providers = new TypeList<ISettingManagementProvider>(); |
Providers = new TypeList<ISettingManagementProvider>(); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,38 +1,37 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using Volo.Abp.Settings; |
using Volo.Abp.Settings; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement |
namespace Volo.Abp.SettingManagement; |
||||
|
|
||||
|
public abstract class SettingManagementProvider : ISettingManagementProvider |
||||
{ |
{ |
||||
public abstract class SettingManagementProvider : ISettingManagementProvider |
public abstract string Name { get; } |
||||
|
|
||||
|
//TODO: Rename to Store
|
||||
|
protected ISettingManagementStore SettingManagementStore { get; } |
||||
|
|
||||
|
protected SettingManagementProvider(ISettingManagementStore settingManagementStore) |
||||
|
{ |
||||
|
SettingManagementStore = settingManagementStore; |
||||
|
} |
||||
|
|
||||
|
public virtual async Task<string> GetOrNullAsync(SettingDefinition setting, string providerKey) |
||||
|
{ |
||||
|
return await SettingManagementStore.GetOrNullAsync(setting.Name, Name, NormalizeProviderKey(providerKey)); |
||||
|
} |
||||
|
|
||||
|
public virtual async Task SetAsync(SettingDefinition setting, string value, string providerKey) |
||||
|
{ |
||||
|
await SettingManagementStore.SetAsync(setting.Name, value, Name, NormalizeProviderKey(providerKey)); |
||||
|
} |
||||
|
|
||||
|
public virtual async Task ClearAsync(SettingDefinition setting, string providerKey) |
||||
|
{ |
||||
|
await SettingManagementStore.DeleteAsync(setting.Name, Name, NormalizeProviderKey(providerKey)); |
||||
|
} |
||||
|
|
||||
|
protected virtual string NormalizeProviderKey(string providerKey) |
||||
{ |
{ |
||||
public abstract string Name { get; } |
return providerKey; |
||||
|
|
||||
//TODO: Rename to Store
|
|
||||
protected ISettingManagementStore SettingManagementStore { get; } |
|
||||
|
|
||||
protected SettingManagementProvider(ISettingManagementStore settingManagementStore) |
|
||||
{ |
|
||||
SettingManagementStore = settingManagementStore; |
|
||||
} |
|
||||
|
|
||||
public virtual async Task<string> GetOrNullAsync(SettingDefinition setting, string providerKey) |
|
||||
{ |
|
||||
return await SettingManagementStore.GetOrNullAsync(setting.Name, Name, NormalizeProviderKey(providerKey)); |
|
||||
} |
|
||||
|
|
||||
public virtual async Task SetAsync(SettingDefinition setting, string value, string providerKey) |
|
||||
{ |
|
||||
await SettingManagementStore.SetAsync(setting.Name, value, Name, NormalizeProviderKey(providerKey)); |
|
||||
} |
|
||||
|
|
||||
public virtual async Task ClearAsync(SettingDefinition setting, string providerKey) |
|
||||
{ |
|
||||
await SettingManagementStore.DeleteAsync(setting.Name, Name, NormalizeProviderKey(providerKey)); |
|
||||
} |
|
||||
|
|
||||
protected virtual string NormalizeProviderKey(string providerKey) |
|
||||
{ |
|
||||
return providerKey; |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,8 +1,7 @@ |
|||||
// This file is part of EmailSettingsClientProxy, you can customize it here
|
// This file is part of EmailSettingsClientProxy, you can customize it here
|
||||
// ReSharper disable once CheckNamespace
|
// ReSharper disable once CheckNamespace
|
||||
namespace Volo.Abp.SettingManagement.ClientProxies |
namespace Volo.Abp.SettingManagement.ClientProxies; |
||||
|
|
||||
|
public partial class EmailSettingsClientProxy |
||||
{ |
{ |
||||
public partial class EmailSettingsClientProxy |
|
||||
{ |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,18 +1,17 @@ |
|||||
using Volo.Abp.MongoDB; |
using Volo.Abp.MongoDB; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement.MongoDB |
namespace Volo.Abp.SettingManagement.MongoDB; |
||||
|
|
||||
|
public static class SettingManagementMongoDbContextExtensions |
||||
{ |
{ |
||||
public static class SettingManagementMongoDbContextExtensions |
public static void ConfigureSettingManagement( |
||||
|
this IMongoModelBuilder builder) |
||||
{ |
{ |
||||
public static void ConfigureSettingManagement( |
Check.NotNull(builder, nameof(builder)); |
||||
this IMongoModelBuilder builder) |
|
||||
{ |
|
||||
Check.NotNull(builder, nameof(builder)); |
|
||||
|
|
||||
builder.Entity<Setting>(b => |
builder.Entity<Setting>(b => |
||||
{ |
{ |
||||
b.CollectionName = AbpSettingManagementDbProperties.DbTablePrefix + "Settings"; |
b.CollectionName = AbpSettingManagementDbProperties.DbTablePrefix + "Settings"; |
||||
}); |
}); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,7 +1,6 @@ |
|||||
namespace Volo.Abp.SettingManagement.Web.Navigation |
namespace Volo.Abp.SettingManagement.Web.Navigation; |
||||
|
|
||||
|
public class SettingManagementMenuNames |
||||
{ |
{ |
||||
public class SettingManagementMenuNames |
public const string GroupName = "SettingManagement"; |
||||
{ |
|
||||
public const string GroupName = "SettingManagement"; |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,11 +1,10 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement |
namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement; |
||||
|
|
||||
|
public interface ISettingPageContributor |
||||
{ |
{ |
||||
public interface ISettingPageContributor |
Task ConfigureAsync(SettingPageCreationContext context); |
||||
{ |
|
||||
Task ConfigureAsync(SettingPageCreationContext context); |
|
||||
|
|
||||
Task<bool> CheckPermissionsAsync(SettingPageCreationContext context); |
Task<bool> CheckPermissionsAsync(SettingPageCreationContext context); |
||||
} |
} |
||||
} |
|
||||
|
|||||
@ -1,14 +1,13 @@ |
|||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement |
namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement; |
||||
|
|
||||
|
public class SettingManagementPageOptions |
||||
{ |
{ |
||||
public class SettingManagementPageOptions |
public List<ISettingPageContributor> Contributors { get; } |
||||
{ |
|
||||
public List<ISettingPageContributor> Contributors { get; } |
|
||||
|
|
||||
public SettingManagementPageOptions() |
public SettingManagementPageOptions() |
||||
{ |
{ |
||||
Contributors = new List<ISettingPageContributor>(); |
Contributors = new List<ISettingPageContributor>(); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,39 +1,35 @@ |
|||||
using System; |
using System; |
||||
using JetBrains.Annotations; |
using JetBrains.Annotations; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement |
namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement; |
||||
|
|
||||
|
public class SettingPageGroup |
||||
{ |
{ |
||||
public class SettingPageGroup |
public string Id { |
||||
{ |
get => _id; |
||||
public string Id |
set => _id = Check.NotNullOrWhiteSpace(value, nameof(Id)); |
||||
{ |
} |
||||
get => _id; |
private string _id; |
||||
set => _id = Check.NotNullOrWhiteSpace(value, nameof(Id)); |
|
||||
} |
|
||||
private string _id; |
|
||||
|
|
||||
public string DisplayName |
public string DisplayName { |
||||
{ |
get => _displayName; |
||||
get => _displayName; |
set => _displayName = Check.NotNullOrWhiteSpace(value, nameof(DisplayName)); |
||||
set => _displayName = Check.NotNullOrWhiteSpace(value, nameof(DisplayName)); |
} |
||||
} |
private string _displayName; |
||||
private string _displayName; |
|
||||
|
|
||||
public Type ComponentType |
public Type ComponentType { |
||||
{ |
get => _componentType; |
||||
get => _componentType; |
set => _componentType = Check.NotNull(value, nameof(ComponentType)); |
||||
set => _componentType = Check.NotNull(value, nameof(ComponentType)); |
} |
||||
} |
private Type _componentType; |
||||
private Type _componentType; |
|
||||
|
|
||||
public object Parameter { get; set; } |
public object Parameter { get; set; } |
||||
|
|
||||
public SettingPageGroup([NotNull] string id, [NotNull] string displayName, [NotNull] Type componentType, object parameter = null) |
public SettingPageGroup([NotNull] string id, [NotNull] string displayName, [NotNull] Type componentType, object parameter = null) |
||||
{ |
{ |
||||
Id = id; |
Id = id; |
||||
DisplayName = displayName; |
DisplayName = displayName; |
||||
ComponentType = componentType; |
ComponentType = componentType; |
||||
Parameter = parameter; |
Parameter = parameter; |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,27 @@ |
|||||
|
{ |
||||
|
"iisSettings": { |
||||
|
"windowsAuthentication": false, |
||||
|
"anonymousAuthentication": true, |
||||
|
"iisExpress": { |
||||
|
"applicationUrl": "http://localhost:50943/", |
||||
|
"sslPort": 44372 |
||||
|
} |
||||
|
}, |
||||
|
"profiles": { |
||||
|
"IIS Express": { |
||||
|
"commandName": "IISExpress", |
||||
|
"launchBrowser": true, |
||||
|
"environmentVariables": { |
||||
|
"ASPNETCORE_ENVIRONMENT": "Development" |
||||
|
} |
||||
|
}, |
||||
|
"Volo.Abp.SettingManagement.Web": { |
||||
|
"commandName": "Project", |
||||
|
"launchBrowser": true, |
||||
|
"environmentVariables": { |
||||
|
"ASPNETCORE_ENVIRONMENT": "Development" |
||||
|
}, |
||||
|
"applicationUrl": "https://localhost:5001;http://localhost:5000" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,7 +1,6 @@ |
|||||
namespace Volo.Abp.SettingManagement.EntityFrameworkCore |
namespace Volo.Abp.SettingManagement.EntityFrameworkCore; |
||||
|
|
||||
|
public class SettingRepository_Tests : SettingRepository_Tests<AbpSettingManagementEntityFrameworkCoreTestModule> |
||||
{ |
{ |
||||
public class SettingRepository_Tests : SettingRepository_Tests<AbpSettingManagementEntityFrameworkCoreTestModule> |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,22 +1,21 @@ |
|||||
using System; |
using System; |
||||
using Mongo2Go; |
using Mongo2Go; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement.MongoDB |
namespace Volo.Abp.SettingManagement.MongoDB; |
||||
|
|
||||
|
public class MongoDbFixture : IDisposable |
||||
{ |
{ |
||||
public class MongoDbFixture : IDisposable |
private static readonly MongoDbRunner MongoDbRunner; |
||||
{ |
public static readonly string ConnectionString; |
||||
private static readonly MongoDbRunner MongoDbRunner; |
|
||||
public static readonly string ConnectionString; |
|
||||
|
|
||||
static MongoDbFixture() |
static MongoDbFixture() |
||||
{ |
{ |
||||
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); |
||||
ConnectionString = MongoDbRunner.ConnectionString; |
ConnectionString = MongoDbRunner.ConnectionString; |
||||
} |
} |
||||
|
|
||||
public void Dispose() |
public void Dispose() |
||||
{ |
{ |
||||
MongoDbRunner?.Dispose(); |
MongoDbRunner?.Dispose(); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,10 +1,9 @@ |
|||||
using Xunit; |
using Xunit; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement.MongoDB |
namespace Volo.Abp.SettingManagement.MongoDB; |
||||
|
|
||||
|
[CollectionDefinition(Name)] |
||||
|
public class MongoTestCollection : ICollectionFixture<MongoDbFixture> |
||||
{ |
{ |
||||
[CollectionDefinition(Name)] |
public const string Name = "MongoDB Collection"; |
||||
public class MongoTestCollection : ICollectionFixture<MongoDbFixture> |
} |
||||
{ |
|
||||
public const string Name = "MongoDB Collection"; |
|
||||
} |
|
||||
} |
|
||||
|
|||||
@ -1,10 +1,9 @@ |
|||||
using Xunit; |
using Xunit; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement.MongoDB |
namespace Volo.Abp.SettingManagement.MongoDB; |
||||
|
|
||||
|
[Collection(MongoTestCollection.Name)] |
||||
|
public class SettingRepository_Tests : SettingRepository_Tests<AbpSettingManagementMongoDbTestModule> |
||||
{ |
{ |
||||
[Collection(MongoTestCollection.Name)] |
|
||||
public class SettingRepository_Tests : SettingRepository_Tests<AbpSettingManagementMongoDbTestModule> |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,14 +1,13 @@ |
|||||
using Volo.Abp.Modularity; |
using Volo.Abp.Modularity; |
||||
using Volo.Abp.Testing; |
using Volo.Abp.Testing; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement |
namespace Volo.Abp.SettingManagement; |
||||
|
|
||||
|
public class SettingManagementTestBase<TStartupModule> : AbpIntegratedTest<TStartupModule> |
||||
|
where TStartupModule : IAbpModule |
||||
{ |
{ |
||||
public class SettingManagementTestBase<TStartupModule> : AbpIntegratedTest<TStartupModule> |
protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) |
||||
where TStartupModule : IAbpModule |
|
||||
{ |
{ |
||||
protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) |
options.UseAutofac(); |
||||
{ |
|
||||
options.UseAutofac(); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,13 +1,12 @@ |
|||||
using System; |
using System; |
||||
using Volo.Abp.DependencyInjection; |
using Volo.Abp.DependencyInjection; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement |
namespace Volo.Abp.SettingManagement; |
||||
|
|
||||
|
public class SettingTestData : ISingletonDependency |
||||
{ |
{ |
||||
public class SettingTestData : ISingletonDependency |
public Guid User1Id { get; } = Guid.NewGuid(); |
||||
{ |
public Guid User2Id { get; } = Guid.NewGuid(); |
||||
public Guid User1Id { get; } = Guid.NewGuid(); |
|
||||
public Guid User2Id { get; } = Guid.NewGuid(); |
|
||||
|
|
||||
public Guid SettingId { get; } = Guid.NewGuid(); |
public Guid SettingId { get; } = Guid.NewGuid(); |
||||
} |
} |
||||
} |
|
||||
|
|||||
@ -1,18 +1,17 @@ |
|||||
using Volo.Abp.Settings; |
using Volo.Abp.Settings; |
||||
|
|
||||
namespace Volo.Abp.SettingManagement |
namespace Volo.Abp.SettingManagement; |
||||
|
|
||||
|
public class TestSettingDefinitionProvider : SettingDefinitionProvider |
||||
{ |
{ |
||||
public class TestSettingDefinitionProvider : SettingDefinitionProvider |
public override void Define(ISettingDefinitionContext context) |
||||
{ |
{ |
||||
public override void Define(ISettingDefinitionContext context) |
context.Add(new SettingDefinition("MySetting1")); |
||||
{ |
context.Add(new SettingDefinition("MySetting2")); |
||||
context.Add(new SettingDefinition("MySetting1")); |
context.Add(new SettingDefinition("MySetting3", "123")); |
||||
context.Add(new SettingDefinition("MySetting2")); |
context.Add(new SettingDefinition("MySettingWithoutInherit", isInherited: false)); |
||||
context.Add(new SettingDefinition("MySetting3", "123")); |
context.Add(new SettingDefinition("SettingNotSetInStore", defaultValue: "default-value")); |
||||
context.Add(new SettingDefinition("MySettingWithoutInherit", isInherited: false)); |
|
||||
context.Add(new SettingDefinition("SettingNotSetInStore", defaultValue: "default-value")); |
|
||||
|
|
||||
|
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue