/**coderule signer high performance **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SIGNER_COMPENSATOR') 
 CREATE TABLE T_SIGNER_COMPENSATOR (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FMASTERID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FKEY VARCHAR(512) DEFAULT ' ' NOT NULL,
FSTARTSEQ BIGINT DEFAULT 0 NOT NULL,
FENDSEQ BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SIGNER_CONFIG') 
 CREATE TABLE T_SIGNER_CONFIG (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FMASTERID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FINITNUMBER BIGINT DEFAULT 0 NOT NULL,
FKEY VARCHAR(512) DEFAULT ' ' NOT NULL,
FSEGMENTLENGTH BIGINT DEFAULT 0 NOT NULL,
FSTEP INT DEFAULT 0 NOT NULL,
FISCOMPENSATE CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SIGNER_SEGMENT') 
 CREATE TABLE T_SIGNER_SEGMENT (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FMASTERID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FKEY VARCHAR(512) DEFAULT ' ' NOT NULL,
FCURSEQ BIGINT DEFAULT 0 NOT NULL,
FMAXSEQ BIGINT DEFAULT 0 NOT NULL,
FSEGMENTLENGTH BIGINT DEFAULT 0 NOT NULL,
FVERSION INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SIGNER_SEGMENTENTRY') 
 CREATE TABLE T_SIGNER_SEGMENTENTRY (
FENTRYID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FKEY VARCHAR(512) DEFAULT ' ' NOT NULL,
FCURSEQ BIGINT DEFAULT 0 NOT NULL,
FMAXSEQ BIGINT DEFAULT 0 NOT NULL,
FUPDATETIME DATETIME,
FDELETETAG CHAR(1) DEFAULT '0' NOT NULL
);


 EXEC p_AlterColumn 'T_SIGNER_COMPENSATOR', 'FKEY', 'VARCHAR(512)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_SIGNER_CONFIG', 'FKEY', 'VARCHAR(512)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_SIGNER_SEGMENT', 'FKEY', 'VARCHAR(512)', 'NOT NULL', '0100', ''' ''';

 EXEC p_AlterColumn 'T_SIGNER_SEGMENTENTRY', 'FKEY', 'VARCHAR(512)', 'NOT NULL', '0100', ''' ''';
