IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BAS_SHARDSTRATEGY') 
 CREATE TABLE T_BAS_SHARDSTRATEGY (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME DEFAULT GETDATE() NOT NULL,
FMODIFYTIME DATETIME DEFAULT GETDATE(),
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FENTITYNUMBER VARCHAR(36) DEFAULT ' ' NOT NULL,
FSTRATEGY VARCHAR(30) DEFAULT ' ' NOT NULL,
FSTRATEGYPARAMS VARCHAR(2000) DEFAULT ' ' NOT NULL,
FSHARDINGENABLE CHAR(1) DEFAULT '1' NOT NULL,
FSHARDINGSTATUS VARCHAR(30) DEFAULT ' ' NOT NULL,
FSHARDINGFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL,
FFROMSHARDINGSTATUS VARCHAR(100) DEFAULT ' ' NOT NULL,
FTOSHARDINGSTATUS VARCHAR(100) DEFAULT ' ' NOT NULL,
FOPERATIONLOG NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FSHARDINGCOMPLETED CHAR(1) DEFAULT '0' NOT NULL,
FPROGRESSSIGN NCLOB,
FPROGRESS NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPROGRESSDESC NVARCHAR(255) DEFAULT ' ' NOT NULL
);

IF NOT EXISTS (SELECT * FROM KSQL_USERCOLUMNS WHERE KSQL_COL_NAME ='FPROGRESSSIGN' AND KSQL_COL_TABNAME='T_BAS_SHARDSTRATEGY') DROP TABLE T_BAS_SHARDSTRATEGY;

﻿/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\PEA_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BAS_SHARDSTRATEGY_L') 
 CREATE TABLE T_BAS_SHARDSTRATEGY_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BAS_SHARDSTRATEGYENTRY') 
 CREATE TABLE T_BAS_SHARDSTRATEGYENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FFIELDSHARDING CHAR(1) DEFAULT '0' NOT NULL,
FFIELDNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BAS_SHARDSTRATEGY') 
 CREATE TABLE T_BAS_SHARDSTRATEGY (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME DEFAULT GETDATE() NOT NULL,
FMODIFYTIME DATETIME DEFAULT GETDATE(),
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FENTITYNUMBER VARCHAR(36) DEFAULT ' ' NOT NULL,
FSTRATEGY VARCHAR(30) DEFAULT ' ' NOT NULL,
FSTRATEGYPARAMS VARCHAR(2000) DEFAULT ' ' NOT NULL,
FSHARDINGENABLE CHAR(1) DEFAULT '1' NOT NULL,
FSHARDINGSTATUS VARCHAR(30) DEFAULT ' ' NOT NULL,
FSHARDINGFIELDS VARCHAR(100) DEFAULT ' ' NOT NULL,
FFROMSHARDINGSTATUS VARCHAR(100) DEFAULT ' ' NOT NULL,
FTOSHARDINGSTATUS VARCHAR(100) DEFAULT ' ' NOT NULL,
FOPERATIONLOG NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FSHARDINGCOMPLETED CHAR(1) DEFAULT '0' NOT NULL,
FPROGRESSSIGN NCLOB,
FPROGRESS NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPROGRESSDESC NVARCHAR(255) DEFAULT ' ' NOT NULL
);



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