-- queries for updating a jobs service database generated with OSL 1.33.0, to OSL 1.34.0

create table if not exists kogito_data_cache (
    key varchar(255) not null,
    name varchar(255) not null,
    json_value jsonb,
    primary key (key, name)
);

UPDATE flyway_schema_history set installed_rank = installed_rank + 1 WHERE installed_rank = 6;
UPDATE flyway_schema_history set installed_rank = installed_rank + 1 WHERE installed_rank = 5;
UPDATE flyway_schema_history set installed_rank = installed_rank + 1 WHERE installed_rank = 4;
UPDATE flyway_schema_history set installed_rank = installed_rank + 1 WHERE installed_rank = 3;
UPDATE flyway_schema_history set installed_rank = installed_rank + 1 WHERE installed_rank = 2;
UPDATE flyway_schema_history set installed_rank = installed_rank + 1 WHERE installed_rank = 1;

insert into flyway_schema_history values (1, '1.5.0', 'kogito apps create kogito data cache', 'SQL', 'db/migration/V1.5.0__kogito_apps_create_kogito_data_cache.sql', 333636003, 'postgres', '2024-01-01 00:00:01.000000', 22, true);


UPDATE flyway_schema_history SET checksum = -1617474746 WHERE checksum = 1722286283 AND version = '1.32.0';
UPDATE flyway_schema_history SET checksum = -238684566 WHERE checksum = 799676352 AND version = '1.44.0';
UPDATE flyway_schema_history SET checksum = 2057259052 WHERE checksum = 1929821678 AND version = '1.45.0.0';
UPDATE flyway_schema_history SET checksum = 1038959302 WHERE checksum = 1858786130 AND version = '1.45.0.1';
UPDATE flyway_schema_history SET checksum = 476481841 WHERE checksum = 1108215354 AND version = '1.45.0.2';
UPDATE flyway_schema_history SET checksum = -1303498017 WHERE checksum = 1740979619 AND version = '1.45.0.3';


