The DB up-to-date check uses Liquibase.listUnrunChangeSets() that in
its available variants unconditionally creates a DatabaseChangeLog
tables. Until the variant of listUnrunChangeSets() that suppresses this
behaviour is made public [1] (currently it is protected), workaround
has been implemented that invokes less invasive variant of
listUnrunChangeSets() via reflection.
[1] https://liquibase.jira.com/browse/CORE-2919
Creation of database table DatabaseChangeLog was omitted from SQL
script which prevented creation of the database from scratch. The fix
adds DDL commands to create the table to the output SQL script in case
of empty database initialization.
Please note that DatabaseChangeLogLock is intentionally omitted. It is
created automatically before the update is even executed because a lock
is acquired (thus the table is properly created if it does not exist)
before check for up-to-dateness of database and potential migration in
KeycloakApplication constructor.
Liquibase Moved schema evolution configuration from jpa-changelog-2.1.0
to jpa-changelog-2.2.0.
Corrected wrong ResourceType references in tests.
Adapted AdminEvents copy-routines to be aware of resourceType attribute.
Added ResourceType enum to exposed ENUMS of ServerInfoAdminResource.
Signed-off-by: Thomas Darimont <thomas.darimont@gmail.com>
Introduced new ResourceType enum for AdminEvents which lists
the current supported ResourceTypes for which AdminEvents
can be fired.
Previously it was difficult for custom EventListeners to figure
out which ResourceType triggered an AdminEvent in order
to handle it appropriately, effectively forcing users to parse
the representation.
Having dedicated resource types as a marker on an AdminEvent helps
to ease custom EventListener code.
We now also allow filtering of admin events by ResourceType in the
admin-console.
Signed-off-by: Thomas Darimont <thomas.darimont@gmail.com>