From dbf2f99c4e233f672a69a0d0cf3c7f3941650cb9 Mon Sep 17 00:00:00 2001 From: Jovo Kljajic Date: Tue, 25 May 2021 09:03:49 +0200 Subject: [PATCH] Fixing issue with mysql migration and maxLength (#2541) --- .../Migrations/20210314092253_Fido2Credentials.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/BTCPayServer.Data/Migrations/20210314092253_Fido2Credentials.cs b/BTCPayServer.Data/Migrations/20210314092253_Fido2Credentials.cs index 6ec5bbdf7..0842644d5 100644 --- a/BTCPayServer.Data/Migrations/20210314092253_Fido2Credentials.cs +++ b/BTCPayServer.Data/Migrations/20210314092253_Fido2Credentials.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; using BTCPayServer.Data; using Microsoft.EntityFrameworkCore.Infrastructure; @@ -11,13 +11,14 @@ namespace BTCPayServer.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { + int? maxLength = this.IsMySql(migrationBuilder.ActiveProvider) ? (int?)255 : null; migrationBuilder.CreateTable( name: "Fido2Credentials", columns: table => new { - Id = table.Column(nullable: false), + Id = table.Column(nullable: false, maxLength: maxLength), Name = table.Column(nullable: true), - ApplicationUserId = table.Column(nullable: true), + ApplicationUserId = table.Column(nullable: true, maxLength: maxLength), Blob = table.Column(nullable: true), Type = table.Column(nullable: false) },