BEGIN; ALTER TABLE firmware_release ALTER COLUMN household_id DROP NOT NULL, ADD COLUMN release_channel varchar(24) NOT NULL DEFAULT 'STABLE' CHECK (release_channel IN ('STABLE','BETA','INTERNAL')), ADD COLUMN mandatory boolean NOT NULL DEFAULT false, ADD COLUMN published_at timestamptz, ADD COLUMN created_source varchar(24) NOT NULL DEFAULT 'CUSTOMER' CHECK (created_source IN ('CUSTOMER','OPS')); ALTER TABLE firmware_rollout ALTER COLUMN household_id DROP NOT NULL; COMMENT ON COLUMN firmware_release.household_id IS 'Optional customer household scope. NULL denotes a tenant-wide release created from the maintenance portal.'; COMMENT ON COLUMN firmware_release.created_source IS 'Identifies whether the release was created from the customer portal or the maintenance portal.'; COMMENT ON COLUMN firmware_rollout.household_id IS 'Optional customer household scope. NULL denotes a tenant-wide rollout created from the maintenance portal.'; COMMIT;