rebuild_all_automdates — rebuild the automatic Mdates of all individuals
int
rebuild_all_automdates
(
|
) ; |
This procedure rebuilds the automatic Mdates of all individuals on the CENSUS table.
This routine should not be run while triggers (automatic data validation) are enabled.
-- Turn off triggers by e.g.:
-- cd db/triggers
-- make BABASE_DB=babase_foo destroy
BEGIN;
-- Empty those tables that could refer to automdates.
DELETE FROM cycstats;
DELETE FROM mmintervals;
DELETE FROM mdintervals;
SELECT rebuild_all_automdates();
-- Commit so that triggers can be re-installed.
COMMIT;
-- Re-install trigges by e.g.:
-- cd db/triggers
-- make BABASE_DB=babase_foo install
BEGIN;
-- Rebuild the cycles.seq and cycles.series columns
SELECT rebuild_all_cycles();
-- Rebuild the tables temporarly emptied.
SELECT rebuild_all_cycstats();
SELECT rebuild_all_mmintervals();
SELECT rebuild_all_mdintervals();
COMMIT;