
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FMM_PERSONFILTERSET') 
CREATE TABLE T_FMM_PERSONFILTERSET (
	FID            BIGINT         DEFAULT 0   NOT NULL,             
	FNUMBER        NVARCHAR(30)   DEFAULT ' ' NOT NULL,      
	FNAME          NVARCHAR(255)  DEFAULT ' ' NOT NULL,      
	FSTATUS        NVARCHAR(50)   DEFAULT ' ' NOT NULL,    
	FCREATORID     BIGINT         DEFAULT 0   NOT NULL,       
	FMODIFIERID    BIGINT         DEFAULT 0   NOT NULL,     
	FENABLE        NVARCHAR(50)   DEFAULT ' ' NOT NULL,   
	FCREATETIME    DATETIME ,                       
	FMODIFYTIME    DATETIME ,                       
	FMASTERID      BIGINT         DEFAULT 0   NOT NULL,          
	FPAGEID        NVARCHAR(36)   DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FMM_PERSONFILTERSET_L') 
CREATE TABLE T_FMM_PERSONFILTERSET_L (
	FPKID         NVARCHAR(255)       DEFAULT ' '  NOT NULL, 
	FID           BIGINT              DEFAULT 0    NOT NULL,        
	FLOCALEID     NVARCHAR(255)       DEFAULT ' '  NOT NULL,    
	FNAME         NVARCHAR(255)       DEFAULT ' '  NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FMM_PERSONFIELD') 
CREATE TABLE T_FMM_PERSONFIELD (
	FID             BIGINT         DEFAULT 0    NOT NULL,      
	FENTRYID        BIGINT         DEFAULT 0    NOT NULL,       
	FSEQ            INT            DEFAULT 0    NOT NULL,          
	FENTITYTYPE     NVARCHAR(50)   DEFAULT ' '  NOT NULL,      
	FFIELDNAME      NVARCHAR(250)  DEFAULT ' '  NOT NULL,       
	FFIELDFLAG      NVARCHAR(50)   DEFAULT ' '  NOT NULL,           
	FFIELDALIAS     NVARCHAR(250)  DEFAULT ' '  NOT NULL,		
	FIMPLCLASS      NVARCHAR(250)  DEFAULT ' '  NOT NULL,    
	FUSE            CHAR(1)        DEFAULT ' '  NOT NULL
);





