-- MRP模型初始化增加多语言表
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_INITDATA_L')
CREATE TABLE T_MRP_INITDATA_L (
    FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
    FID BIGINT DEFAULT 0 NOT NULL,
    FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
    FINITTYPE NVARCHAR(100) DEFAULT ' ' NOT NULL,
    FINITTEXT NVARCHAR(512) DEFAULT ' ' NOT NULL
);

EXEC P_ALTERPK 'PK_MRP_INITDATA_L', 'T_MRP_INITDATA_L', 'FPKID', '1';

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