/**Begin D:\scm_code\dev_scm\dbschema\imc\1.5\main\rim\pdm\20210820\RIM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_COLLECT_USER' AND KSQL_COL_NAME ='FRIM_USER') 
 ALTER TABLE T_RIM_INV_COLLECT_USER ADD (FRIM_USER BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_ATTACH' AND KSQL_COL_NAME ='FRIM_USER') 
 ALTER TABLE T_RIM_ATTACH ADD (FRIM_USER BIGINT DEFAULT 0 NOT NULL );
 EXEC p_AlterColumn 'T_RIM_BLACK_LIST_DATA', 'FORG', 'VARCHAR(50)', 'NOT NULL', '1111', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_APP_AUTHORIZATION') 
 CREATE TABLE T_RIM_APP_AUTHORIZATION (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FUSERID BIGINT DEFAULT 0 NOT NULL,
FRIM_USER BIGINT DEFAULT 0 NOT NULL,
FPHONE_NO VARCHAR(20) DEFAULT ' ' NOT NULL,
FAPPID VARCHAR(50) DEFAULT ' ' NOT NULL,
FAPPTYPE VARCHAR(4) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(4) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_USER') 
 CREATE TABLE T_RIM_USER (
FID BIGINT DEFAULT 0 NOT NULL,
FUSER BIGINT DEFAULT 0 NOT NULL,
FRESOURCE VARCHAR(50) DEFAULT ' ' NOT NULL,
FEXTERNAL_USER VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATE_TIME DATETIME
);



/**End D:\scm_code\dev_scm\dbschema\imc\1.5\main\rim\pdm\20210820\RIM_table.sql **/
