-- +goose Up ALTER TABLE attachments DROP CONSTRAINT attachments_status; ALTER TABLE attachments ADD CONSTRAINT attachments_status CHECK (status IN ('queued','processing','ready','failed')); ALTER TABLE attachments ADD COLUMN thumbnail jsonb NOT NULL DEFAULT '{}'; ALTER TABLE attachments ADD COLUMN error_code text; ALTER TABLE attachments ADD COLUMN attempts int NOT NULL DEFAULT 0; -- +goose Down ALTER TABLE attachments DROP COLUMN attempts; ALTER TABLE attachments DROP COLUMN error_code; ALTER TABLE attachments DROP COLUMN thumbnail;