
----------------------------------------------------
-- 2.5.15.3
-- SQL for this version ends here
----------------------------------------------------

alter table agenda_definition alter column id_agenda_segment_attribute_group_definition set not null;

----------------------------------------------------
-- 2.6.0.0
-- SQL for this version ends here
----------------------------------------------------

-- #13757 - added missing not null
alter table attribute alter column id_attribute_data_type set not null;

----------------------------------------------------
-- 2.6.1.0
-- SQL for this version ends here
----------------------------------------------------

ALTER TABLE email_definition drop CONSTRAINT fk_email_definition_report;
ALTER TABLE email_definition ADD CONSTRAINT fk_email_definition_report FOREIGN KEY (id_report) REFERENCES reporting.report(id) ON UPDATE RESTRICT ON DELETE RESTRICT;

----------------------------------------------------
-- 2.6.2.0
-- SQL for this version ends here
----------------------------------------------------

--------------------------
-- #13634 - permissions --

alter table user_group_has_agenda
    alter column is_can_create set not null;

alter table user_group_has_agenda
    alter column is_can_delete set not null;

-- #13634 - permissions --
--------------------------

----------------------------------------------------
-- 2.6.5.4
-- SQL for this version ends here
----------------------------------------------------

alter table custom_import_row drop column id_agenda_entity;

----------------------------------------------------
-- 2.6.6.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.7.3'
where id_configuration_definition = (
    SELECT ID FROM configuration.configuration_definition WHERE name = 'db_version'
);

----------------------------------------------------
-- 2.6.7.3
-- SQL for this version ends here
----------------------------------------------------
-- version
update configuration.configuration_values set value = '2.6.7.4'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.7.4
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.7.5'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.7.5
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.8.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.8.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.8.1'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.8.1
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.8.2'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.8.2
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.8.3'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.8.3
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.8.4'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.8.4
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.8.5'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.8.5
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.9.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.9.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.9.1'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.9.1
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.9.2'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.9.2
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.9.3'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.9.3
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.9.4'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.9.4
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.10.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.10.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.10.1'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.10.1
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.10.2'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.10.2
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.10.3'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.10.3
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.10.4'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.10.4
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.10.5'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.10.5
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.11.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.11.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.11.1'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.11.1
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.11.2'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.11.2
-- SQL for this version ends here
----------------------------------------------------


-- version
update configuration.configuration_values set value = '2.6.11.3'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.11.3
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.12.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.12.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.12.1'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.12.1
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.12.2'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.12.2
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.12.3'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.12.3
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.12.4'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.12.4
-- SQL for this version ends here
----------------------------------------------------

CREATE UNIQUE INDEX unq_mv_agenda_definition_title_priority
    ON flexii.mv_agenda_definition (id_agenda, in_title_and_priority);

-- version
update configuration.configuration_values set value = '2.6.13.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.13.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.14.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.14.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.14.1'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.14.1
-- SQL for this version ends here
----------------------------------------------------

DROP TABLE agenda_has_custom_class;

-- version
update configuration.configuration_values set value = '2.6.15.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.15.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.15.1'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.15.1
-- SQL for this version ends here
----------------------------------------------------

ALTER TABLE agenda_definition DROP COLUMN is_in_datagrid;

-- version
update configuration.configuration_values set value = '2.6.16.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.16.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.16.1'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.16.1
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.16.2'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.16.2
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.16.3'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.16.3
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.16.4'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.16.4
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.17.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.17.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.17.1'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.17.1
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.18.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.18.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.18.1'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.18.1
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.18.2'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.18.2
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.19.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.19.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.19.1'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.19.1
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.19.2'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.19.2
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.20.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.20.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.20.1'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.20.1
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.21.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.21.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.21.1'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.21.1
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.22.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.22.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.22.1'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.22.1
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.22.2'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.22.2
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.22.3'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.22.3
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.22.4'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.22.4
-- SQL for this version ends here
----------------------------------------------------

-- #15309
ALTER TABLE agenda_definition_specification_by_value DROP CONSTRAINT unq_agenda_definition_specification_by_value_main;
ALTER TABLE agenda_definition_specification_by_value ADD CONSTRAINT unq_agenda_definition_specification_by_value_main UNIQUE NULLS NOT DISTINCT (id_agenda_definition,id_agenda_definition_control,value_control,recurring_sequence);

-- version
update configuration.configuration_values set value = '2.6.22.5'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.22.5
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.23.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.23.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.23.1'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.23.1
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.23.2'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.23.2
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.24.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.24.0
-- SQL for this version ends here
----------------------------------------------------

-- #15519 - lookup_yes_no
UPDATE agenda_definition
SET default_value = 0
WHERE default_value = (SELECT id::varchar FROM master_lookup WHERE lookup_name = 'lookup_yes_no' AND name = 'no')
  AND id_attribute IN (SELECT id FROM attribute WHERE lookup = 'lookup_yes_no');

UPDATE agenda_definition
SET default_value = 1
WHERE default_value = (SELECT id::varchar FROM master_lookup WHERE lookup_name = 'lookup_yes_no' AND name = 'yes')
  AND id_attribute IN (SELECT id FROM attribute WHERE lookup = 'lookup_yes_no');

UPDATE agenda_values
SET value = 0
WHERE id_agenda_definition IN (SELECT id
                               FROM mv_agenda_definition
                               WHERE id_attribute IN (SELECT id FROM ATTRIBUTE WHERE lookup = 'lookup_yes_no'))
  AND value = (SELECT id::varchar FROM master_lookup WHERE lookup_name = 'lookup_yes_no' AND name = 'no');

UPDATE agenda_values
SET value = 1
WHERE id_agenda_definition IN (SELECT id
                               FROM mv_agenda_definition
                               WHERE id_attribute IN (SELECT id FROM ATTRIBUTE WHERE lookup = 'lookup_yes_no'))
  AND value = (SELECT id::varchar FROM master_lookup WHERE lookup_name = 'lookup_yes_no' AND name = 'yes');

UPDATE attribute
SET id_attribute_data_type = (SELECT id FROM attribute_data_type WHERE name = 'bool')
WHERE id IN (SELECT id FROM attribute WHERE lookup = 'lookup_yes_no');

REFRESH MATERIALIZED VIEW mv_agenda_definition;

DELETE FROM master_lookup WHERE lookup_name = 'lookup_yes_no';


-- #15519 - lookup_bool
UPDATE agenda_definition
SET default_value = 0
WHERE default_value = (SELECT id::varchar FROM master_lookup WHERE lookup_name = 'lookup_bool' AND name = 'false')
  AND id_attribute IN (SELECT id FROM attribute WHERE lookup = 'lookup_bool');

UPDATE agenda_definition
SET default_value = 1
WHERE default_value = (SELECT id::varchar FROM master_lookup WHERE lookup_name = 'lookup_bool' AND name = 'true')
  AND id_attribute IN (SELECT id FROM attribute WHERE lookup = 'lookup_bool');

UPDATE agenda_values
SET value = 0
WHERE id_agenda_definition IN (SELECT id
                               FROM mv_agenda_definition
                               WHERE id_attribute IN (SELECT id FROM ATTRIBUTE WHERE lookup = 'lookup_bool'))
  AND value = (SELECT id::varchar FROM master_lookup WHERE lookup_name = 'lookup_bool' AND name = 'false');

UPDATE agenda_values
SET value = 1
WHERE id_agenda_definition IN (SELECT id
                               FROM mv_agenda_definition
                               WHERE id_attribute IN (SELECT id FROM ATTRIBUTE WHERE lookup = 'lookup_bool'))
  AND value = (SELECT id::varchar FROM master_lookup WHERE lookup_name = 'lookup_bool' AND name = 'true');

UPDATE attribute
SET id_attribute_data_type = (SELECT id FROM attribute_data_type WHERE name = 'bool')
WHERE id IN (SELECT id FROM attribute WHERE lookup = 'lookup_bool');

REFRESH MATERIALIZED VIEW mv_agenda_definition;

DELETE FROM master_lookup WHERE lookup_name = 'lookup_bool';

-- version
update configuration.configuration_values set value = '2.6.24.1'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.24.1
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.25.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.25.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.26.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.26.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.27.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.27.0
-- SQL for this version ends here
----------------------------------------------------

-- #15569
UPDATE flexii.agenda_definition set is_search_by = false WHERE in_title_and_priority IS NOT NULL;

ALTER TABLE flexii.agenda_definition
    ADD CONSTRAINT check_is_search_by_in_title_and_priority
        CHECK (
            NOT (is_search_by AND in_title_and_priority IS NOT NULL)
            );

REFRESH MATERIALIZED VIEW mv_agenda_definition;

-- version
update configuration.configuration_values set value = '2.6.28.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.28.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.28.1'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.28.1
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.28.2'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.28.2
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.28.3'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.28.3
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.29.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.29.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.30.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.30.0
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.30.1'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.30.1
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.30.2'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.30.2
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.30.3'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.30.3
-- SQL for this version ends here
----------------------------------------------------

-- version
update configuration.configuration_values set value = '2.6.31.0'
where id_configuration_definition = (
    select id from configuration.configuration_definition where name = 'db_version'
);

----------------------------------------------------
-- 2.6.31.0
-- SQL for this version ends here
----------------------------------------------------
