/**BEGIN  **/
-- 业务场景
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_APPLICATIONSCENARIO_L') 
CREATE TABLE T_EB_APPLICATIONSCENARIO_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);

EXEC P_ALTERPK 'PK_EB_APPLICATIONSCENARIO_L', 'T_EB_APPLICATIONSCENARIO_L', 'FPKID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_APPLICATIONSCENARIO_L') 
CREATE INDEX IDX_EB_APPLICATIONSCENARIO_L ON T_EB_APPLICATIONSCENARIO_L ( FID, FLOCALEID );





-- 业务模型
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_BUSINESSMODEL_L') 
CREATE TABLE T_EB_BUSINESSMODEL_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);

EXEC P_ALTERPK 'PK_EB_BUSINESSMODEL_L', 'T_EB_BUSINESSMODEL_L', 'FPKID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_BUSINESSMODEL_L') 
CREATE INDEX IDX_EB_BUSINESSMODEL_L ON T_EB_BUSINESSMODEL_L ( FID, FLOCALEID );





-- 数据集
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_DATASET_L') 
CREATE TABLE T_EB_DATASET_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);

EXEC P_ALTERPK 'PK_EB_DATASET_L', 'T_EB_DATASET_L', 'FPKID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_DATASET_L') 
CREATE INDEX IDX_EB_DATASET_L ON T_EB_DATASET_L ( FID, FLOCALEID );


/**END **/