From be6251b6ec952a2adbcf4d455aafbbf152a6890a Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Mon, 6 Jul 2026 08:24:24 -0400 Subject: [PATCH] Add log for auto-htmx migration step (#59) --- src/MyWebLog.Data/PostgresData.fs | 1 + src/MyWebLog.Data/RethinkDbData.fs | 1 + src/MyWebLog.Data/SQLiteData.fs | 1 + 3 files changed, 3 insertions(+) diff --git a/src/MyWebLog.Data/PostgresData.fs b/src/MyWebLog.Data/PostgresData.fs index 0fde5f5..fa02e1a 100644 --- a/src/MyWebLog.Data/PostgresData.fs +++ b/src/MyWebLog.Data/PostgresData.fs @@ -228,6 +228,7 @@ type PostgresData(log: ILogger, ser: JsonSerializer) = let migrateV2point2ToV3 () = backgroundTask { Utils.Migration.logStep log "v2.2 to v3" "Adding auto-OpenGraph flag to all web logs" do! Patch.byFields Table.WebLog Any [ Field.Exists (nameof WebLog.Empty.Id) ] {| AutoOpenGraph = true |} + Utils.Migration.logStep log "v2.2 to v3" "Converting auto-htmx flag to choices" do! Patch.byContains Table.WebLog {| AutoHtmx = true |} {| AutoHtmx = "Yes" |} do! Patch.byContains Table.WebLog {| AutoHtmx = false |} {| AutoHtmx = "No" |} Utils.Migration.logStep log "v2.2 to v3" "Setting database version to v3" diff --git a/src/MyWebLog.Data/RethinkDbData.fs b/src/MyWebLog.Data/RethinkDbData.fs index c3f3423..6f28370 100644 --- a/src/MyWebLog.Data/RethinkDbData.fs +++ b/src/MyWebLog.Data/RethinkDbData.fs @@ -264,6 +264,7 @@ type RethinkDbData(conn: Net.IConnection, config: DataConfig, log: ILogger obj ] write; withRetryOnce; ignoreResult conn } + Utils.Migration.logStep log "v2.2 to v3" "Converting auto-htmx flag to choices" do! rethink { withTable Table.WebLog filter (nameof WebLog.Empty.AutoHtmx) true diff --git a/src/MyWebLog.Data/SQLiteData.fs b/src/MyWebLog.Data/SQLiteData.fs index 48e5bd6..2906ebf 100644 --- a/src/MyWebLog.Data/SQLiteData.fs +++ b/src/MyWebLog.Data/SQLiteData.fs @@ -456,6 +456,7 @@ type SQLiteData(conn: SqliteConnection, log: ILogger, ser: JsonSeria let migrateV2point2ToV3 () = backgroundTask { Utils.Migration.logStep log "v2.2 to v3" "Adding auto-OpenGraph flag to all web logs" do! Patch.byFields Table.WebLog Any [ Field.Exists (nameof WebLog.Empty.Id) ] {| AutoOpenGraph = true |} + Utils.Migration.logStep log "v2.2 to v3" "Converting auto-htmx flag to choices" do! Patch.byFields Table.WebLog Any [ Field.Equal (nameof WebLog.Empty.AutoHtmx) true ] {| AutoHtmx = "Yes" |} do! Patch.byFields Table.WebLog Any [ Field.Equal (nameof WebLog.Empty.AutoHtmx) false ] {| AutoHtmx = "No" |} Utils.Migration.logStep log "v2.2 to v3" "Setting database version to v3"