@@ -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