committed by
GitHub
12 changed files with 7514 additions and 26 deletions
File diff suppressed because it is too large
@ -0,0 +1,111 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace LY.MicroService.Applications.Single.EntityFrameworkCore.MySql.Migrations |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
public partial class FixMySqlIndexKeyTooLangForResourcePermissionGrant : Migration |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropIndex( |
||||
|
name: "IX_AbpResourcePermissionGrants_TenantId_Name_ResourceName_Resou~", |
||||
|
table: "AbpResourcePermissionGrants"); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<Guid>( |
||||
|
name: "EntityId", |
||||
|
table: "Demo_BooksAuths", |
||||
|
type: "char(64)", |
||||
|
maxLength: 64, |
||||
|
nullable: false, |
||||
|
collation: "ascii_general_ci", |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "char(64)", |
||||
|
oldMaxLength: 64) |
||||
|
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "ResourceName", |
||||
|
table: "AbpResourcePermissionGrants", |
||||
|
type: "varchar(128)", |
||||
|
maxLength: 128, |
||||
|
nullable: false, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "varchar(256)", |
||||
|
oldMaxLength: 256) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4") |
||||
|
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "ResourceKey", |
||||
|
table: "AbpResourcePermissionGrants", |
||||
|
type: "varchar(128)", |
||||
|
maxLength: 128, |
||||
|
nullable: false, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "varchar(256)", |
||||
|
oldMaxLength: 256) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4") |
||||
|
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpResourcePermissionGrants_TenantId_Name_ResourceName_Resou~", |
||||
|
table: "AbpResourcePermissionGrants", |
||||
|
columns: new[] { "TenantId", "Name", "ResourceName", "ResourceKey", "ProviderName", "ProviderKey" }, |
||||
|
unique: true); |
||||
|
} |
||||
|
|
||||
|
/// <inheritdoc />
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropIndex( |
||||
|
name: "IX_AbpResourcePermissionGrants_TenantId_Name_ResourceName_Resou~", |
||||
|
table: "AbpResourcePermissionGrants"); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "EntityId", |
||||
|
table: "Demo_BooksAuths", |
||||
|
type: "char(64)", |
||||
|
maxLength: 64, |
||||
|
nullable: false, |
||||
|
oldClrType: typeof(Guid), |
||||
|
oldType: "char(64)", |
||||
|
oldMaxLength: 64) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4") |
||||
|
.OldAnnotation("Relational:Collation", "ascii_general_ci"); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "ResourceName", |
||||
|
table: "AbpResourcePermissionGrants", |
||||
|
type: "varchar(256)", |
||||
|
maxLength: 256, |
||||
|
nullable: false, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "varchar(128)", |
||||
|
oldMaxLength: 128) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4") |
||||
|
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "ResourceKey", |
||||
|
table: "AbpResourcePermissionGrants", |
||||
|
type: "varchar(256)", |
||||
|
maxLength: 256, |
||||
|
nullable: false, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "varchar(128)", |
||||
|
oldMaxLength: 128) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4") |
||||
|
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpResourcePermissionGrants_TenantId_Name_ResourceName_Resou~", |
||||
|
table: "AbpResourcePermissionGrants", |
||||
|
columns: new[] { "TenantId", "ResourceName", "ResourceKey", "ProviderName", "ProviderKey" }, |
||||
|
unique: true); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
File diff suppressed because it is too large
@ -0,0 +1,86 @@ |
|||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace LY.MicroService.BackendAdmin.EntityFrameworkCore.Migrations |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
public partial class FixMySqlIndexKeyTooLangForResourcePermissionGrant : Migration |
||||
|
{ |
||||
|
/// <inheritdoc />
|
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropIndex( |
||||
|
name: "IX_AbpResourcePermissionGrants_TenantId_Name_ResourceName_Resou~", |
||||
|
table: "AbpResourcePermissionGrants"); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "ResourceName", |
||||
|
table: "AbpResourcePermissionGrants", |
||||
|
type: "varchar(128)", |
||||
|
maxLength: 128, |
||||
|
nullable: false, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "varchar(256)", |
||||
|
oldMaxLength: 256) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4") |
||||
|
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "ResourceKey", |
||||
|
table: "AbpResourcePermissionGrants", |
||||
|
type: "varchar(128)", |
||||
|
maxLength: 128, |
||||
|
nullable: false, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "varchar(256)", |
||||
|
oldMaxLength: 256) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4") |
||||
|
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpResourcePermissionGrants_TenantId_Name_ResourceName_Resou~", |
||||
|
table: "AbpResourcePermissionGrants", |
||||
|
columns: new[] { "TenantId", "Name", "ResourceName", "ResourceKey", "ProviderName", "ProviderKey" }, |
||||
|
unique: true); |
||||
|
} |
||||
|
|
||||
|
/// <inheritdoc />
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropIndex( |
||||
|
name: "IX_AbpResourcePermissionGrants_TenantId_Name_ResourceName_Resou~", |
||||
|
table: "AbpResourcePermissionGrants"); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "ResourceName", |
||||
|
table: "AbpResourcePermissionGrants", |
||||
|
type: "varchar(256)", |
||||
|
maxLength: 256, |
||||
|
nullable: false, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "varchar(128)", |
||||
|
oldMaxLength: 128) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4") |
||||
|
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
||||
|
|
||||
|
migrationBuilder.AlterColumn<string>( |
||||
|
name: "ResourceKey", |
||||
|
table: "AbpResourcePermissionGrants", |
||||
|
type: "varchar(256)", |
||||
|
maxLength: 256, |
||||
|
nullable: false, |
||||
|
oldClrType: typeof(string), |
||||
|
oldType: "varchar(128)", |
||||
|
oldMaxLength: 128) |
||||
|
.Annotation("MySql:CharSet", "utf8mb4") |
||||
|
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpResourcePermissionGrants_TenantId_Name_ResourceName_Resou~", |
||||
|
table: "AbpResourcePermissionGrants", |
||||
|
columns: new[] { "TenantId", "ResourceName", "ResourceKey", "ProviderName", "ProviderKey" }, |
||||
|
unique: true); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue