Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-generate EF Core migrations for the startup templates & sample projects. #2561

Merged
merged 1 commit into from
Jan 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Volo.Abp.Identity;
using Volo.Abp.IdentityServer;
using Volo.Abp.Localization;
using Volo.Abp.Localization.Resources.AbpValidation;
using Volo.Abp.Validation.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement;
using Volo.Abp.SettingManagement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,6 @@ protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationO
options.UseAutofac();
}

protected virtual void WithUnitOfWork(Action action)
{
WithUnitOfWork(new AbpUnitOfWorkOptions(), action);
}

protected virtual void WithUnitOfWork(AbpUnitOfWorkOptions options, Action action)
{
using (var scope = ServiceProvider.CreateScope())
{
var uowManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>();

using (var uow = uowManager.Begin(options))
{
action();

uow.Complete();
}
}
}

protected virtual Task WithUnitOfWorkAsync(Func<Task> func)
{
return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func);
Expand All @@ -57,27 +37,7 @@ protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, F
}
}
}

protected virtual TResult WithUnitOfWork<TResult>(Func<TResult> func)
{
return WithUnitOfWork(new AbpUnitOfWorkOptions(), func);
}

protected virtual TResult WithUnitOfWork<TResult>(AbpUnitOfWorkOptions options, Func<TResult> func)
{
using (var scope = ServiceProvider.CreateScope())
{
var uowManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>();

using (var uow = uowManager.Begin(options))
{
var result = func();
uow.Complete();
return result;
}
}
}


protected virtual Task<TResult> WithUnitOfWorkAsync<TResult>(Func<Task<TResult>> func)
{
return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Volo.Abp.Identity;
using Volo.Abp.IdentityServer;
using Volo.Abp.Localization;
using Volo.Abp.Localization.Resources.AbpValidation;
using Volo.Abp.Validation.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement;
using Volo.Abp.SettingManagement;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ protected override void Up(MigrationBuilder migrationBuilder)
NormalizedUserName = table.Column<string>(maxLength: 256, nullable: false),
Name = table.Column<string>(maxLength: 64, nullable: true),
Surname = table.Column<string>(maxLength: 64, nullable: true),
Email = table.Column<string>(maxLength: 256, nullable: true),
NormalizedEmail = table.Column<string>(maxLength: 256, nullable: true),
Email = table.Column<string>(maxLength: 256, nullable: false),
NormalizedEmail = table.Column<string>(maxLength: 256, nullable: false),
EmailConfirmed = table.Column<bool>(nullable: false, defaultValue: false),
PasswordHash = table.Column<string>(maxLength: 256, nullable: true),
SecurityStamp = table.Column<string>(maxLength: 256, nullable: false),
Expand Down Expand Up @@ -283,6 +283,27 @@ protected override void Up(MigrationBuilder migrationBuilder)
table.PrimaryKey("PK_IdentityServerClients", x => x.Id);
});

migrationBuilder.CreateTable(
name: "IdentityServerDeviceFlowCodes",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
CreationTime = table.Column<DateTime>(nullable: false),
CreatorId = table.Column<Guid>(nullable: true),
DeviceCode = table.Column<string>(maxLength: 200, nullable: false),
UserCode = table.Column<string>(maxLength: 200, nullable: false),
SubjectId = table.Column<string>(maxLength: 200, nullable: true),
ClientId = table.Column<string>(maxLength: 200, nullable: false),
Expiration = table.Column<DateTime>(nullable: false),
Data = table.Column<string>(maxLength: 50000, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerDeviceFlowCodes", x => x.Id);
});

migrationBuilder.CreateTable(
name: "IdentityServerIdentityResources",
columns: table => new
Expand Down Expand Up @@ -866,8 +887,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
migrationBuilder.CreateIndex(
name: "IX_AbpTenants_Name",
table: "AbpTenants",
column: "Name",
unique: true);
column: "Name");

migrationBuilder.CreateIndex(
name: "IX_AbpUserClaims_UserId",
Expand Down Expand Up @@ -909,6 +929,23 @@ protected override void Up(MigrationBuilder migrationBuilder)
table: "IdentityServerClients",
column: "ClientId");

migrationBuilder.CreateIndex(
name: "IX_IdentityServerDeviceFlowCodes_DeviceCode",
table: "IdentityServerDeviceFlowCodes",
column: "DeviceCode",
unique: true);

migrationBuilder.CreateIndex(
name: "IX_IdentityServerDeviceFlowCodes_Expiration",
table: "IdentityServerDeviceFlowCodes",
column: "Expiration");

migrationBuilder.CreateIndex(
name: "IX_IdentityServerDeviceFlowCodes_UserCode",
table: "IdentityServerDeviceFlowCodes",
column: "UserCode",
unique: true);

migrationBuilder.CreateIndex(
name: "IX_IdentityServerPersistedGrants_Expiration",
table: "IdentityServerPersistedGrants",
Expand Down Expand Up @@ -997,6 +1034,9 @@ protected override void Down(MigrationBuilder migrationBuilder)
migrationBuilder.DropTable(
name: "IdentityServerClientSecrets");

migrationBuilder.DropTable(
name: "IdentityServerDeviceFlowCodes");

migrationBuilder.DropTable(
name: "IdentityServerIdentityClaims");

Expand Down
Loading