-- 为device_ledger表添加新字段
-- 执行日期: 2026-06-11

-- 添加所属分区ID字段
ALTER TABLE device_ledger ADD COLUMN IF NOT EXISTS zone_id VARCHAR(255);

-- 添加安装位置字段
ALTER TABLE device_ledger ADD COLUMN IF NOT EXISTS install_location VARCHAR(500);

-- 添加生产日期字段
ALTER TABLE device_ledger ADD COLUMN IF NOT EXISTS production_time TIMESTAMP;

-- 添加购置日期字段
ALTER TABLE device_ledger ADD COLUMN IF NOT EXISTS purchase_time TIMESTAMP;

-- 添加品牌字段
ALTER TABLE device_ledger ADD COLUMN IF NOT EXISTS brand VARCHAR(255);

-- 添加品牌负责人字段
ALTER TABLE device_ledger ADD COLUMN IF NOT EXISTS person_in_charge VARCHAR(255);

-- 添加字段注释
COMMENT ON COLUMN device_ledger.zone_id IS '所属分区ID';
COMMENT ON COLUMN device_ledger.install_location IS '安装位置';
COMMENT ON COLUMN device_ledger.production_time IS '生产日期';
COMMENT ON COLUMN device_ledger.purchase_time IS '购置日期';
COMMENT ON COLUMN device_ledger.brand IS '品牌';
COMMENT ON COLUMN device_ledger.person_in_charge IS '品牌负责人';
