-
-
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.
Store and Server branding can reference file's via fileid:ID
- Loading branch information
1 parent
a313f07
commit b069c38
Showing
32 changed files
with
365 additions
and
198 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
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
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.