Add log for auto-htmx migration step (#59)

This commit is contained in:
2026-07-06 08:24:24 -04:00
parent fcd02ecbec
commit be6251b6ec
3 changed files with 3 additions and 0 deletions
+1
View File
@@ -228,6 +228,7 @@ type PostgresData(log: ILogger<PostgresData>, 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"
+1
View File
@@ -264,6 +264,7 @@ type RethinkDbData(conn: Net.IConnection, config: DataConfig, log: ILogger<Rethi
update [ nameof WebLog.Empty.AutoOpenGraph, true :> 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
+1
View File
@@ -456,6 +456,7 @@ type SQLiteData(conn: SqliteConnection, log: ILogger<SQLiteData>, 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"