From 211b1456c7f0befce0022e95217eeb5a6b482e09 Mon Sep 17 00:00:00 2001 From: Nazar Kanaev Date: Wed, 7 Apr 2021 20:54:34 +0100 Subject: [PATCH] no more null dates --- src/storage/migration.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/storage/migration.go b/src/storage/migration.go index 3ff8c07..a4688bd 100644 --- a/src/storage/migration.go +++ b/src/storage/migration.go @@ -12,6 +12,7 @@ var migrations = []func(*sql.Tx) error{ m03_on_delete_actions, m04_item_podcasturl, m05_move_description_to_content, + m06_fill_missing_dates, } var maxVersion = int64(len(migrations)) @@ -250,3 +251,11 @@ func m05_move_description_to_content(tx *sql.Tx) error { _, err := tx.Exec(sql) return err } + +func m06_fill_missing_dates(tx *sql.Tx) error { + sql := ` + update items set date = 0 where date is null; + ` + _, err := tx.Exec(sql) + return err +}