Scripts para posto off-line
Script para ser executando nos postos off-line, usando a função importação/exportação de arquivos.
Versão | Proprietário | Nota | Data |
---|---|---|---|
1.0 | @Renan Mitsuo Oka | Criação de documento | 12/05/2021 |
Instrução
Este processo só deverá ser usado para clientes que usam posto off-line usando a importação e exportação de arquivos:
1- Abra o pgadmin, click no botão SQL Query e execute o comando:
DELETE FROM TAB_LOGEXA;
DELETE FROM TAB_LOGCAI;
DELETE FROM RASTREA;
DELETE FROM MOVCAI;
DELETE FROM MOVEXA;
DELETE FROM MOVPAC;
DELETE FROM TRIAGEM;
DELETE FROM CAIXA1;
DELETE FROM CAIXA;
DELETE FROM LICENCA;
ALTER SEQUENCE amostra_seq RESTART WITH 00001;
ALTER SEQUENCE caixa_id_seq RESTART WITH 00001;
ALTER SEQUENCE caixa1_id_seq RESTART WITH 000001;
ALTER SEQUENCE guiaauto_seq RESTART WITH 000001;
ALTER SEQUENCE logexa_id_seq RESTART WITH 000001;
ALTER SEQUENCE mapa_id_seq RESTART WITH 000001;
ALTER SEQUENCE mapagrade_id_seq RESTART WITH 000001;
ALTER SEQUENCE medico_id_seq RESTART WITH 000001;
ALTER SEQUENCE medicocod_id_seq RESTART WITH 000001;
ALTER SEQUENCE movapoio_id_seq RESTART WITH 000001;
ALTER SEQUENCE movcai_id_seq RESTART WITH 0000001;
ALTER SEQUENCE movexa_id_seq RESTART WITH 0000001;
ALTER SEQUENCE movpac_id_seq RESTART WITH 0000001;
ALTER SEQUENCE novacol_id_seq RESTART WITH 0001;
ALTER SEQUENCE operador_id_seq RESTART WITH 001;
ALTER SEQUENCE orca_id_seq RESTART WITH 00001;
ALTER SEQUENCE orca1_id_seq RESTART WITH 00001;
ALTER SEQUENCE pronid_id_seq RESTART WITH 000001;
ALTER SEQUENCE prontuario_id_seq RESTART WITH 000001;
ALTER SEQUENCE rastrea_id_seq RESTART WITH 000001;
ALTER SEQUENCE tab_logcad_id_seq RESTART WITH 000001;
ALTER SEQUENCE tab_logcai_id_seq RESTART WITH 000001;
ALTER SEQUENCE tab_logexa_id_seq RESTART WITH 000001;
ALTER SEQUENCE tab_logreg_id_seq RESTART WITH 000001;
ALTER SEQUENCE triagem_id_seq RESTART WITH 000001;
Obs: a sequencia deverá ser de acordo com o código do posto.
Exemplo caso o posto for 12, todas as sequencias deverá iniciar com 12 conforme imagem abaixo.
ALTER SEQUENCE amostra_seq RESTART WITH 1200001;
ALTER SEQUENCE caixa_id_seq RESTART WITH 1200001;
ALTER SEQUENCE caixa1_id_seq RESTART WITH 12000001;