Menu

#997 cleanup-demo-data error

Configuration_DB
open
nobody
Demo data (1)
5
2020-12-29
2020-12-28
Antanas
No

On execution of /intranet/admin/cleanup-demo/cleanup-demo-data error is reported:

update or delete on table "im_baselines" violates foreign key constraint "im_audits_baseline_fk" on table "im_audits"
See details in the attachment.

1 Attachments

Discussion

  • Frank Bergmann

    Frank Bergmann - 2020-12-28

    Hi Antanas,

    Thanks for posting.
    You used the wrong PostgreSQL database dump, apparently.
    Which version do you use and how did you get the dump?

    Cheers
    Frank

     
    • Antanas

      Antanas - 2020-12-28

      Hi Frank,

      Thanks for a quick reply.
      I just now did it from scratch:
      $ psql -f ~/pg_dump.5.0.3.0.0.sql
      The dump obtained from https://sourceforge.net/projects/project-open/files/project-open/V5.0/update/project-open-Update-5.0.3.0.0.tgz

      ]project-open[ Version: 5.0.3.0.0
      OS Platform: Linux
      OS Version: 4.9.0-14-amd64
      TCL Version: 8.5.18
      Web Server Version: 4.99

      /intranet/admin/cleanup-demo/cleanup-demo-data-2? returns same error mentioned above.

       
  • Antanas

    Antanas - 2020-12-29

    Hi Frank,

    one more test this morning starting from very scratch with su - projop -c "dropdb projop".
    Same error.

     
  • Frank Bergmann

    Frank Bergmann - 2020-12-29

    Hi!

    There are apparently objects of type "im_baseline" in the dump that shouldn't be there.
    So let's try to delete them, they are not essential. Actually, you can delete them completely, together with the im_audits entries.

    update im_audits set audit_baseline_id = null;
    update acs_objects set last_audit_id = null;
    update im_audits set audit_last_id = null;
    
    delete from im_baselines;
    delete from im_audits;
    

    Optional:

    delete from acs_objects where object_type = 'im_baseline';
    

    In the case that you get an error message try setting to NULL the referencing object or try to delete the referencing object.

    Cheers
    Frank

     
  • Antanas

    Antanas - 2020-12-29

    Hi Frank,

    that worked well!
    Thank you.

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB