diff --git a/BTCPayServer.Data/Migrations/20190225091644_AddOpenIddict.cs b/BTCPayServer.Data/Migrations/20190225091644_AddOpenIddict.cs index cdc3b848b..fb6fb2d47 100644 --- a/BTCPayServer.Data/Migrations/20190225091644_AddOpenIddict.cs +++ b/BTCPayServer.Data/Migrations/20190225091644_AddOpenIddict.cs @@ -12,10 +12,6 @@ namespace BTCPayServer.Migrations protected override void Up(MigrationBuilder migrationBuilder) { int? maxLength = this.IsMySql(migrationBuilder.ActiveProvider) ? (int?)255 : null; - if (this.IsMySql(migrationBuilder.ActiveProvider)) - { - migrationBuilder.AlterColumn(name: "Id", table: "AspNetUsers", maxLength: maxLength); - } migrationBuilder.CreateTable( name: "OpenIddictApplications", columns: table => new @@ -31,7 +27,8 @@ namespace BTCPayServer.Migrations Properties = table.Column(nullable: true), RedirectUris = table.Column(nullable: true), Type = table.Column(maxLength: 25, nullable: false), - ApplicationUserId = table.Column(nullable: true, maxLength: maxLength) + // do not set the maxLength, else http://MySql.Data.MySqlClient.MySqlException (0x80004005): Can't create table `btcpay`.`OpenIddictApplications` (errno: 150 "Foreign key constraint is incorrectly formed") + ApplicationUserId = table.Column(nullable: true) }, constraints: table => {