COMMENT ON COLUMN TBCASO_PAINEL_CONF.TIPO IS 
'1-String
2-Numero
3-Data
4-check
5-Radio
6-Range
7-Search
8-Time
9-select
10-text area
11-Search List';

/*********************************************************************************/

ALTER TABLE TBCASO_PAINEL_CONF ALTER ID SET NOT NULL;

ALTER TABLE TBCASO_PAINEL_CONF
	ADD CONSTRAINT PK_TBCASO_PAINEL_CONF
	PRIMARY KEY (ID);

/*********************************************************************************/
/*********************************************************************************/

ALTER TABLE TBCASO_CAMPO_CONSULTA
    ADD CAMPO_VISUALIZACAO_TABELA VARCHAR(5000) CHARACTER SET UTF8 DEFAULT '[]' COLLATE UTF8;


COMMENT ON COLUMN TBCASO_CAMPO_CONSULTA.CAMPO_VISUALIZACAO_TABELA IS
'Campos da Tabela de Dados quando tipo do campo for 11 - Search List';


UPDATE TBCASO_CAMPO_CONSULTA
	SET CAMPO_VISUALIZACAO_TABELA = '[]'
	WHERE CAMPO_VISUALIZACAO_TABELA IS NULL;

/*********************************************************************************/

ALTER TABLE TBCASO_REGISTRO_DETALHE
	ALTER COLUMN JSON TYPE VARCHAR(3000);



ALTER TABLE TBCASO_REGISTRO_DETALHE
    ADD DADOS_TABELA BLOB SUB_TYPE 1 SEGMENT SIZE 80 CHARACTER SET UTF8;


COMMENT ON COLUMN TBCASO_REGISTRO_DETALHE.DADOS_TABELA IS
'Valores da Tabela quando tipo do campo for 11 - Search List';


UPDATE TBCASO_REGISTRO_DETALHE 
	SET DADOS_TABELA = '' 
	WHERE DADOS_TABELA IS NULL;

/*********************************************************************************/
/*********************************************************************************/

CREATE INDEX ITBCASO_CAMPO_CONSULTA_05
ON TBCASO_CAMPO_CONSULTA (CAMPOS_RETORNO);

CREATE INDEX ITBCASO_CAMPO_CONSULTA_04
ON TBCASO_CAMPO_CONSULTA (CAMPO_TABELA);

CREATE INDEX ITBCASO_CAMPO_CONSULTA_03
ON TBCASO_CAMPO_CONSULTA (SQL_ID);

/*********************************************************************************/
/*********************************************************************************/
/*********************************************************************************/

