Fix migration crash on postgres above 13.10

This commit is contained in:
nicolas.dorier 2024-05-10 22:13:08 +09:00
parent 11b38a7a4c
commit 2c4d87aef8
No known key found for this signature in database
GPG key ID: 6618763EF09186FE
3 changed files with 5 additions and 4 deletions

View file

@ -19,8 +19,8 @@ namespace BTCPayServer.Migrations
ALTER TABLE ""InvoiceEvents"" DROP CONSTRAINT IF EXISTS ""PK_InvoiceEvents""; ALTER TABLE ""InvoiceEvents"" DROP CONSTRAINT IF EXISTS ""PK_InvoiceEvents"";
ALTER TABLE ""InvoiceEvents"" DROP COLUMN IF EXISTS ""UniqueId""; ALTER TABLE ""InvoiceEvents"" DROP COLUMN IF EXISTS ""UniqueId"";
CREATE INDEX IF NOT EXISTS ""IX_InvoiceEvents_InvoiceDataId"" ON ""InvoiceEvents""(""InvoiceDataId""); CREATE INDEX IF NOT EXISTS ""IX_InvoiceEvents_InvoiceDataId"" ON ""InvoiceEvents""(""InvoiceDataId"");
VACUUM (FULL, ANALYZE) ""InvoiceEvents""; ");
", true); migrationBuilder.Sql(@"VACUUM (FULL, ANALYZE) ""InvoiceEvents"";", true);
} }
/// <inheritdoc /> /// <inheritdoc />

View file

@ -18,7 +18,8 @@ namespace BTCPayServer.Migrations
migrationBuilder.Sql(@" migrationBuilder.Sql(@"
DELETE FROM ""AddressInvoices"" WHERE ""Address"" LIKE '%_LightningLike'; DELETE FROM ""AddressInvoices"" WHERE ""Address"" LIKE '%_LightningLike';
ALTER TABLE ""AddressInvoices"" DROP COLUMN IF EXISTS ""CreatedTime""; ALTER TABLE ""AddressInvoices"" DROP COLUMN IF EXISTS ""CreatedTime"";
VACUUM (FULL, ANALYZE) ""AddressInvoices"";", true); ");
migrationBuilder.Sql(@"VACUUM (FULL, ANALYZE) ""AddressInvoices"";", true);
} }
/// <inheritdoc /> /// <inheritdoc />

View file

@ -205,7 +205,7 @@ services:
- bitcoind - bitcoind
postgres: postgres:
image: postgres:13.4 image: postgres:13.13
environment: environment:
POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_HOST_AUTH_METHOD: trust
ports: ports: