cleanup + documentation and add the current schema-dump

This commit is contained in:
Michael Hoennig 2025-01-28 06:26:14 +01:00
parent 9c6a4263bc
commit ace819f0b6
2 changed files with 17174 additions and 6 deletions

View File

@ -19,6 +19,9 @@ import javax.sql.DataSource;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.test.context.jdbc.Sql.ExecutionPhase.BEFORE_TEST_CLASS;
// TODO.impl: The reference-SQL-dump-generation needs to be automated
// HOWTO: generate the prod-reference-SQL-dump during a prod-release
/** Tests, if the Liquibase scripts can be applied to a database ionitialized with schemas
and test-data from a previous version.
@ -33,14 +36,24 @@ import static org.springframework.test.context.jdbc.Sql.ExecutionPhase.BEFORE_TE
<li>create the reference-schema SQL-file with some initializations:</li>
<pre><code>cat >src/test/resources/db/prod-only-office-schema-with-test-data.sql <<EOF
CREATE ROLE postgres;
-- =================================================================================
-- Generated reference-SQL-dump (hopefully of latest prod-release).
-- See: net.hostsharing.hsadminng.hs.migration.LiquibaseCompatibilityIntegrationTest
-- ---------------------------------------------------------------------------------
CREATE ROLE admin;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO admin;
CREATE ROLE restricted;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO restricted;
--
-- Explicit pre-initialization because we cannot use \`pg_dump --create ...\`
-- because the database is already created by Testcontainers.
--
EOF
CREATE ROLE postgres;
CREATE ROLE admin;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO admin;
CREATE ROLE restricted;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO restricted;
EOF
</code></pre>
<li>add the dump to that reference-schema SQL-file:</p>

File diff suppressed because it is too large Load Diff