From 686f5bf151fb32886dd07ea4b21a51fd45ebe230 Mon Sep 17 00:00:00 2001 From: ketominer Date: Sun, 19 Apr 2020 11:15:06 +0200 Subject: [PATCH 1/2] Fix MySQL support (fixed width columns instead of blobs) --- BTCPayServer.Data/Migrations/20170913143004_Init.cs | 8 ++++---- BTCPayServer.Data/Migrations/20171010082424_Tokens.cs | 2 +- .../Migrations/20171024163354_RenewUsedAddresses.cs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/BTCPayServer.Data/Migrations/20170913143004_Init.cs b/BTCPayServer.Data/Migrations/20170913143004_Init.cs index e77143dac..d86651694 100644 --- a/BTCPayServer.Data/Migrations/20170913143004_Init.cs +++ b/BTCPayServer.Data/Migrations/20170913143004_Init.cs @@ -114,8 +114,8 @@ namespace BTCPayServer.Migrations name: "AspNetUserLogins", columns: table => new { - LoginProvider = table.Column(nullable: false), - ProviderKey = table.Column(nullable: false), + LoginProvider = table.Column(nullable: false, maxLength: 255), + ProviderKey = table.Column(nullable: false, maxLength: 255), ProviderDisplayName = table.Column(nullable: true), UserId = table.Column(nullable: false, maxLength: maxLength) }, @@ -159,8 +159,8 @@ namespace BTCPayServer.Migrations columns: table => new { UserId = table.Column(nullable: false, maxLength: maxLength), - LoginProvider = table.Column(nullable: false), - Name = table.Column(nullable: false), + LoginProvider = table.Column(nullable: false, maxLength: 64), + Name = table.Column(nullable: false, maxLength: 64), Value = table.Column(nullable: true) }, constraints: table => diff --git a/BTCPayServer.Data/Migrations/20171010082424_Tokens.cs b/BTCPayServer.Data/Migrations/20171010082424_Tokens.cs index 1e46a7a66..5fad5ceb8 100644 --- a/BTCPayServer.Data/Migrations/20171010082424_Tokens.cs +++ b/BTCPayServer.Data/Migrations/20171010082424_Tokens.cs @@ -22,7 +22,7 @@ namespace BTCPayServer.Migrations Label = table.Column(nullable: true), Name = table.Column(nullable: true), PairingTime = table.Column(nullable: false), - SIN = table.Column(nullable: true), + SIN = table.Column(nullable: true, maxLength: maxLength), StoreDataId = table.Column(nullable: true, maxLength: maxLength) }, constraints: table => diff --git a/BTCPayServer.Data/Migrations/20171024163354_RenewUsedAddresses.cs b/BTCPayServer.Data/Migrations/20171024163354_RenewUsedAddresses.cs index 2f75e139d..aca81f50c 100644 --- a/BTCPayServer.Data/Migrations/20171024163354_RenewUsedAddresses.cs +++ b/BTCPayServer.Data/Migrations/20171024163354_RenewUsedAddresses.cs @@ -23,7 +23,7 @@ namespace BTCPayServer.Migrations columns: table => new { InvoiceDataId = table.Column(nullable: false, maxLength: maxLength), - Address = table.Column(nullable: false), + Address = table.Column(nullable: false, maxLength: 250), Assigned = table.Column(nullable: false), UnAssigned = table.Column(nullable: true) }, From a7b926d907f53d3e8d7c7682af3736da15b9122f Mon Sep 17 00:00:00 2001 From: ketominer Date: Sun, 19 Apr 2020 13:48:05 +0200 Subject: [PATCH 2/2] fixed Address field size (back) --- .../Migrations/20171024163354_RenewUsedAddresses.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BTCPayServer.Data/Migrations/20171024163354_RenewUsedAddresses.cs b/BTCPayServer.Data/Migrations/20171024163354_RenewUsedAddresses.cs index aca81f50c..ae308e5c1 100644 --- a/BTCPayServer.Data/Migrations/20171024163354_RenewUsedAddresses.cs +++ b/BTCPayServer.Data/Migrations/20171024163354_RenewUsedAddresses.cs @@ -23,7 +23,7 @@ namespace BTCPayServer.Migrations columns: table => new { InvoiceDataId = table.Column(nullable: false, maxLength: maxLength), - Address = table.Column(nullable: false, maxLength: 250), + Address = table.Column(nullable: false, maxLength: this.IsMySql(migrationBuilder.ActiveProvider) ? (int?)512 : null), Assigned = table.Column(nullable: false), UnAssigned = table.Column(nullable: true) },