-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove deprecated CSS options Closes #5945. * Greenfield: Add brandColor to store APIs Closes #5946. * Migrate file IDs to URLs Closes #5953. * Greenfield: Add CSS and logo URL to store settings API Closes #5945. * Add migration test * Store and Server branding can reference file's via fileid:ID * Add PaymentSoundUrl to Store API --------- Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
- Loading branch information
1 parent
eba3475
commit 4c303d3
Showing
66 changed files
with
526 additions
and
605 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using BTCPayServer.Data; | ||
using Microsoft.EntityFrameworkCore.Infrastructure; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace BTCPayServer.Migrations | ||
{ | ||
[DbContext(typeof(ApplicationDbContext))] | ||
[Migration("20240508015052_fileid")] | ||
public partial class fileid : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.Sql(""" | ||
UPDATE "Settings" | ||
SET "Value" = jsonb_set( | ||
"Value", | ||
'{LogoUrl}', | ||
to_jsonb('fileid:' || ("Value"->>'LogoFileId'))) - 'LogoFileId' | ||
WHERE "Id" = 'BTCPayServer.Services.ThemeSettings' | ||
AND "Value"->>'LogoFileId' IS NOT NULL; | ||
|
||
UPDATE "Settings" | ||
SET "Value" = jsonb_set( | ||
"Value", | ||
'{CustomThemeCssUrl}', | ||
to_jsonb('fileid:' || ("Value"->>'CustomThemeFileId'))) - 'CustomThemeFileId' | ||
WHERE "Id" = 'BTCPayServer.Services.ThemeSettings' | ||
AND "Value"->>'CustomThemeFileId' IS NOT NULL; | ||
|
||
UPDATE "Stores" | ||
SET "StoreBlob" = jsonb_set( | ||
"StoreBlob", | ||
'{logoUrl}', | ||
to_jsonb('fileid:' || ("StoreBlob"->>'logoFileId'))) - 'logoFileId' | ||
WHERE "StoreBlob"->>'logoFileId' IS NOT NULL; | ||
|
||
UPDATE "Stores" | ||
SET "StoreBlob" = jsonb_set( | ||
"StoreBlob", | ||
'{cssUrl}', | ||
to_jsonb('fileid:' || ("StoreBlob"->>'cssFileId'))) - 'cssFileId' | ||
WHERE "StoreBlob"->>'cssFileId' IS NOT NULL; | ||
|
||
UPDATE "Stores" | ||
SET "StoreBlob" = jsonb_set( | ||
"StoreBlob", | ||
'{paymentSoundUrl}', | ||
to_jsonb('fileid:' || ("StoreBlob"->>'soundFileId'))) - 'soundFileId' | ||
WHERE "StoreBlob"->>'soundFileId' IS NOT NULL; | ||
"""); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.