-- 向adm_organization表添加缺失字段的SQL脚本

-- 添加register_flag字段（对应registerFlag属性）
ALTER TABLE "adm_organization" 
ADD COLUMN "register_flag" int4;

-- 添加location字段
ALTER TABLE "adm_organization" 
ADD COLUMN "location" varchar(255);

-- 添加intro字段
ALTER TABLE "adm_organization" 
ADD COLUMN "intro" varchar(1000);

-- 添加remark字段
ALTER TABLE "adm_organization" 
ADD COLUMN "remark" varchar(1000);

-- 添加字段注释
COMMENT ON COLUMN "adm_organization"."register_flag" IS '挂号标志';
COMMENT ON COLUMN "adm_organization"."location" IS '科室位置';
COMMENT ON COLUMN "adm_organization"."intro" IS '科室简介';
COMMENT ON COLUMN "adm_organization"."remark" IS '备注';

-- 设置register_flag默认值为0（不允许挂号）
ALTER TABLE "adm_organization" 
ALTER COLUMN "register_flag" SET DEFAULT 0;
