ALTER TABLE doc_inventory_item_static RENAME COLUMN category_code TO dev_category_code;
ALTER TABLE doc_inventory_item_static ADD med_category_code varchar(255) DEFAULT '0'::character varying NOT NULL;
COMMENT ON COLUMN doc_inventory_item_static.med_category_code IS '药品类别';
ALTER TABLE doc_inventory_item_static ADD total_price numeric(20, 6) NULL;
COMMENT ON COLUMN doc_inventory_item_static.total_price IS '采购总价(包装单位)';
ALTER TABLE doc_inventory_item_static ADD total_sale_price numeric(20, 6) NULL;
COMMENT ON COLUMN doc_inventory_item_static.total_sale_price IS '销售总价(包装单位)';
ALTER TABLE doc_inventory_item_static ADD remaining_days int4 NULL;
COMMENT ON COLUMN doc_inventory_item_static.remaining_days IS '剩余过期天数';
ALTER TABLE doc_inventory_item_static ADD inventory_id int8 NULL;
COMMENT ON COLUMN doc_inventory_item_static.inventory_id IS '库存id';
ALTER TABLE doc_inventory_item_static ADD yb_no varchar(255) DEFAULT ''::character varying NOT NULL;
COMMENT ON COLUMN doc_inventory_item_static.yb_no IS '医保码';
ALTER TABLE doc_inventory_item_static ADD remainder numeric(20, 6) DEFAULT 0 NOT NULL;
COMMENT ON COLUMN doc_inventory_item_static.remainder IS '包装单位数量（余数部分）';
ALTER TABLE doc_inventory_item_static ADD approval_number varchar(255) DEFAULT ''::character varying NOT NULL;
COMMENT ON COLUMN doc_inventory_item_static.approval_number IS '批准文号';
ALTER TABLE doc_inventory_item_static ALTER COLUMN med_category_code DROP NOT NULL;
ALTER TABLE doc_inventory_item_static ALTER COLUMN med_category_code DROP DEFAULT;
ALTER TABLE doc_inventory_item_static ALTER COLUMN dev_category_code DROP NOT NULL;
ALTER TABLE doc_inventory_item_static ALTER COLUMN dev_category_code DROP DEFAULT;
ALTER TABLE doc_inventory_item_static ADD static_no varchar(255) DEFAULT ''::character varying NOT NULL;
COMMENT ON COLUMN doc_inventory_item_static.static_no IS '项目编号';
COMMENT ON COLUMN doc_inventory_item_static.bus_no IS '备份单据编号';
ALTER TABLE doc_inventory_item_static RENAME COLUMN static_no TO item_no;
ALTER TABLE doc_inventory_item_static ADD "number" numeric(20, 6) DEFAULT 0 NOT NULL;
COMMENT ON COLUMN doc_inventory_item_static."number" IS '包装单位数量（整数部分）';
   -- Insert migration record
INSERT INTO __MigrationsHistory (MigrationId, ProductVersion)
VALUES ('202511131215 add_table doc_inventory_item_static', '1.0.0');