drop table TABLEINFO cascade constraints
/
CREATE TABLE TABLEINFO
(
  TABLE_NAME          VARCHAR2(255)        NOT NULL,
  TABLE_ID_NAME       VARCHAR2(255),
  TABLE_ID_INCREMENT  NUMBER(5)                 DEFAULT 1,
  TABLE_ID_VALUE      NUMBER(20)                DEFAULT 0,
  TABLE_ID_GENERATOR  VARCHAR2(255),
  TABLE_ID_TYPE       VARCHAR2(255),
  TABLE_ID_PREFIX     VARCHAR2(255)
);

COMMENT ON TABLE TABLEINFO IS '表信息维护对象';

COMMENT ON COLUMN TABLEINFO.TABLE_NAME IS '表名称';


COMMENT ON COLUMN TABLEINFO.TABLE_ID_NAME IS '表的主键名称';

COMMENT ON COLUMN TABLEINFO.TABLE_ID_INCREMENT IS '表的主键递增量
缺省为1';

COMMENT ON COLUMN TABLEINFO.TABLE_ID_VALUE IS '主键当前值：缺省为0';

COMMENT ON COLUMN TABLEINFO.TABLE_ID_GENERATOR IS '自定义表主键生成机制
必需从
com.frameworkset.common.poolman.sql.PrimaryKey集成';

COMMENT ON COLUMN TABLEINFO.TABLE_ID_TYPE IS '主键类型（string,int）';

COMMENT ON COLUMN TABLEINFO.TABLE_ID_PREFIX IS '类型为string的主键前缀，可指定可不指定,缺省值为""';


CREATE UNIQUE INDEX PK_TABLEINFO0 ON TABLEINFO(TABLE_NAME)
/


ALTER TABLE TABLEINFO ADD   CONSTRAINT PK_TABLEINFO0 PRIMARY KEY (TABLE_NAME)
/

Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_sd_notic', 'notic_id', 1, 0, 'SEQ_TD_SD_NOTIC', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_sd_ratifyadvice', 'ratifyadvice_id', 1, 0, 'SEQ_TD_SD_RATIFYADVICE', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_sd_schedular', 'schedular_id', 1, 0, 'SEQ_TD_SD_SCHEDULAR', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_sm_dictdata', 'dictdata_id', 1, 193, 'SEQ_TD_SM_DICTDATA', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_sm_dicttype', 'dicttype_id', 1, 2312, 'SEQ_TD_SM_DICTTYPE', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_sm_group', 'group_id', 1, 0, 'SEQ_TD_SM_GROUP', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_sm_job', 'job_id', 1, 1, 'SEQ_TD_SM_JOB', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_sm_organization', 'org_id', 1, 1, 'SEQ_TD_SM_ORGANIZATION', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_sm_res', 'res_id', 1, 0, 'SEQ_TD_SM_RES', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_sm_role', 'role_id', 1, 102, 'SEQ_TD_SM_ROLE', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_sd_remind', 'remind_id', 1, 0, 'SEQ_TD_SD_REMIND', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_sm_user', 'user_id', 1, 4, 'SEQ_TD_SM_USER', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('TB_SM_INPUTTYPE', 'INPUT_TYPE_ID', 1, 9, 'SEQ_TB_SM_INPUTTYPE', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_sd_notepaper', 'notepaper_id', 1, 0, 'SEQ_TD_SD_NOTEPAPER', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_sm_roletype', 'type_id', 1, 1, 'SEQ_TD_SM_ROLETYPE', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('TD_SM_LOGMODULE', 'id', 1, 6, 'SEQ_TD_SM_LOGMODULE', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('TD_SM_DICTKEYWORDS', 'KEYWORD_ID', 1, 0, 'SEQ_DICTKEYWORD', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('TD_SM_LOGDETAIL', 'DETAIL_ID', 1, 0, 'SEQ_LOG_DETAIL', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_cms_collect_ipctrl2', 'id', 1, 0, 'SEQ_TD_CMS_COLLECT_IPCTRL2', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_cms_collect_answer', 'answer_id', 1, 0, 'SEQ_TD_CMS_COLLECT_ANSWER', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_cms_collect_title', 'id', 1, 0, 'SEQ_TD_CMS_COLLECT_TITLE', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_remindinfo', 'id', 1, 0, 'SEQ_TD_REMINDINFO', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_cms_template', 'template_id', 1, 5, 'SEQ_TD_CMS_TEMPLATE', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_cms_site', 'site_id', 1, 3, 'SEQ_TD_CMS_SITE', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_cms_docsource', 'docsource_id', 1, 2, 'SEQ_TD_CMS_DOCSOURCE', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_cms_channel', 'channel_id', 1, 4, 'SEQ_TD_CMS_CHANNEL', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_cms_extfield', 'field_id', 1, 0, 'SEQ_TD_CMS_EXTFIELD', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('tl_cms_doc_oper_log
', 'id', 1, 0, 'SEQ_TL_CMS_DOC_OPER_LOG
', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_cms_doc_task', 'task_id', 1, 1, 'SEQ_TD_CMS_DOC_TASK', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_cms_doc_attach', 'id', 1, 2, 'SEQ_TD_CMS_DOC_ATTACH', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_cms_document', 'document_id', 1, 7, 'SEQ_TD_CMS_DOCUMENT', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_cms_vote_items', 'id', 1, 0, 'SEQ_TD_CMS_VOTE_ITEMS', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_cms_vote_questions', 'id', 1, 0, 'SEQ_TD_CMS_VOTE_QUESTIONS', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('TD_CMS_VOTE_TITLE', 'id', 1, 0, 'SEQ_TD_CMS_VOTE_TITLE', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('TD_CMS_VOTE_TIMECTRL', 'id', 1, 0, 'SEQ_TD_CMS_VOTE_TIMECTRL', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('TD_CMS_VOTE_IPCTRL', 'id', 1, 0, 'SEQ_TD_CMS_VOTE_IPCTRL', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('TD_CMS_VOTE_ANSWER', 'ANSER_ID', 1, 0, 'SEQ_TD_CMS_VOTE_ANSWER', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_cms_doc_template', 'id', 1, 0, 'SEQ_TD_CMS_DOC_TEMPLATE', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('TD_CMS_DOC_COMMENT', 'COMMENT_ID', 1, 0, 'SEQ_TD_CMS_DOC_COMMENT', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('TD_CMS_DOCCOMMENT_DICT', 'id', 1, 0, 'SEQ_TD_CMS_DOCCOMMENT_DICT', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_cms_site_search', 'id', 1, 2, 'SEQ_TD_CMS_SITE_SEARCH', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('td_cms_mailserverinfo', 'id', 1, 0, 'SEQ_TD_CMS_MAILSERVERINFO', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('TD_CMS_TEMPLATE_STYLE', 'STYLE_ID', 1, -1, 'SEQ_TD_CMS_TEMPLATE_STYLE', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('TD_CMS_EXTVALUESCOPE', 'ID', 1, 0, 'SEQ_TD_CMS_EXTVALUESCOPE', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('TD_CMS_DOCCOM_IMPEACHINFO', 'ID', 1, 0, 'SEQ_TD_CMS_DOCCOM_IMPEACHINFO', 
    'sequence', NULL);
Insert into TABLEINFO
   (TABLE_NAME, TABLE_ID_NAME, TABLE_ID_INCREMENT, TABLE_ID_VALUE, TABLE_ID_GENERATOR, 
    TABLE_ID_TYPE, TABLE_ID_PREFIX)
 Values
   ('TD_SM_LOG', 'LOG_ID', 1, 100, 'SEQ_LOG', 
    'sequence', NULL);
COMMIT;
