IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BAS_CLOUDPRINTER' AND KSQL_COL_NAME ='FCREATEORGID')
ALTER TABLE T_BAS_CLOUDPRINTER ADD (FCREATEORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BAS_CLOUDPRINTER' AND KSQL_COL_NAME ='FORGID')
ALTER TABLE T_BAS_CLOUDPRINTER ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BAS_CLOUDPRINTER' AND KSQL_COL_NAME ='FCTRLSTRATEGY')
ALTER TABLE T_BAS_CLOUDPRINTER ADD (FCTRLSTRATEGY CHAR(1) DEFAULT '5' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BAS_CLOUDPRINTER' AND KSQL_COL_NAME ='FBITINDEX')
ALTER TABLE T_BAS_CLOUDPRINTER ADD (FBITINDEX INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BAS_CLOUDPRINTER' AND KSQL_COL_NAME ='FSOURCEDATAID')
ALTER TABLE T_BAS_CLOUDPRINTER ADD (FSOURCEDATAID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BAS_CLOUDPRINTER' AND KSQL_COL_NAME ='FSOURCEBITINDEX')
ALTER TABLE T_BAS_CLOUDPRINTER ADD (FSOURCEBITINDEX INT DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BAS_CPRINTER_FMASTERID') CREATE INDEX IDX_BAS_CPRINTER_FMASTERID ON T_BAS_CLOUDPRINTER ( FMASTERID );

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BAS_CPRINTER_FCREATEORGID') CREATE INDEX IDX_BAS_CPRINTER_FCREATEORGID ON T_BAS_CLOUDPRINTER ( FCREATEORGID );


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BAS_CLOUDPRINTSERVICE' AND KSQL_COL_NAME ='FSERVICETYPE')
ALTER TABLE T_BAS_CLOUDPRINTSERVICE ADD (FSERVICETYPE CHAR(1) DEFAULT 'A' NOT NULL );


