ALTER TABLE "public"."med_medication_request" 
ALTER COLUMN "quantity" TYPE numeric(20,6),
ALTER COLUMN "quantity" SET DEFAULT 0,
ALTER COLUMN "quantity" SET NOT NULL;

ALTER TABLE "public"."med_medication_request" 
ALTER COLUMN "chinese_herbs_dose_quantity" TYPE numeric(20,6),
ALTER COLUMN "chinese_herbs_dose_quantity" SET DEFAULT 0;


ALTER TABLE "public"."wor_service_request" 
ALTER COLUMN "quantity" TYPE numeric(20,6),
ALTER COLUMN "quantity" SET DEFAULT 0,
ALTER COLUMN "quantity" SET NOT NULL;


ALTER TABLE "public"."wor_device_request" 
ALTER COLUMN "quantity" TYPE numeric(20,6),
ALTER COLUMN "quantity" SET DEFAULT 0,
ALTER COLUMN "quantity" SET NOT NULL;


ALTER TABLE "public"."adm_charge_item" 
ALTER COLUMN "quantity_value" TYPE numeric(20,6),
ALTER COLUMN "quantity_value" SET DEFAULT 0,
ALTER COLUMN "quantity_value" SET NOT NULL;

ALTER TABLE "public"."med_medication_dispense" 
ALTER COLUMN "quantity" TYPE numeric(20,6),
ALTER COLUMN "quantity" SET DEFAULT 0,
ALTER COLUMN "quantity" SET NOT NULL;

ALTER TABLE "public"."wor_device_dispense" 
ALTER COLUMN "quantity" TYPE numeric(20,6),
ALTER COLUMN "quantity" SET DEFAULT 0,
ALTER COLUMN "quantity" SET NOT NULL;


ALTER TABLE "public"."med_medication_dispense" 
ALTER COLUMN "dispense_quantity" TYPE numeric(20,6),
ALTER COLUMN "dispense_quantity" SET DEFAULT 0,
ALTER COLUMN "dispense_quantity" SET NOT NULL;

ALTER TABLE "public"."wor_device_dispense" 
ALTER COLUMN "dispense_quantity" TYPE numeric(20,6),
ALTER COLUMN "dispense_quantity" SET DEFAULT 0,
ALTER COLUMN "dispense_quantity" SET NOT NULL;



ALTER TABLE "public"."tmp_activity_device" 
ALTER COLUMN "quantity" TYPE numeric(20,6),
ALTER COLUMN "quantity" SET DEFAULT 0,
ALTER COLUMN "quantity" SET NOT NULL;

-- 插入修改xx_request表的迁移记录
INSERT INTO __MigrationsHistory (MigrationId, ProductVersion)
VALUES ('202509040915alter_table_xx_request', '1.0.0');