/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\LOG_table.sql **/
 EXEC p_AlterColumn 'T_LOG_ADUIT_RULE', 'FMODIFYFIELDS', 'NCLOB', 'NULL', '1111', 'NULL';
 

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 't_privacy_desen_log') 
CREATE TABLE t_privacy_desen_log
(
    fid bigint NOT NULL,
    fusername VARCHAR(50) DEFAULT ' ' NOT NULL,
    fopname VARCHAR(50) DEFAULT ' ' NOT NULL,
    fopdesc VARCHAR(200) DEFAULT ' ' NOT NULL,
    fopdate datetime,
    ffieldident VARCHAR(50) DEFAULT ' ' NOT NULL,
    ffieldname VARCHAR(50) DEFAULT ' ' NOT NULL,
    fentityname VARCHAR(50) DEFAULT ' ' NOT NULL,
    fentitynumber VARCHAR(50) DEFAULT ' ' NOT NULL,
    frealcount bigint,
    flimitcount bigint,
    fschemeid bigint,
    foperator bigint,
	CONSTRAINT pk_privacy_desen_log PRIMARY KEY (fid)
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 't_privacy_desen_detaillog') 
CREATE TABLE t_privacy_desen_detaillog
(
    fid bigint NOT NULL,
    fusername VARCHAR(50) DEFAULT ' ' NOT NULL,
    fopname VARCHAR(50) DEFAULT ' ' NOT NULL,
    fopdesc VARCHAR(200) DEFAULT ' ' NOT NULL,
    fopdate datetime,
    ffieldident VARCHAR(50) DEFAULT ' ' NOT NULL,
    ffieldname VARCHAR(50) DEFAULT ' ' NOT NULL,
    fentityname VARCHAR(50) DEFAULT ' ' NOT NULL,
    fentitynumber VARCHAR(50) DEFAULT ' ' NOT NULL,
    foperatetype VARCHAR(50) DEFAULT ' ' NOT NULL,
    foperateterminal VARCHAR(50) DEFAULT ' ' NOT NULL,
    foperator bigint,
    fschemeid bigint,
    CONSTRAINT pk_privacy_desen_detaillog PRIMARY KEY (fid)
);


/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\LOG_table.sql **/
