Files
story/migrations/000046_ops_firmware_management.up.sql
Codex Local 0c2151ace9
ci / verify (push) Canceled after 0s
chore: checkpoint 第一版
2026-09-06 17:04:11 +08:00

23 lines
1008 B
PL/PgSQL

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;