Skip to content

Commit

Permalink
Add a new emaj_rel_hist table to keep a trace of tables and sequences…
Browse files Browse the repository at this point in the history
… group ownership for groups that have been dropped or tables and sequences that have been removed from their group. This allows Emaj_web to report this history. The table content has the same retention as the emaj_hist table (1 year by default).
  • Loading branch information
beaud76 committed May 3, 2019
1 parent 806249f commit 4a062d2
Show file tree
Hide file tree
Showing 62 changed files with 13,489 additions and 12,154 deletions.
2 changes: 1 addition & 1 deletion docs/en/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ A **log table** has the same structure as its corresponding application table. H

To let E-Maj work, some **other technical objects** are also created at extension installation time:

* 16 tables,
* 17 tables,
* 8 composite and 3 enum types,
* 1 view,
* 2 triggers,
Expand Down
2 changes: 1 addition & 1 deletion docs/fr/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Une **table de log** a la même structure que la table applicative correspondant

Pour le bon fonctionnement d'E-Maj, un certain nombre d'**objets techniques** sont également créés à l'installation de cette extension :

* 16 tables,
* 17 tables,
* 8 types composites et 3 énumérations,
* 1 vue,
* 2 triggers,
Expand Down
384 changes: 370 additions & 14 deletions sql/emaj--3.0.0--devel.sql

Large diffs are not rendered by default.

121 changes: 95 additions & 26 deletions sql/emaj--devel.sql

Large diffs are not rendered by default.

121 changes: 95 additions & 26 deletions sql/emaj-devel.sql

Large diffs are not rendered by default.

973 changes: 491 additions & 482 deletions test/10/expected/adm1.out

Large diffs are not rendered by default.

2,958 changes: 1,483 additions & 1,475 deletions test/10/expected/adm2.out

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions test/10/expected/alter.out
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ select group_name, group_last_alter_time_id, group_has_waiting_changes, group_nb
from emaj.emaj_group where group_name = 'myGroup1';
group_name | group_last_alter_time_id | group_has_waiting_changes | group_nb_table | group_nb_sequence
------------+--------------------------+---------------------------+----------------+-------------------
myGroup1 | 6009 | t | 5 | 2
myGroup1 | 6014 | t | 5 | 2
(1 row)

select emaj.emaj_alter_group('myGroup1');
Expand All @@ -282,7 +282,7 @@ select group_name, group_last_alter_time_id, group_has_waiting_changes, group_nb
from emaj.emaj_group where group_name = 'myGroup1';
group_name | group_last_alter_time_id | group_has_waiting_changes | group_nb_table | group_nb_sequence
------------+--------------------------+---------------------------+----------------+-------------------
myGroup1 | 6010 | f | 2 | 2
myGroup1 | 6015 | f | 2 | 2
(1 row)

select nspname from pg_namespace where nspname like 'emaj%' order by nspname;
Expand Down Expand Up @@ -318,7 +318,7 @@ select group_name, group_last_alter_time_id, group_has_waiting_changes, group_nb
from emaj.emaj_group where group_name = 'myGroup1';
group_name | group_last_alter_time_id | group_has_waiting_changes | group_nb_table | group_nb_sequence
------------+--------------------------+---------------------------+----------------+-------------------
myGroup1 | 6011 | t | 2 | 1
myGroup1 | 6016 | t | 2 | 1
(1 row)

select emaj.emaj_alter_group('myGroup1');
Expand All @@ -340,7 +340,7 @@ select group_name, group_last_alter_time_id, group_has_waiting_changes, group_nb
from emaj.emaj_group where group_name = 'myGroup1';
group_name | group_last_alter_time_id | group_has_waiting_changes | group_nb_table | group_nb_sequence
------------+--------------------------+---------------------------+----------------+-------------------
myGroup1 | 6012 | f | 5 | 1
myGroup1 | 6017 | f | 5 | 1
(1 row)

select nspname from pg_namespace where nspname like 'emaj%' order by nspname;
Expand Down Expand Up @@ -839,8 +839,8 @@ select group_name, group_last_alter_time_id, group_has_waiting_changes, group_nb
from emaj.emaj_group where group_name IN ('myGroup1','myGroup2') order by group_name;
group_name | group_last_alter_time_id | group_has_waiting_changes | group_nb_table | group_nb_sequence
------------+--------------------------+---------------------------+----------------+-------------------
myGroup1 | 6039 | t | 5 | 2
myGroup2 | 6039 | t | 6 | 2
myGroup1 | 6044 | t | 5 | 2
myGroup2 | 6044 | t | 6 | 2
(2 rows)

select emaj.emaj_alter_groups('{"myGroup1","myGroup2"}');
Expand All @@ -855,8 +855,8 @@ select group_name, group_last_alter_time_id, group_has_waiting_changes, group_nb
from emaj.emaj_group where group_name IN ('myGroup1','myGroup2') order by group_name;
group_name | group_last_alter_time_id | group_has_waiting_changes | group_nb_table | group_nb_sequence
------------+--------------------------+---------------------------+----------------+-------------------
myGroup1 | 6040 | f | 6 | 3
myGroup2 | 6040 | f | 5 | 1
myGroup1 | 6045 | f | 6 | 3
myGroup2 | 6045 | f | 5 | 1
(2 rows)

select rel_group, count(*) from emaj.emaj_relation where rel_group like 'myGroup%' and upper_inf(rel_time_range) group by 1 order by 1;
Expand Down

0 comments on commit 4a062d2

Please sign in to comment.