站内信表结构设计

---添加消息表
CREATE TABLE "MESSAGE_READ" (


"ID" NUMBER(18) NOT NULL,


"SEND_ID" NUMBER(18) NOT NULL,


"REC_ID" NUMBER(18) NOT NULL,


"MESSAGE_CONTENT_ID" NUMBER(18) NOT NULL,


"STATUS" NUMBER(5) DEFAULT 0 NULL,


"DELETE_FLAG" NUMBER(5) DEFAULT 0 NULL,


PRIMARY KEY ("ID") 


);
COMMENT ON TABLE "MESSAGE_READ" IS '消息表';


COMMENT ON COLUMN "MESSAGE_READ"."ID" IS '主键';


COMMENT ON COLUMN "MESSAGE_READ"."SEND_ID" IS '发送者ID';


COMMENT ON COLUMN "MESSAGE_READ"."REC_ID" IS '接受者ID';


COMMENT ON COLUMN "MESSAGE_READ"."MESSAGE_CONTENT_ID" IS '消息内容表ID(如为0,则接受者为所有人)';


COMMENT ON COLUMN "MESSAGE_READ"."STATUS" IS '状态,0-未读 1-已读';


COMMENT ON COLUMN "MESSAGE_READ"."DELETE_FLAG" IS '是否删除 0-未删除 1-已删除';




---添加消息内容表
CREATE TABLE "MESSAGE_CONTENT" (


"ID" NUMBER(18) NOT NULL,


"MESSAGE_TITLE" VARCHAR2(200) NOT NULL,


"MESSAGE_TEXT" VARCHAR2(4000) NOT NULL,


"CREATE_DATE" DATE DEFAULT SYSDATE NULL,


"DELETE_FLAG" NUMBER(5) DEFAULT 0 NULL,


PRIMARY KEY ("ID") 


);
COMMENT ON TABLE "MESSAGE_CONTENT" IS '消息内容表';


COMMENT ON COLUMN "MESSAGE_CONTENT"."ID" IS '主键';


COMMENT ON COLUMN "MESSAGE_CONTENT"."MESSAGE_TITLE" IS '消息标题';


COMMENT ON COLUMN "MESSAGE_CONTENT"."MESSAGE_TEXT" IS '消息内容';


COMMENT ON COLUMN "MESSAGE_CONTENT"."CREATE_DATE" IS '创建日期';


COMMENT ON COLUMN "MESSAGE_CONTENT"."DELETE_FLAG" IS '是否删除 0-未删除 1-已删除';


你可能感兴趣的:(站内信表结构设计)