From f1e31348a795641bfc5c3119116a87394d9effa0 Mon Sep 17 00:00:00 2001 From: Eder Soares Date: Mon, 20 Jan 2020 17:58:51 -0300 Subject: [PATCH] Adiciona schema em views --- ...atorio.view_historico_9_anos-2019-09-17.sql | 18 +++++++++--------- ...relatorio.view_historico_eja-2019-09-17.sql | 18 +++++++++--------- ...storico_eja_extra_curricular-2019-09-17.sql | 18 +++++++++--------- ...o.view_historico_series_anos-2019-09-17.sql | 18 +++++++++--------- ...series_anos_extra_curricular-2019-09-17.sql | 18 +++++++++--------- 5 files changed, 45 insertions(+), 45 deletions(-) diff --git a/database/sqls/views/relatorio.view_historico_9_anos-2019-09-17.sql b/database/sqls/views/relatorio.view_historico_9_anos-2019-09-17.sql index 54477a84f5..c5b37c725f 100644 --- a/database/sqls/views/relatorio.view_historico_9_anos-2019-09-17.sql +++ b/database/sqls/views/relatorio.view_historico_9_anos-2019-09-17.sql @@ -164,11 +164,11 @@ CREATE OR REPLACE VIEW relatorio.view_historico_9anos AS (historico_por_disciplina.dependencia OPERATOR(relatorio.->) (((historico_disciplinas.disciplina || '-'::text) || '9'::text) || '-dependencia'::text))::boolean AS disciplina_dependencia9, ( SELECT m.cod_matricula - FROM matricula m + FROM pmieducar.matricula m WHERE m.ano = ( ( SELECT max(he.ano) AS max - FROM historico_escolar he + FROM pmieducar.historico_escolar he WHERE he.ref_cod_aluno = historico_disciplinas.ref_ref_cod_aluno AND he.ativo = 1 AND he.extra_curricular = 0 @@ -186,7 +186,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_9anos AS SELECT textcat_all(tabl.obs) AS textcat_all FROM ( SELECT phe.observacao AS obs - FROM historico_escolar phe + FROM pmieducar.historico_escolar phe WHERE phe.ref_cod_aluno = historico_disciplinas.ref_ref_cod_aluno AND phe.ativo = 1 AND phe.extra_curricular = 0 @@ -195,7 +195,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_9anos AS ORDER BY phe.ano ) tabl ) AS observacao_all - FROM historico_escolar + FROM pmieducar.historico_escolar JOIN LATERAL ( SELECT historico_disciplinas_1.sequencial, @@ -204,7 +204,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_9anos AS btrim(relatorio.get_texto_sem_caracter_especial(historico_disciplinas_1.nm_disciplina::character varying)::text) AS disciplina, historico_disciplinas_1.nota, historico_disciplinas_1.faltas - FROM historico_disciplinas historico_disciplinas_1 + FROM pmieducar.historico_disciplinas historico_disciplinas_1 ) historico_disciplinas ON historico_escolar.ref_cod_aluno = historico_disciplinas.ref_ref_cod_aluno AND historico_escolar.sequencial = historico_disciplinas.ref_sequencial JOIN LATERAL ( SELECT @@ -285,7 +285,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_9anos AS historico_disciplinas_1.dependencia::text AS dependencia_value, historico_disciplinas_1.disciplina, historico_escolar_1.ref_cod_aluno - FROM historico_escolar historico_escolar_1 + FROM pmieducar.historico_escolar historico_escolar_1 JOIN LATERAL ( SELECT historico_disciplinas_2.sequencial, @@ -296,7 +296,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_9anos AS historico_disciplinas_2.faltas, historico_disciplinas_2.carga_horaria_disciplina, historico_disciplinas_2.dependencia - FROM historico_disciplinas historico_disciplinas_2 + FROM pmieducar.historico_disciplinas historico_disciplinas_2 ) historico_disciplinas_1 ON historico_escolar_1.ref_cod_aluno = historico_disciplinas_1.ref_ref_cod_aluno AND historico_escolar_1.sequencial = historico_disciplinas_1.ref_sequencial WHERE historico_escolar_1.extra_curricular = 0 AND historico_escolar_1.ativo = 1 @@ -306,7 +306,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_9anos AS AND historico_escolar_1.sequencial = ( ( SELECT hee.sequencial - FROM historico_escolar hee + FROM pmieducar.historico_escolar hee WHERE "substring"(hee.nm_serie::text, 1, 1) = "substring"(historico_escolar_1.nm_serie::text, 1, 1) AND hee.ref_cod_aluno = historico_escolar_1.ref_cod_aluno AND hee.extra_curricular = 0 @@ -369,4 +369,4 @@ CREATE OR REPLACE VIEW relatorio.view_historico_9anos AS historico_por_disciplina.faltas, historico_por_disciplina.carga_horaria_disciplina, historico_por_disciplina.dependencia - ORDER BY ordenamento, historico_disciplinas.disciplina; \ No newline at end of file + ORDER BY ordenamento, historico_disciplinas.disciplina; diff --git a/database/sqls/views/relatorio.view_historico_eja-2019-09-17.sql b/database/sqls/views/relatorio.view_historico_eja-2019-09-17.sql index 011b65303d..d5ee30e75c 100644 --- a/database/sqls/views/relatorio.view_historico_eja-2019-09-17.sql +++ b/database/sqls/views/relatorio.view_historico_eja-2019-09-17.sql @@ -110,11 +110,11 @@ CREATE OR REPLACE VIEW relatorio.view_historico_eja AS (historico_por_disciplina.dependencia OPERATOR(relatorio.->) (((historico_disciplinas.disciplina || '-'::text) || '9'::text) || '-dependencia'::text))::boolean AS disciplina_dependencia9, ( SELECT m.cod_matricula - FROM matricula m + FROM pmieducar.matricula m WHERE m.ano = ( ( SELECT max(he.ano) AS max - FROM historico_escolar he + FROM pmieducar.historico_escolar he WHERE he.ref_cod_aluno = historico_disciplinas.ref_ref_cod_aluno AND he.ativo = 1 AND he.extra_curricular = 0 @@ -133,7 +133,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_eja AS SELECT textcat_all(tabl.obs) AS textcat_all FROM ( SELECT phe.observacao AS obs - FROM historico_escolar phe + FROM pmieducar.historico_escolar phe WHERE phe.ref_cod_aluno = historico_disciplinas.ref_ref_cod_aluno AND phe.ativo = 1 AND phe.extra_curricular = 0 @@ -143,7 +143,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_eja AS ORDER BY phe.ano ) tabl ) AS observacao_all - FROM historico_escolar + FROM pmieducar.historico_escolar JOIN LATERAL ( SELECT historico_disciplinas_1.sequencial, @@ -153,7 +153,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_eja AS historico_disciplinas_1.nota, historico_disciplinas_1.faltas, historico_disciplinas_1.tipo_base - FROM historico_disciplinas historico_disciplinas_1 + FROM pmieducar.historico_disciplinas historico_disciplinas_1 ) historico_disciplinas ON historico_escolar.ref_cod_aluno = historico_disciplinas.ref_ref_cod_aluno AND historico_escolar.sequencial = historico_disciplinas.ref_sequencial JOIN LATERAL ( SELECT @@ -212,7 +212,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_eja AS historico_disciplinas_1.dependencia::text AS dependencia_value, historico_disciplinas_1.disciplina, historico_escolar_1.ref_cod_aluno - FROM historico_escolar historico_escolar_1 + FROM pmieducar.historico_escolar historico_escolar_1 JOIN LATERAL ( SELECT historico_disciplinas_2.sequencial, @@ -223,7 +223,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_eja AS historico_disciplinas_2.faltas, historico_disciplinas_2.carga_horaria_disciplina, historico_disciplinas_2.dependencia - FROM historico_disciplinas historico_disciplinas_2) historico_disciplinas_1 ON historico_escolar_1.ref_cod_aluno = historico_disciplinas_1.ref_ref_cod_aluno AND historico_escolar_1.sequencial = historico_disciplinas_1.ref_sequencial + FROM pmieducar.historico_disciplinas historico_disciplinas_2) historico_disciplinas_1 ON historico_escolar_1.ref_cod_aluno = historico_disciplinas_1.ref_ref_cod_aluno AND historico_escolar_1.sequencial = historico_disciplinas_1.ref_sequencial WHERE historico_escolar_1.extra_curricular = 0 AND historico_escolar_1.ativo = 1 AND historico_escolar_1.historico_grade_curso_id = 3 @@ -233,7 +233,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_eja AS AND historico_escolar_1.sequencial = ( ( SELECT hee.sequencial - FROM historico_escolar hee + FROM pmieducar.historico_escolar hee WHERE "substring"(hee.nm_serie::text, 1, 1) = "substring"(historico_escolar_1.nm_serie::text, 1, 1) AND hee.ref_cod_aluno = historico_escolar_1.ref_cod_aluno AND hee.extra_curricular = 0 @@ -287,4 +287,4 @@ GROUP BY historico_por_disciplina.nota, historico_por_disciplina.carga_horaria_disciplina, historico_por_disciplina.dependencia -ORDER BY ordenamento, historico_disciplinas.disciplina; \ No newline at end of file +ORDER BY ordenamento, historico_disciplinas.disciplina; diff --git a/database/sqls/views/relatorio.view_historico_eja_extra_curricular-2019-09-17.sql b/database/sqls/views/relatorio.view_historico_eja_extra_curricular-2019-09-17.sql index 3c11c94649..aab6918ae1 100644 --- a/database/sqls/views/relatorio.view_historico_eja_extra_curricular-2019-09-17.sql +++ b/database/sqls/views/relatorio.view_historico_eja_extra_curricular-2019-09-17.sql @@ -109,11 +109,11 @@ CREATE OR REPLACE VIEW relatorio.view_historico_eja_extra_curricular AS (historico_por_disciplina.dependencia OPERATOR(relatorio.->) (((historico_disciplinas.disciplina || '-'::text) || '9'::text) || '-dependencia'::text))::boolean AS disciplina_dependencia9, ( SELECT m.cod_matricula - FROM matricula m + FROM pmieducar.matricula m WHERE m.ano = ( ( SELECT max(he.ano) AS max - FROM historico_escolar he + FROM pmieducar.historico_escolar he WHERE he.ref_cod_aluno = historico_disciplinas.ref_ref_cod_aluno AND he.ativo = 1 AND he.extra_curricular = 1 @@ -132,12 +132,12 @@ CREATE OR REPLACE VIEW relatorio.view_historico_eja_extra_curricular AS SELECT textcat_all(tabl.obs) AS textcat_all FROM ( SELECT phe.observacao AS obs - FROM historico_escolar phe + FROM pmieducar.historico_escolar phe WHERE phe.ref_cod_aluno = historico_disciplinas.ref_ref_cod_aluno AND phe.ativo = 1 AND phe.extra_curricular = 1 AND phe.historico_grade_curso_id = 3 AND COALESCE(phe.dependencia, false) = false AND isnumeric("substring"(phe.nm_serie::text, 1, 1)) ORDER BY phe.ano ) tabl ) AS observacao_all - FROM historico_escolar + FROM pmieducar.historico_escolar JOIN LATERAL ( SELECT historico_disciplinas_1.sequencial, @@ -146,7 +146,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_eja_extra_curricular AS btrim(relatorio.get_texto_sem_caracter_especial(historico_disciplinas_1.nm_disciplina::character varying)::text) AS disciplina, historico_disciplinas_1.nota, historico_disciplinas_1.faltas - FROM historico_disciplinas historico_disciplinas_1 + FROM pmieducar.historico_disciplinas historico_disciplinas_1 ) historico_disciplinas ON historico_escolar.ref_cod_aluno = historico_disciplinas.ref_ref_cod_aluno AND historico_escolar.sequencial = historico_disciplinas.ref_sequencial JOIN LATERAL ( SELECT @@ -205,7 +205,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_eja_extra_curricular AS historico_disciplinas_1.dependencia::text AS dependencia_value, historico_disciplinas_1.disciplina, historico_escolar_1.ref_cod_aluno - FROM historico_escolar historico_escolar_1 + FROM pmieducar.historico_escolar historico_escolar_1 JOIN LATERAL ( SELECT historico_disciplinas_2.sequencial, @@ -216,7 +216,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_eja_extra_curricular AS historico_disciplinas_2.faltas, historico_disciplinas_2.carga_horaria_disciplina, historico_disciplinas_2.dependencia - FROM historico_disciplinas historico_disciplinas_2 + FROM pmieducar.historico_disciplinas historico_disciplinas_2 ) historico_disciplinas_1 ON historico_escolar_1.ref_cod_aluno = historico_disciplinas_1.ref_ref_cod_aluno AND historico_escolar_1.sequencial = historico_disciplinas_1.ref_sequencial WHERE historico_escolar_1.extra_curricular = 1 AND historico_escolar_1.historico_grade_curso_id = 3 @@ -227,7 +227,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_eja_extra_curricular AS AND historico_escolar_1.sequencial = ( ( SELECT hee.sequencial - FROM historico_escolar hee + FROM pmieducar.historico_escolar hee WHERE "substring"(hee.nm_serie::text, 1, 1) = "substring"(historico_escolar_1.nm_serie::text, 1, 1) AND hee.ref_cod_aluno = historico_escolar_1.ref_cod_aluno AND hee.extra_curricular = 1 @@ -279,4 +279,4 @@ CREATE OR REPLACE VIEW relatorio.view_historico_eja_extra_curricular AS historico_por_disciplina.nota, historico_por_disciplina.carga_horaria_disciplina, historico_por_disciplina.dependencia - ORDER BY ordenamento, historico_disciplinas.disciplina; \ No newline at end of file + ORDER BY ordenamento, historico_disciplinas.disciplina; diff --git a/database/sqls/views/relatorio.view_historico_series_anos-2019-09-17.sql b/database/sqls/views/relatorio.view_historico_series_anos-2019-09-17.sql index a0a18cefbb..016d737df9 100644 --- a/database/sqls/views/relatorio.view_historico_series_anos-2019-09-17.sql +++ b/database/sqls/views/relatorio.view_historico_series_anos-2019-09-17.sql @@ -111,11 +111,11 @@ CREATE OR REPLACE VIEW relatorio.view_historico_series_anos AS (historico_por_disciplina.dependencia OPERATOR(relatorio.->) (((historico_disciplinas.disciplina || '-'::text) || '9'::text) || '-dependencia'::text))::boolean AS disciplina_dependencia9, ( SELECT m.cod_matricula - FROM matricula m + FROM pmieducar.matricula m WHERE m.ano = ( ( SELECT max(he.ano) AS max - FROM historico_escolar he + FROM pmieducar.historico_escolar he WHERE he.ref_cod_aluno = historico_disciplinas.ref_ref_cod_aluno AND he.ativo = 1 AND he.extra_curricular = 0 @@ -133,7 +133,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_series_anos AS SELECT textcat_all(tabl.obs) AS textcat_all FROM ( SELECT phe.observacao AS obs - FROM historico_escolar phe + FROM pmieducar.historico_escolar phe WHERE phe.ref_cod_aluno = historico_disciplinas.ref_ref_cod_aluno AND phe.ativo = 1 AND phe.extra_curricular = 0 @@ -142,7 +142,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_series_anos AS ORDER BY phe.ano ) tabl ) AS observacao_all - FROM historico_escolar + FROM pmieducar.historico_escolar JOIN LATERAL ( SELECT historico_disciplinas_1.sequencial, @@ -152,7 +152,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_series_anos AS historico_disciplinas_1.nota, historico_disciplinas_1.faltas, historico_disciplinas_1.tipo_base - FROM historico_disciplinas historico_disciplinas_1 + FROM pmieducar.historico_disciplinas historico_disciplinas_1 ) historico_disciplinas ON historico_escolar.ref_cod_aluno = historico_disciplinas.ref_ref_cod_aluno AND historico_escolar.sequencial = historico_disciplinas.ref_sequencial JOIN LATERAL ( SELECT @@ -271,7 +271,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_series_anos AS historico_disciplinas_1.dependencia::text AS dependencia_value, historico_disciplinas_1.disciplina, historico_escolar_1.ref_cod_aluno - FROM historico_escolar historico_escolar_1 + FROM pmieducar.historico_escolar historico_escolar_1 JOIN LATERAL ( SELECT historico_disciplinas_2.sequencial, @@ -282,7 +282,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_series_anos AS historico_disciplinas_2.faltas, historico_disciplinas_2.carga_horaria_disciplina, historico_disciplinas_2.dependencia - FROM historico_disciplinas historico_disciplinas_2 + FROM pmieducar.historico_disciplinas historico_disciplinas_2 ) historico_disciplinas_1 ON historico_escolar_1.ref_cod_aluno = historico_disciplinas_1.ref_ref_cod_aluno AND historico_escolar_1.sequencial = historico_disciplinas_1.ref_sequencial WHERE historico_escolar_1.extra_curricular = 0 AND historico_escolar_1.ativo = 1 @@ -292,7 +292,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_series_anos AS AND historico_escolar_1.sequencial = ( ( SELECT hee.sequencial - FROM historico_escolar hee + FROM pmieducar.historico_escolar hee WHERE "substring"(hee.nm_serie::text, 1, 1) = "substring"(historico_escolar_1.nm_serie::text, 1, 1) AND hee.ref_cod_aluno = historico_escolar_1.ref_cod_aluno AND hee.extra_curricular = 0 @@ -344,4 +344,4 @@ CREATE OR REPLACE VIEW relatorio.view_historico_series_anos AS historico_por_disciplina.nota, historico_por_disciplina.carga_horaria_disciplina, historico_por_disciplina.dependencia - ORDER BY ordenamento, historico_disciplinas.disciplina; \ No newline at end of file + ORDER BY ordenamento, historico_disciplinas.disciplina; diff --git a/database/sqls/views/relatorio.view_historico_series_anos_extra_curricular-2019-09-17.sql b/database/sqls/views/relatorio.view_historico_series_anos_extra_curricular-2019-09-17.sql index 92338345fe..8bf6176037 100644 --- a/database/sqls/views/relatorio.view_historico_series_anos_extra_curricular-2019-09-17.sql +++ b/database/sqls/views/relatorio.view_historico_series_anos_extra_curricular-2019-09-17.sql @@ -110,11 +110,11 @@ CREATE OR REPLACE VIEW relatorio.view_historico_series_anos_extra_curricular AS (historico_por_disciplina.dependencia OPERATOR(relatorio.->) (((historico_disciplinas.disciplina || '-'::text) || '9'::text) || '-dependencia'::text))::boolean AS disciplina_dependencia9, ( SELECT m.cod_matricula - FROM matricula m + FROM pmieducar.matricula m WHERE m.ano = ( ( SELECT max(he.ano) AS max - FROM historico_escolar he + FROM pmieducar.historico_escolar he WHERE he.ref_cod_aluno = historico_disciplinas.ref_ref_cod_aluno AND he.ativo = 1 AND he.extra_curricular = 1 @@ -132,7 +132,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_series_anos_extra_curricular AS SELECT textcat_all(tabl.obs) AS textcat_all FROM ( SELECT phe.observacao AS obs - FROM historico_escolar phe + FROM pmieducar.historico_escolar phe WHERE phe.ref_cod_aluno = historico_disciplinas.ref_ref_cod_aluno AND phe.ativo = 1 AND phe.extra_curricular = 1 @@ -141,7 +141,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_series_anos_extra_curricular AS ORDER BY phe.ano ) tabl ) AS observacao_all - FROM historico_escolar + FROM pmieducar.historico_escolar JOIN LATERAL ( SELECT historico_disciplinas_1.sequencial, @@ -150,7 +150,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_series_anos_extra_curricular AS btrim(relatorio.get_texto_sem_caracter_especial(historico_disciplinas_1.nm_disciplina::character varying)::text) AS disciplina, historico_disciplinas_1.nota, historico_disciplinas_1.faltas - FROM historico_disciplinas historico_disciplinas_1 + FROM pmieducar.historico_disciplinas historico_disciplinas_1 ) historico_disciplinas ON historico_escolar.ref_cod_aluno = historico_disciplinas.ref_ref_cod_aluno AND historico_escolar.sequencial = historico_disciplinas.ref_sequencial JOIN LATERAL ( SELECT @@ -249,7 +249,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_series_anos_extra_curricular AS historico_disciplinas_1.dependencia::text AS dependencia_value, historico_disciplinas_1.disciplina, historico_escolar_1.ref_cod_aluno - FROM historico_escolar historico_escolar_1 + FROM pmieducar.historico_escolar historico_escolar_1 JOIN LATERAL ( SELECT historico_disciplinas_2.sequencial, @@ -260,7 +260,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_series_anos_extra_curricular AS historico_disciplinas_2.faltas, historico_disciplinas_2.carga_horaria_disciplina, historico_disciplinas_2.dependencia - FROM historico_disciplinas historico_disciplinas_2 + FROM pmieducar.historico_disciplinas historico_disciplinas_2 ) historico_disciplinas_1 ON historico_escolar_1.ref_cod_aluno = historico_disciplinas_1.ref_ref_cod_aluno AND historico_escolar_1.sequencial = historico_disciplinas_1.ref_sequencial WHERE historico_escolar_1.extra_curricular = 1 AND historico_escolar_1.ativo = 1 @@ -270,7 +270,7 @@ CREATE OR REPLACE VIEW relatorio.view_historico_series_anos_extra_curricular AS AND historico_escolar_1.sequencial = ( ( SELECT hee.sequencial - FROM historico_escolar hee + FROM pmieducar.historico_escolar hee WHERE "substring"(hee.nm_serie::text, 1, 1) = "substring"(historico_escolar_1.nm_serie::text, 1, 1) AND hee.ref_cod_aluno = historico_escolar_1.ref_cod_aluno AND hee.extra_curricular = 1 @@ -320,4 +320,4 @@ CREATE OR REPLACE VIEW relatorio.view_historico_series_anos_extra_curricular AS historico_por_disciplina.nota, historico_por_disciplina.carga_horaria_disciplina, historico_por_disciplina.dependencia - ORDER BY ordenamento, historico_disciplinas.disciplina; \ No newline at end of file + ORDER BY ordenamento, historico_disciplinas.disciplina;