/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BAS_BILLTYPEFLDCTL_MOB')
 CREATE TABLE T_BAS_BILLTYPEFLDCTL_MOB (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ SMALLINT DEFAULT 0 NOT NULL,
FFIELDKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYFIELDKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FMUSTINPUT CHAR(1) DEFAULT '0' NOT NULL,
FDEFAULTVALUE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDEFAULTFUNCNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDEFAULTVALUETYPE INT DEFAULT 0 NOT NULL,
FDEFAULTFUNCID INT DEFAULT 0 NOT NULL,
FDEFAULTFUNCPARAM NVARCHAR(100) DEFAULT ' ' NOT NULL,
FFIELDELEMENTTYPE INT DEFAULT 0 NOT NULL,
FENABLED CHAR(1) DEFAULT '0' NOT NULL,
FEDITENABLED CHAR(1) DEFAULT '0' NOT NULL,
FSYSMUSTINPUT CHAR(1) DEFAULT '0' NOT NULL,
FSUBMITENABLED CHAR(1) DEFAULT '0' NOT NULL,
FAUDITENABLED CHAR(1) DEFAULT '0' NOT NULL,
FVINIT CHAR(1) DEFAULT '0' NOT NULL,
FVNEW CHAR(1) DEFAULT '0' NOT NULL,
FVEDIT CHAR(1) DEFAULT '0' NOT NULL,
FVVIEW CHAR(1) DEFAULT '0' NOT NULL,
FVSUBMIT CHAR(1) DEFAULT '0' NOT NULL,
FVAUDIT CHAR(1) DEFAULT '0' NOT NULL,
FISDELETED CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BAS_BILLTYPEFLDCTL_MOB_L')
 CREATE TABLE T_BAS_BILLTYPEFLDCTL_MOB_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FFIELDNAME NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BAS_BILLTYPE' AND KSQL_COL_NAME ='FLAYOUTSOLUTIONMOB')
 ALTER TABLE T_BAS_BILLTYPE ADD (FLAYOUTSOLUTIONMOB VARCHAR(36) DEFAULT ' ' NOT NULL );

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