Skip to content

Commit a0cee6c

Browse files
authored
Merge pull request #24439 from abpframework/Update-template-projects-migrations
Update template projects migrations.
2 parents 7186d57 + 6ac2052 commit a0cee6c

File tree

28 files changed

+2637
-212
lines changed

28 files changed

+2637
-212
lines changed

framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Internal/RecreateInitialMigrationCommand.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public virtual Task ExecuteAsync(CommandLineArgs commandLineArgs)
4747
Directory.Delete(Path.Combine(projectDir, "Migrations"), true);
4848
}
4949

50+
CmdHelper.RunCmd($"dotnet build", workingDirectory: projectDir);
5051
var separateDbContext = false;
5152
if (Directory.Exists(Path.Combine(projectDir, "TenantMigrations")))
5253
{

templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20251020063503_Initial.Designer.cs renamed to templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20251218020112_Initial.Designer.cs

Lines changed: 127 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20251020063503_Initial.cs renamed to templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Migrations/20251218020112_Initial.cs

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,10 @@ protected override void Up(MigrationBuilder migrationBuilder)
211211
columns: table => new
212212
{
213213
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
214-
GroupName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
214+
GroupName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
215215
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
216+
ResourceName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
217+
ManagementPermissionName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
216218
ParentName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
217219
DisplayName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
218220
IsEnabled = table.Column<bool>(type: "bit", nullable: false),
@@ -226,6 +228,23 @@ protected override void Up(MigrationBuilder migrationBuilder)
226228
table.PrimaryKey("PK_AbpPermissions", x => x.Id);
227229
});
228230

231+
migrationBuilder.CreateTable(
232+
name: "AbpResourcePermissionGrants",
233+
columns: table => new
234+
{
235+
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
236+
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
237+
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
238+
ProviderName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
239+
ProviderKey = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
240+
ResourceName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
241+
ResourceKey = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false)
242+
},
243+
constraints: table =>
244+
{
245+
table.PrimaryKey("PK_AbpResourcePermissionGrants", x => x.Id);
246+
});
247+
229248
migrationBuilder.CreateTable(
230249
name: "AbpRoles",
231250
columns: table => new
@@ -393,6 +412,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
393412
ShouldChangePasswordOnNextLogin = table.Column<bool>(type: "bit", nullable: false),
394413
EntityVersion = table.Column<int>(type: "int", nullable: false),
395414
LastPasswordChangeTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
415+
LastSignInTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
396416
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
397417
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
398418
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
@@ -658,6 +678,26 @@ protected override void Up(MigrationBuilder migrationBuilder)
658678
onDelete: ReferentialAction.Cascade);
659679
});
660680

681+
migrationBuilder.CreateTable(
682+
name: "AbpUserPasskeys",
683+
columns: table => new
684+
{
685+
CredentialId = table.Column<byte[]>(type: "varbinary(1024)", maxLength: 1024, nullable: false),
686+
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
687+
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
688+
Data = table.Column<string>(type: "nvarchar(max)", nullable: true)
689+
},
690+
constraints: table =>
691+
{
692+
table.PrimaryKey("PK_AbpUserPasskeys", x => x.CredentialId);
693+
table.ForeignKey(
694+
name: "FK_AbpUserPasskeys_AbpUsers_UserId",
695+
column: x => x.UserId,
696+
principalTable: "AbpUsers",
697+
principalColumn: "Id",
698+
onDelete: ReferentialAction.Cascade);
699+
});
700+
661701
migrationBuilder.CreateTable(
662702
name: "AbpUserPasswordHistories",
663703
columns: table => new
@@ -906,10 +946,18 @@ protected override void Up(MigrationBuilder migrationBuilder)
906946
column: "GroupName");
907947

908948
migrationBuilder.CreateIndex(
909-
name: "IX_AbpPermissions_Name",
949+
name: "IX_AbpPermissions_ResourceName_Name",
910950
table: "AbpPermissions",
911-
column: "Name",
912-
unique: true);
951+
columns: new[] { "ResourceName", "Name" },
952+
unique: true,
953+
filter: "[ResourceName] IS NOT NULL");
954+
955+
migrationBuilder.CreateIndex(
956+
name: "IX_AbpResourcePermissionGrants_TenantId_Name_ResourceName_ResourceKey_ProviderName_ProviderKey",
957+
table: "AbpResourcePermissionGrants",
958+
columns: new[] { "TenantId", "Name", "ResourceName", "ResourceKey", "ProviderName", "ProviderKey" },
959+
unique: true,
960+
filter: "[TenantId] IS NOT NULL");
913961

914962
migrationBuilder.CreateIndex(
915963
name: "IX_AbpRoleClaims_RoleId",
@@ -994,6 +1042,11 @@ protected override void Up(MigrationBuilder migrationBuilder)
9941042
table: "AbpUserOrganizationUnits",
9951043
columns: new[] { "UserId", "OrganizationUnitId" });
9961044

1045+
migrationBuilder.CreateIndex(
1046+
name: "IX_AbpUserPasskeys_UserId",
1047+
table: "AbpUserPasskeys",
1048+
column: "UserId");
1049+
9971050
migrationBuilder.CreateIndex(
9981051
name: "IX_AbpUserRoles_RoleId_UserId",
9991052
table: "AbpUserRoles",
@@ -1089,6 +1142,9 @@ protected override void Down(MigrationBuilder migrationBuilder)
10891142
migrationBuilder.DropTable(
10901143
name: "AbpPermissions");
10911144

1145+
migrationBuilder.DropTable(
1146+
name: "AbpResourcePermissionGrants");
1147+
10921148
migrationBuilder.DropTable(
10931149
name: "AbpRoleClaims");
10941150

@@ -1119,6 +1175,9 @@ protected override void Down(MigrationBuilder migrationBuilder)
11191175
migrationBuilder.DropTable(
11201176
name: "AbpUserOrganizationUnits");
11211177

1178+
migrationBuilder.DropTable(
1179+
name: "AbpUserPasskeys");
1180+
11221181
migrationBuilder.DropTable(
11231182
name: "AbpUserPasswordHistories");
11241183

0 commit comments

Comments
 (0)