mirror of
https://github.com/knadh/listmonk.git
synced 2024-09-20 15:26:33 +08:00
c38100427d
- Add new `meta` JSONB field to `media` table. - Start storing image width and height as meta with media uploads.
17 lines
386 B
Go
17 lines
386 B
Go
package migrations
|
|
|
|
import (
|
|
"github.com/jmoiron/sqlx"
|
|
"github.com/knadh/koanf"
|
|
"github.com/knadh/stuffbin"
|
|
)
|
|
|
|
// V2_2_0 performs the DB migrations for v.2.2.0.
|
|
func V2_3_0(db *sqlx.DB, fs stuffbin.FileSystem, ko *koanf.Koanf) error {
|
|
if _, err := db.Exec(`ALTER TABLE media ADD COLUMN IF NOT EXISTS "meta" JSONB NOT NULL DEFAULT '{}'`); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|