
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FMM_MILESTONETPL')
CREATE TABLE T_FMM_MILESTONETPL
(
  FID              BIGINT            DEFAULT 0      NOT NULL,          
  FNUMBER          NVARCHAR(30)      DEFAULT ' '    NOT NULL, 	
  FSTATUS          NVARCHAR(1)       DEFAULT ' '    NOT NULL, 	
  FCREATORID       BIGINT            DEFAULT 0      NOT NULL,   
  FMODIFIERID      BIGINT            DEFAULT 0      NOT NULL,  	
  FENABLE          NVARCHAR(1)       DEFAULT ' '    NOT NULL, 	
  FCREATETIME      DATETIME ,                  	
  FMODIFYTIME      DATETIME ,                  	
  FMASTERID        BIGINT            DEFAULT 0      NOT NULL,    	
  FCREATEORGID     BIGINT            DEFAULT 0      NOT NULL, 
  FORGID           BIGINT            DEFAULT 0      NOT NULL,       
  FCTRLSTRATEGY    NVARCHAR(5)       DEFAULT ' '    NOT NULL, 	
  FSOURCEDATAID    BIGINT            DEFAULT 0      NOT NULL, 	
  FBITINDEX        INT               DEFAULT 0      NOT NULL,       	
  FSOURCEBITINDEX  INT               DEFAULT 0      NOT NULL, 	
  FREMARK          NVARCHAR(255)     DEFAULT ' '    NOT NULL, 	
  FAUDITOR         BIGINT            DEFAULT 0      NOT NULL,     	
  FAUDITTIME       DATETIME
);



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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FMM_MSTENTRY')
CREATE TABLE T_FMM_MSTENTRY
(
  FID              BIGINT             DEFAULT 0      NOT NULL,          	
  FENTRYID         BIGINT             DEFAULT 0      NOT NULL,     	
  FSEQ             INT                DEFAULT 0      NOT NULL,            	
  FPARENTENTRYID   BIGINT             DEFAULT 0      NOT NULL, 	
  FBIZTYPE         NVARCHAR(5)        DEFAULT ' '    NOT NULL, 	
  FWBSNAME         NVARCHAR(255)      DEFAULT ' '    NOT NULL, 
  FTASKNAME        NVARCHAR(255)      DEFAULT ' '    NOT NULL, 	
  FWBSTYPE         BIGINT             DEFAULT 0      NOT NULL,     	
  FTASKTYPE        BIGINT             DEFAULT 0      NOT NULL,    	
  FMILESTONENAME   NVARCHAR(255)      DEFAULT ' '    NOT NULL, 	
  FPARENT          NVARCHAR(50)       DEFAULT ' '    NOT NULL, 
  FPLANPERIOD      DECIMAL(23,10)     DEFAULT 0      NOT NULL, 	
  FPLANFINISH      INT                DEFAULT 0      NOT NULL,     	
  FPLANBEGIN       INT                DEFAULT 0      NOT NULL,      	
  FPERCENT         DECIMAL(23,10)     DEFAULT 0      NOT NULL, 
  FTIMEUNIT        BIGINT             DEFAULT 0      NOT NULL,    	
  FPERCENTTYPE     NVARCHAR(5)        DEFAULT ' '    NOT NULL, 	
  FFRONTTASK       NVARCHAR(50)       DEFAULT ' '    NOT NULL, 	
  FFRONTRELATION   NVARCHAR(5)        DEFAULT ' '    NOT NULL,
  FFRONTDELAY      INT                DEFAULT 0      NOT NULL,     
  FPOSTTASK        NVARCHAR(50)       DEFAULT ' '    NOT NULL, 
  FPOSTRELATION    NVARCHAR(5)        DEFAULT ' '    NOT NULL, 	
  FPOSTDELAY       INT                DEFAULT 0      NOT NULL  
);




