
   
   -- 创建序列
	CREATE SEQUENCE nd_review_prescription_records_id_seq
		START WITH 1
		INCREMENT BY 1
		NO MINVALUE
		NO MAXVALUE
		CACHE 1;


CREATE TABLE "nd_review_prescription_records" (
  "id" int8 NOT NULL DEFAULT nextval('nd_review_prescription_records_id_seq'::regclass),
  "prescription_no" varchar(255) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
  "encounter_id" int8 DEFAULT NULL,
  "med_request_ids" text DEFAULT NULL,
  "pass_flag" int4 NOT NULL DEFAULT 1,
  "reason_text" varchar(500) COLLATE "pg_catalog"."default" DEFAULT ''::character varying,
  "practitioner_id" int8 DEFAULT NULL,
  "tenant_id" int8 NOT NULL,
  "delete_flag" char(1) COLLATE "pg_catalog"."default" NOT NULL DEFAULT 0,
  "create_by" varchar(32) COLLATE "pg_catalog"."default" NOT NULL DEFAULT ''::character varying,
  "create_time" timestamptz(6) NOT NULL,
  "update_by" varchar(32) COLLATE "pg_catalog"."default",
  "update_time" timestamptz(6),
  CONSTRAINT "nd_review_prescription_records_pkey" PRIMARY KEY ("id")
)
;

ALTER TABLE "nd_review_prescription_records" 
  OWNER TO "postgres";

COMMENT ON COLUMN "nd_review_prescription_records"."id" IS 'ID';

COMMENT ON COLUMN "nd_review_prescription_records"."prescription_no" IS '处方号';

COMMENT ON COLUMN "nd_review_prescription_records"."encounter_id" IS '就诊id';

COMMENT ON COLUMN "nd_review_prescription_records"."med_request_ids" IS '药品请求ids';

COMMENT ON COLUMN "nd_review_prescription_records"."pass_flag" IS '通过标识';

COMMENT ON COLUMN "nd_review_prescription_records"."reason_text" IS '原因';

COMMENT ON COLUMN "nd_review_prescription_records"."practitioner_id" IS '审方人id';

COMMENT ON COLUMN "nd_review_prescription_records"."tenant_id" IS '租户ID';

COMMENT ON COLUMN "nd_review_prescription_records"."delete_flag" IS '删除状态';

COMMENT ON COLUMN "nd_review_prescription_records"."create_by" IS '创建人';

COMMENT ON COLUMN "nd_review_prescription_records"."create_time" IS '创建时间';

COMMENT ON COLUMN "nd_review_prescription_records"."update_by" IS '更新人';

COMMENT ON COLUMN "nd_review_prescription_records"."update_time" IS '更新时间';

COMMENT ON TABLE "nd_review_prescription_records" IS '农大审方记录';	



   -- 插入为tmp_activity_device表添加列的迁移记录
INSERT INTO __MigrationsHistory (MigrationId, ProductVersion)
VALUES ('202509231011 add_table_nd_review_prescription_records', '1.0.0');