1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-18 11:46:23 -07:00

Add warning when migrating a SQLite database in-place

This commit is contained in:
Eggbertx 2025-01-25 13:01:52 -08:00
parent 65d4dee673
commit 12350cc33f

View file

@ -95,8 +95,14 @@ func main() {
Msg("Starting database migration")
config.InitConfig(versionStr)
sqlCfg := config.GetSQLConfig()
if migratingInPlace && sqlCfg.DBtype == "sqlite3" && !updateDB {
common.LogWarning().
Str("dbType", sqlCfg.DBtype).
Bool("migrateInPlace", migratingInPlace).
Msg("SQLite has limitations with table column changes")
}
if !migratingInPlace {
sqlCfg := config.GetSQLConfig()
err = gcsql.ConnectToDB(&sqlCfg)
if err != nil {
fatalEv.Err(err).Caller().Msg("Failed to connect to the database")