Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Refactor upgrade schema to remove column default.

Kailash Nadh4de5d53fe455
diff --git a/internal/migrations/v2.2.0.go b/internal/migrations/v2.2.0.go
index 2863c0e7..21082949 100644
--- a/internal/migrations/v2.2.0.go
+++ b/internal/migrations/v2.2.0.go
@@ -23,7 +23,10 @@ func V2_2_0(db *sqlx.DB, fs stuffbin.FileSystem, ko *koanf.Koanf) error {
return err
}
- if _, err := db.Exec(`ALTER TABLE templates ADD COLUMN IF NOT EXISTS "subject" TEXT NOT NULL`); err != nil {
+ if _, err := db.Exec(`ALTER TABLE templates ADD COLUMN IF NOT EXISTS subject TEXT NOT NULL DEFAULT ''`); err != nil {
+ return err
+ }
+ if _, err := db.Exec(`ALTER TABLE templates ALTER COLUMN subject DROP DEFAULT`); err != nil {
return err
}