Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SEVERE 3/19/18 9:45 AM: liquibase: assemblyChangelog.xml: /opt/R1/share/n2o-liquibase/liquibase/db/changelog/201802221400_create_or_replace_set_result_appointment_queue_state_funtion.xml::set_result_appointment_queue_state_funtion::yditarova: Change Set /opt/R1/share/n2o-liquibase/liquibase/db/changelog/201802221400_create_or_replace_set_result_appointment_queue_state_funtion.xml::set_result_appointment_queue_state_funtion::yditarova failed. Error: ERROR: function public.set_result_appointment_queue_state_log(integer, integer, integer) does not exist [Failed SQL: DROP FUNCTION public.set_result_appointment_queue_state_log(integer, integer, integer);
- CREATE OR REPLACE FUNCTION public.set_result_appointment_queue_state_log(
- appointmentId integer,
- user_id integer,
- org_id integer,
- dep_id integer)
- RETURNS integer AS
- $BODY$
- DECLARE
- showButtonReceptionOver boolean;
- openVisitByClickAppeared boolean;
- BEGIN
- showButtonReceptionOver = (SELECT case when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Clinic' and mc.id = org_id::integer)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Clinic' and mc.id = org_id::integer limit 1)
- when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Global')
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Global' limit 1)
- else (select default_value from cmn_setting where id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' limit 1)
- end)::boolean;
- openVisitByClickAppeared = (SELECT case when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join sec_user su on su.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'User' and su.id = user_id::integer)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join sec_user su on su.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'User' and su.id = user_id::integer limit 1)
- when exists (select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join pim_department pd on pd.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Department' and pd.id = dep_id)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join pim_department pd on pd.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Department' and pd.id = dep_id limit 1)
- when exists (select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Clinic' and mc.id = org_id::integer)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Clinic' and mc.id = org_id::integer limit 1)
- when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Global')
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Global' limit 1)
- else (select default_value from cmn_setting where id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' limit 1)
- end)::boolean;
- IF (appointmentId is not NULL and showButtonReceptionOver and openVisitByClickAppeared) THEN
- UPDATE md_appointment SET queue_state_id = (select id from md_appointment_queue_state where code =
- 'OVER' limit 1) where id = appointmentId;
- insert into md_appointment_queue_state_log (appointment_id, user_id, queue_state) values(appointmentId, user_id, (select id from md_appointment_queue_state where code =
- 'OVER' limit 1) );
- ELSE IF (appointmentId is not NULL) THEN
- UPDATE md_appointment SET queue_state_id = (select id from md_appointment_queue_state where code =
- 'RECEIVED' limit 1) where id = appointmentId;
- END IF;
- END IF;
- return appointmentId;
- END;
- $BODY$
- LANGUAGE plpgsql VOLATILE
- COST 100;]
- liquibase.exception.DatabaseException: ERROR: function public.set_result_appointment_queue_state_log(integer, integer, integer) does not exist [Failed SQL: DROP FUNCTION public.set_result_appointment_queue_state_log(integer, integer, integer);
- CREATE OR REPLACE FUNCTION public.set_result_appointment_queue_state_log(
- appointmentId integer,
- user_id integer,
- org_id integer,
- dep_id integer)
- RETURNS integer AS
- $BODY$
- DECLARE
- showButtonReceptionOver boolean;
- openVisitByClickAppeared boolean;
- BEGIN
- showButtonReceptionOver = (SELECT case when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Clinic' and mc.id = org_id::integer)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Clinic' and mc.id = org_id::integer limit 1)
- when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Global')
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Global' limit 1)
- else (select default_value from cmn_setting where id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' limit 1)
- end)::boolean;
- openVisitByClickAppeared = (SELECT case when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join sec_user su on su.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'User' and su.id = user_id::integer)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join sec_user su on su.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'User' and su.id = user_id::integer limit 1)
- when exists (select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join pim_department pd on pd.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Department' and pd.id = dep_id)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join pim_department pd on pd.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Department' and pd.id = dep_id limit 1)
- when exists (select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Clinic' and mc.id = org_id::integer)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Clinic' and mc.id = org_id::integer limit 1)
- when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Global')
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Global' limit 1)
- else (select default_value from cmn_setting where id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' limit 1)
- end)::boolean;
- IF (appointmentId is not NULL and showButtonReceptionOver and openVisitByClickAppeared) THEN
- UPDATE md_appointment SET queue_state_id = (select id from md_appointment_queue_state where code =
- 'OVER' limit 1) where id = appointmentId;
- insert into md_appointment_queue_state_log (appointment_id, user_id, queue_state) values(appointmentId, user_id, (select id from md_appointment_queue_state where code =
- 'OVER' limit 1) );
- ELSE IF (appointmentId is not NULL) THEN
- UPDATE md_appointment SET queue_state_id = (select id from md_appointment_queue_state where code =
- 'RECEIVED' limit 1) where id = appointmentId;
- END IF;
- END IF;
- return appointmentId;
- END;
- $BODY$
- LANGUAGE plpgsql VOLATILE
- COST 100;]
- at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:316)
- at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
- at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:122)
- at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1247)
- at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1230)
- at liquibase.changelog.ChangeSet.execute(ChangeSet.java:548)
- at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
- at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73)
- at liquibase.Liquibase.update(Liquibase.java:210)
- at liquibase.Liquibase.update(Liquibase.java:190)
- at liquibase.integration.commandline.Main.doMigration(Main.java:1096)
- at liquibase.integration.commandline.Main.run(Main.java:180)
- at liquibase.integration.commandline.Main.main(Main.java:99)
- Caused by: org.postgresql.util.PSQLException: ERROR: function public.set_result_appointment_queue_state_log(integer, integer, integer) does not exist
- at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198)
- at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927)
- at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
- at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561)
- at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:405)
- at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:397)
- at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:314)
- ... 12 more
- INFO 3/19/18 9:45 AM: liquibase: /opt/R1/share/n2o-liquibase/liquibase/db/changelog/201802221400_create_or_replace_set_result_appointment_queue_state_funtion.xml::set_result_appointment_queue_state_funtion::yditarova: Successfully released change log lock
- Unexpected error running Liquibase: ERROR: function public.set_result_appointment_queue_state_log(integer, integer, integer) does not exist [Failed SQL: DROP FUNCTION public.set_result_appointment_queue_state_log(integer, integer, integer);
- CREATE OR REPLACE FUNCTION public.set_result_appointment_queue_state_log(
- appointmentId integer,
- user_id integer,
- org_id integer,
- dep_id integer)
- RETURNS integer AS
- $BODY$
- DECLARE
- showButtonReceptionOver boolean;
- openVisitByClickAppeared boolean;
- BEGIN
- showButtonReceptionOver = (SELECT case when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Clinic' and mc.id = org_id::integer)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Clinic' and mc.id = org_id::integer limit 1)
- when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Global')
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Global' limit 1)
- else (select default_value from cmn_setting where id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' limit 1)
- end)::boolean;
- openVisitByClickAppeared = (SELECT case when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join sec_user su on su.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'User' and su.id = user_id::integer)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join sec_user su on su.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'User' and su.id = user_id::integer limit 1)
- when exists (select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join pim_department pd on pd.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Department' and pd.id = dep_id)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join pim_department pd on pd.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Department' and pd.id = dep_id limit 1)
- when exists (select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Clinic' and mc.id = org_id::integer)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Clinic' and mc.id = org_id::integer limit 1)
- when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Global')
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Global' limit 1)
- else (select default_value from cmn_setting where id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' limit 1)
- end)::boolean;
- IF (appointmentId is not NULL and showButtonReceptionOver and openVisitByClickAppeared) THEN
- UPDATE md_appointment SET queue_state_id = (select id from md_appointment_queue_state where code =
- 'OVER' limit 1) where id = appointmentId;
- insert into md_appointment_queue_state_log (appointment_id, user_id, queue_state) values(appointmentId, user_id, (select id from md_appointment_queue_state where code =
- 'OVER' limit 1) );
- ELSE IF (appointmentId is not NULL) THEN
- UPDATE md_appointment SET queue_state_id = (select id from md_appointment_queue_state where code =
- 'RECEIVED' limit 1) where id = appointmentId;
- END IF;
- END IF;
- return appointmentId;
- END;
- $BODY$
- LANGUAGE plpgsql VOLATILE
- COST 100;]
- SEVERE 3/19/18 9:45 AM: liquibase: /opt/R1/share/n2o-liquibase/liquibase/db/changelog/201802221400_create_or_replace_set_result_appointment_queue_state_funtion.xml::set_result_appointment_queue_state_funtion::yditarova: ERROR: function public.set_result_appointment_queue_state_log(integer, integer, integer) does not exist [Failed SQL: DROP FUNCTION public.set_result_appointment_queue_state_log(integer, integer, integer);
- CREATE OR REPLACE FUNCTION public.set_result_appointment_queue_state_log(
- appointmentId integer,
- user_id integer,
- org_id integer,
- dep_id integer)
- RETURNS integer AS
- $BODY$
- DECLARE
- showButtonReceptionOver boolean;
- openVisitByClickAppeared boolean;
- BEGIN
- showButtonReceptionOver = (SELECT case when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Clinic' and mc.id = org_id::integer)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Clinic' and mc.id = org_id::integer limit 1)
- when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Global')
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Global' limit 1)
- else (select default_value from cmn_setting where id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' limit 1)
- end)::boolean;
- openVisitByClickAppeared = (SELECT case when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join sec_user su on su.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'User' and su.id = user_id::integer)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join sec_user su on su.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'User' and su.id = user_id::integer limit 1)
- when exists (select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join pim_department pd on pd.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Department' and pd.id = dep_id)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join pim_department pd on pd.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Department' and pd.id = dep_id limit 1)
- when exists (select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Clinic' and mc.id = org_id::integer)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Clinic' and mc.id = org_id::integer limit 1)
- when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Global')
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Global' limit 1)
- else (select default_value from cmn_setting where id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' limit 1)
- end)::boolean;
- IF (appointmentId is not NULL and showButtonReceptionOver and openVisitByClickAppeared) THEN
- UPDATE md_appointment SET queue_state_id = (select id from md_appointment_queue_state where code =
- 'OVER' limit 1) where id = appointmentId;
- insert into md_appointment_queue_state_log (appointment_id, user_id, queue_state) values(appointmentId, user_id, (select id from md_appointment_queue_state where code =
- 'OVER' limit 1) );
- ELSE IF (appointmentId is not NULL) THEN
- UPDATE md_appointment SET queue_state_id = (select id from md_appointment_queue_state where code =
- 'RECEIVED' limit 1) where id = appointmentId;
- END IF;
- END IF;
- return appointmentId;
- END;
- $BODY$
- LANGUAGE plpgsql VOLATILE
- COST 100;]
- liquibase.exception.MigrationFailedException: Migration failed for change set /opt/R1/share/n2o-liquibase/liquibase/db/changelog/201802221400_create_or_replace_set_result_appointment_queue_state_funtion.xml::set_result_appointment_queue_state_funtion::yditarova:
- Reason: liquibase.exception.DatabaseException: ERROR: function public.set_result_appointment_queue_state_log(integer, integer, integer) does not exist [Failed SQL: DROP FUNCTION public.set_result_appointment_queue_state_log(integer, integer, integer);
- CREATE OR REPLACE FUNCTION public.set_result_appointment_queue_state_log(
- appointmentId integer,
- user_id integer,
- org_id integer,
- dep_id integer)
- RETURNS integer AS
- $BODY$
- DECLARE
- showButtonReceptionOver boolean;
- openVisitByClickAppeared boolean;
- BEGIN
- showButtonReceptionOver = (SELECT case when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Clinic' and mc.id = org_id::integer)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Clinic' and mc.id = org_id::integer limit 1)
- when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Global')
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Global' limit 1)
- else (select default_value from cmn_setting where id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' limit 1)
- end)::boolean;
- openVisitByClickAppeared = (SELECT case when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join sec_user su on su.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'User' and su.id = user_id::integer)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join sec_user su on su.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'User' and su.id = user_id::integer limit 1)
- when exists (select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join pim_department pd on pd.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Department' and pd.id = dep_id)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join pim_department pd on pd.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Department' and pd.id = dep_id limit 1)
- when exists (select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Clinic' and mc.id = org_id::integer)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Clinic' and mc.id = org_id::integer limit 1)
- when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Global')
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Global' limit 1)
- else (select default_value from cmn_setting where id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' limit 1)
- end)::boolean;
- IF (appointmentId is not NULL and showButtonReceptionOver and openVisitByClickAppeared) THEN
- UPDATE md_appointment SET queue_state_id = (select id from md_appointment_queue_state where code =
- 'OVER' limit 1) where id = appointmentId;
- insert into md_appointment_queue_state_log (appointment_id, user_id, queue_state) values(appointmentId, user_id, (select id from md_appointment_queue_state where code =
- 'OVER' limit 1) );
- ELSE IF (appointmentId is not NULL) THEN
- UPDATE md_appointment SET queue_state_id = (select id from md_appointment_queue_state where code =
- 'RECEIVED' limit 1) where id = appointmentId;
- END IF;
- END IF;
- return appointmentId;
- END;
- $BODY$
- LANGUAGE plpgsql VOLATILE
- COST 100;]
- at liquibase.changelog.ChangeSet.execute(ChangeSet.java:584)
- at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
- at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73)
- at liquibase.Liquibase.update(Liquibase.java:210)
- at liquibase.Liquibase.update(Liquibase.java:190)
- at liquibase.integration.commandline.Main.doMigration(Main.java:1096)
- at liquibase.integration.commandline.Main.run(Main.java:180)
- at liquibase.integration.commandline.Main.main(Main.java:99)
- Caused by: liquibase.exception.DatabaseException: ERROR: function public.set_result_appointment_queue_state_log(integer, integer, integer) does not exist [Failed SQL: DROP FUNCTION public.set_result_appointment_queue_state_log(integer, integer, integer);
- CREATE OR REPLACE FUNCTION public.set_result_appointment_queue_state_log(
- appointmentId integer,
- user_id integer,
- org_id integer,
- dep_id integer)
- RETURNS integer AS
- $BODY$
- DECLARE
- showButtonReceptionOver boolean;
- openVisitByClickAppeared boolean;
- BEGIN
- showButtonReceptionOver = (SELECT case when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Clinic' and mc.id = org_id::integer)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Clinic' and mc.id = org_id::integer limit 1)
- when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Global')
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' and cst.code = 'Global' limit 1)
- else (select default_value from cmn_setting where id = 'cz.atria.md.planning.PlanningSettings.showButtonreceptionOver' limit 1)
- end)::boolean;
- openVisitByClickAppeared = (SELECT case when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join sec_user su on su.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'User' and su.id = user_id::integer)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join sec_user su on su.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'User' and su.id = user_id::integer limit 1)
- when exists (select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join pim_department pd on pd.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Department' and pd.id = dep_id)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join pim_department pd on pd.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Department' and pd.id = dep_id limit 1)
- when exists (select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Clinic' and mc.id = org_id::integer)
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join md_clinic mc on mc.scope_id = cs.id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Clinic' and mc.id = org_id::integer limit 1)
- when exists(select 1 from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Global')
- then (select value from cmn_setting_value csv
- join cmn_scope cs on cs.id = csv.scope_id
- join cmn_scope_type cst on cst.id=cs.type_id
- where setting_id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' and cst.code = 'Global' limit 1)
- else (select default_value from cmn_setting where id = 'cz.atria.md.planning.PlanningSettings.openVisitByClickAppeared' limit 1)
- end)::boolean;
- IF (appointmentId is not NULL and showButtonReceptionOver and openVisitByClickAppeared) THEN
- UPDATE md_appointment SET queue_state_id = (select id from md_appointment_queue_state where code =
- 'OVER' limit 1) where id = appointmentId;
- insert into md_appointment_queue_state_log (appointment_id, user_id, queue_state) values(appointmentId, user_id, (select id from md_appointment_queue_state where code =
- 'OVER' limit 1) );
- ELSE IF (appointmentId is not NULL) THEN
- UPDATE md_appointment SET queue_state_id = (select id from md_appointment_queue_state where code =
- 'RECEIVED' limit 1) where id = appointmentId;
- END IF;
- END IF;
- return appointmentId;
- END;
- $BODY$
- LANGUAGE plpgsql VOLATILE
- COST 100;]
- at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:316)
- at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
- at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:122)
- at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1247)
- at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1230)
- at liquibase.changelog.ChangeSet.execute(ChangeSet.java:548)
- ... 7 more
- Caused by: org.postgresql.util.PSQLException: ERROR: function public.set_result_appointment_queue_state_log(integer, integer, integer) does not exist
- at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198)
- at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927)
- at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
- at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561)
- at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:405)
- at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:397)
- at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:314)
- ... 12 more
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement