diff --git a/README.md b/README.md index 19a77f52..f7ab026e 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Then start the application with the pgsql profile: gw bootRun -Ppgsql gw bootRun -Ppgsql -Psample-data # populated with sample data -To use a **remote Postgres database** on a hostsharing server, +To use a **remote Postgres database** on a Hostsharing server, autossh -M 0 -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" \ -f -N -L 55432:127.0.0.1:5432 "xyz00@xyz.hostsharing.net" diff --git a/src/main/resources/config/liquibase/historicization/historicization_User.xml b/src/main/resources/config/liquibase/historicization/historicization_User.xml new file mode 100644 index 00000000..7a8ffb63 --- /dev/null +++ b/src/main/resources/config/liquibase/historicization/historicization_User.xml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CREATE TRIGGER jhi_user_historicize + AFTER INSERT OR DELETE OR UPDATE ON jhi_user + FOR EACH ROW EXECUTE PROCEDURE historicize(); + + + DROP TRIGGER jhi_user_historicize + + + + + + SELECT * + FROM jhi_user_history + WHERE history_id IN ( + SELECT max(history_id) AS history_id + FROM jhi_user_history + WHERE history_transaction <= current_setting('history.transaction')::bigint + GROUP BY login) -- must have a unique constraint + + + + diff --git a/src/main/resources/config/liquibase/master.xml b/src/main/resources/config/liquibase/master.xml index 8f6076ce..9c0f7345 100644 --- a/src/main/resources/config/liquibase/master.xml +++ b/src/main/resources/config/liquibase/master.xml @@ -7,7 +7,11 @@ - + + + + + @@ -32,8 +36,7 @@ - - +