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

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_BIZRULECHANGEACC') 
 CREATE TABLE T_EB_BIZRULECHANGEACC (
FID BIGINT DEFAULT 0 NOT NULL,
FTEMPLATEID   BIGINT DEFAULT 0 NOT NULL,
FRULEID   BIGINT DEFAULT 0 NOT NULL,
FACCOUNTID   BIGINT DEFAULT 0 NOT NULL,
FMODELID   BIGINT DEFAULT 0 NOT NULL,
FGROUPID     BIGINT DEFAULT 0 NOT NULL,
FEXECSEQ     INT DEFAULT 0 NOT NULL,
FSOURCETEMPLATE     BIGINT DEFAULT 0 NOT NULL
);

 EXEC P_ALTERPK 'PK_EB_BIZRULECHANGEACC', 'T_EB_BIZRULECHANGEACC', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_BIZRULECHANGEACC_P1') CREATE INDEX IDX_EB_BIZRULECHANGEACC_P1 ON T_EB_BIZRULECHANGEACC ( FTEMPLATEID );

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