]> git.proxmox.com Git - pmg-api.git/commit
backup: reorder tables in order of dependency
authorStoiko Ivanov <s.ivanov@proxmox.com>
Thu, 22 Feb 2024 12:40:50 +0000 (13:40 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 22 Feb 2024 13:28:22 +0000 (14:28 +0100)
commit81d6c9c1c90527d5690ab7f743666fcdc33c91b6
treed03656d034c828aa58c4c1088881044f94021c52
parente952aea7984c261e6680f18d782e27179e534017
backup: reorder tables in order of dependency

Currently we dump the tables manually and print the relevant DDL
statements into the dump-file before copying the data.

The complete backup and dump specific tables part would probably be
best replaced by an appropriate `pg_dump` invocation - but as a
stop-gap measure reorder the tables in order of their dependencies.

Noticed while adding a foreign key constraint on 2 new tables
(objectgroup_attribute and rule_attribute) and running backup+restore.

Reported-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
src/PMG/Backup.pm