Fix null values in DB (#2840)

* Fix album image_files being null.

* Fix small nitpick.

* Use ExecContext instead of Exec.

* Change more columns to not null and set default values.

* Remove columns that don't need to be changed from migration.

* Fix typo.

* Remove unnecessary select statements.

* Remove duplicate code.

* Do not apply changes to radio table.

* Do not apply changes full_text columns and respective indexes.

* Fix musicbrainz columns.

* Rename migration.

* Make ExternalInfoUpdatedAt nullable

* Make Share's timestamps nullable

---------

Co-authored-by: Deluan Quintão <deluan@navidrome.org>
This commit is contained in:
Caio Cotts
2024-02-07 17:45:08 -08:00
committed by GitHub
parent ac4ceab143
commit bf2bcb1279
11 changed files with 693 additions and 84 deletions
+14
View File
@@ -30,3 +30,17 @@ func FirstOr[T comparable](or T, values ...T) T {
// If all the input values are zero, return the default value.
return or
}
// P returns a pointer to the input value
func P[T any](v T) *T {
return &v
}
// V returns the value of the input pointer, or a zero value if the input pointer is nil.
func V[T any](p *T) T {
if p == nil {
var zero T
return zero
}
return *p
}