I use mySQL database for my project and want to create index on column.
I'm using codefirst approach
Here is my migration
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_RecruitmentAgencies_AbpTenants_TenantId",
table: "RecruitmentAgencies");
migrationBuilder.DropIndex(
name: "IX_RecruitmentAgencies_TenantId",
table: "RecruitmentAgencies");
migrationBuilder.AddColumn<string>(
name: "ContactEmail",
table: "RecruitmentAgencies",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_RecruitmentAgencies_ContactEmail",
table: "RecruitmentAgencies",
column: "ContactEmail");
}
and when I try to apply it, I get this error
BLOB/TEXT column 'ContactEmail' used in key specification without a key length
How I can fix this?