feat(db): migration 106 also drops the request enums
release / go (push) Failing after 1m16s
release / web (push) Successful in 1m15s
release / govulncheck (push) Successful in 19s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / android (push) Canceled after 2m16s
release / Build signed APK (push) Canceled after 1m7s
release / integration (push) Canceled after 3m40s
release / go (push) Failing after 1m16s
release / web (push) Successful in 1m15s
release / govulncheck (push) Successful in 19s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / android (push) Canceled after 2m16s
release / Build signed APK (push) Canceled after 1m7s
release / integration (push) Canceled after 3m40s
request_kind and request_status were the requests table's column types and outlived it. No database has run 106 yet, so it carries the drop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -100,94 +100,6 @@ func (ns NullQuarantineReason) Value() (driver.Value, error) {
|
|||||||
return string(ns.QuarantineReason), nil
|
return string(ns.QuarantineReason), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type RequestKind string
|
|
||||||
|
|
||||||
const (
|
|
||||||
RequestKindArtist RequestKind = "artist"
|
|
||||||
RequestKindAlbum RequestKind = "album"
|
|
||||||
RequestKindTrack RequestKind = "track"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (e *RequestKind) Scan(src interface{}) error {
|
|
||||||
switch s := src.(type) {
|
|
||||||
case []byte:
|
|
||||||
*e = RequestKind(s)
|
|
||||||
case string:
|
|
||||||
*e = RequestKind(s)
|
|
||||||
default:
|
|
||||||
return fmt.Errorf("unsupported scan type for RequestKind: %T", src)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type NullRequestKind struct {
|
|
||||||
RequestKind RequestKind
|
|
||||||
Valid bool // Valid is true if RequestKind is not NULL
|
|
||||||
}
|
|
||||||
|
|
||||||
// Scan implements the Scanner interface.
|
|
||||||
func (ns *NullRequestKind) Scan(value interface{}) error {
|
|
||||||
if value == nil {
|
|
||||||
ns.RequestKind, ns.Valid = "", false
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
ns.Valid = true
|
|
||||||
return ns.RequestKind.Scan(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Value implements the driver Valuer interface.
|
|
||||||
func (ns NullRequestKind) Value() (driver.Value, error) {
|
|
||||||
if !ns.Valid {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
return string(ns.RequestKind), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type RequestStatus string
|
|
||||||
|
|
||||||
const (
|
|
||||||
RequestStatusPending RequestStatus = "pending"
|
|
||||||
RequestStatusApproved RequestStatus = "approved"
|
|
||||||
RequestStatusRejected RequestStatus = "rejected"
|
|
||||||
RequestStatusCompleted RequestStatus = "completed"
|
|
||||||
RequestStatusFailed RequestStatus = "failed"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (e *RequestStatus) Scan(src interface{}) error {
|
|
||||||
switch s := src.(type) {
|
|
||||||
case []byte:
|
|
||||||
*e = RequestStatus(s)
|
|
||||||
case string:
|
|
||||||
*e = RequestStatus(s)
|
|
||||||
default:
|
|
||||||
return fmt.Errorf("unsupported scan type for RequestStatus: %T", src)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type NullRequestStatus struct {
|
|
||||||
RequestStatus RequestStatus
|
|
||||||
Valid bool // Valid is true if RequestStatus is not NULL
|
|
||||||
}
|
|
||||||
|
|
||||||
// Scan implements the Scanner interface.
|
|
||||||
func (ns *NullRequestStatus) Scan(value interface{}) error {
|
|
||||||
if value == nil {
|
|
||||||
ns.RequestStatus, ns.Valid = "", false
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
ns.Valid = true
|
|
||||||
return ns.RequestStatus.Scan(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Value implements the driver Valuer interface.
|
|
||||||
func (ns NullRequestStatus) Value() (driver.Value, error) {
|
|
||||||
if !ns.Valid {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
return string(ns.RequestStatus), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type AcoustidSetting struct {
|
type AcoustidSetting struct {
|
||||||
ID bool
|
ID bool
|
||||||
Enabled bool
|
Enabled bool
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
CREATE TYPE request_kind AS ENUM ('artist', 'album', 'track');
|
||||||
|
CREATE TYPE request_status AS ENUM ('pending', 'approved', 'rejected', 'completed', 'failed');
|
||||||
|
|
||||||
ALTER TABLE playback_errors
|
ALTER TABLE playback_errors
|
||||||
DROP CONSTRAINT playback_errors_resolution_check,
|
DROP CONSTRAINT playback_errors_resolution_check,
|
||||||
ADD CONSTRAINT playback_errors_resolution_check
|
ADD CONSTRAINT playback_errors_resolution_check
|
||||||
|
|||||||
@@ -5,3 +5,7 @@ ALTER TABLE playback_errors
|
|||||||
DROP CONSTRAINT playback_errors_resolution_check,
|
DROP CONSTRAINT playback_errors_resolution_check,
|
||||||
ADD CONSTRAINT playback_errors_resolution_check
|
ADD CONSTRAINT playback_errors_resolution_check
|
||||||
CHECK (resolution IS NULL OR resolution IN ('hidden', 'deleted', 'fixed', 'ignored'));
|
CHECK (resolution IS NULL OR resolution IN ('hidden', 'deleted', 'fixed', 'ignored'));
|
||||||
|
|
||||||
|
-- The enums the requests table used, left behind when it went.
|
||||||
|
DROP TYPE request_kind;
|
||||||
|
DROP TYPE request_status;
|
||||||
|
|||||||
Reference in New Issue
Block a user