Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Highlights:

AAM-1069 - Getting issue details... STATUS

AAM-1078 - Getting issue details... STATUS

AAM-1085 - Getting issue details... STATUS

AAM-1048 - Getting issue details... STATUS

Bug fixes:

AAM-1074 - Getting issue details... STATUS

Stories:

AAM-1069 - Getting issue details... STATUS

AAM-1078 - Getting issue details... STATUS

Tasks:

AAM-1085 - Getting issue details... STATUS

AAM-1048 - Getting issue details... STATUS

AAM-1075 - Getting issue details... STATUS

AAM-1083 - Getting issue details... STATUS

AAM-1071 - Getting issue details... STATUS

Breaking Changes:

  1. Upload the latest SECURITY_MODULE template. Then run the 2nd step of SQL Fixes. Delete the old SECURITY_MODULE template.

  2. Upload the latest PARTICIPANT_MODULE template. Then run the 3rd step of SQL Fixes. Delete the old PARTICIPANT_MODULE template.

  3. Run the 4th step of SQL Fixes stored procedure. Then import an empty file in all the initialized projects.

  4. Restart gui-server

SQL Fixes:

  1. AAM-1069: As a project admin I want to shield archive entities in Asta 7 to only give access to the correct users

alter table field add create_index bool;
update field set create_index = false;
alter table field alter column create_index set not null;

alter table entity_structure add create_index bool;
update entity_structure set create_index = true;
alter table entity_structure alter column create_index set not null;

2. AAM-1078: As an Asta 7 user I want a set of predefined restrictions to select from when setting up a new restriction

update system_template set template_id = 'd10f1600-00db-4733-b4f5-858feb69103f' where name = 'SECURITY_MODULE';
do $$
    declare
        r record;
    begin
        for r in select id FROM project where archive_initialized = true
            loop
                execute 'alter table if exists ' || r.id || '.restriction add column if not exists is_predefined_for_suggestion boolean null';
                execute 'alter table if exists ' || r.id || '.restriction alter column name type varchar(1000)';
            end loop;
    end; $$

3. AAM-1085: Add startdato & sluttdato on PARTICIPANT_MODULE template AKTOR_RELASJON entity

update system_template set template_id = 'ccff22f4-d532-4d1b-add5-5427d1044e09' where name = 'PARTICIPANT_MODULE';
do $$
    declare
        r record;
    begin
        for r in select id FROM project where archive_initialized = true
            loop
                execute 'alter table if exists ' || r.id || '.aktor_relasjon add column if not exists startdato varchar null';
                execute 'alter table if exists ' || r.id || '.aktor_relasjon add column if not exists sluttdato varchar null';
                execute 'alter table if exists ' || r.id || '.aktor_relasjon drop column if exists object_reference';
            end loop;
    end; $$

4. AAM-1074: DROP CONSTRAINT PKEY error during import when using two child entities with generated PK's in template

do $$
    declare
        r record;
        sql varchar;
    begin
        for r in SELECT
                     tc.table_schema,
                     tc.constraint_name,
                     tc.table_name,
                     kcu.column_name,
                     ccu.table_schema AS foreign_table_schema,
                     ccu.table_name AS foreign_table_name,
                     ccu.column_name AS foreign_column_name
                 FROM
                     information_schema.table_constraints AS tc
                         JOIN information_schema.key_column_usage AS kcu
                              ON tc.constraint_name = kcu.constraint_name
                                  AND tc.table_schema = kcu.table_schema
                         JOIN information_schema.constraint_column_usage AS ccu
                              ON ccu.constraint_name = tc.constraint_name
                                  AND ccu.table_schema = tc.table_schema
                 WHERE tc.constraint_type = 'FOREIGN KEY' and tc.table_schema in (select id from project where archive_initialized = true)
            loop
                sql := 'alter table ' || r.table_schema || '.' || r.table_name ||' drop constraint if exists '|| r.constraint_name;
                -- raise notice '%', sql;
                execute sql;
            end loop;

        for r in select schemaname, tablename, indexname from pg_indexes where schemaname in (select id from project where archive_initialized = true) and indexname like 'index%'
            loop
                sql := 'drop index if exists ' || r.schemaname || '.' || r.indexname;
                execute sql;
                -- raise notice '%', sql;
            end loop;
    end;
$$;

How to Run SQL Fixes

  1. Copy the SQL fixes to a file, let’s assume the file name is upgrade.sql.

  2. Copy the upgrade.sql file to the Postgres container

    docker cp /path_to_file/upgrade.sql am-postgres:/tmp
  3. Run the upgrade.sql file using the Postgres shell, with the default credentials the command would be

    docker exec -e PGPASSWORD=archive-manager am-postgres psql -U archive-manager am_db -f /tmp/upgrade.sql

Configuration:

  • No labels