cleanup + documentation and add the current schema-dump
This commit is contained in:
parent
9c6a4263bc
commit
ace819f0b6
@ -19,6 +19,9 @@ import javax.sql.DataSource;
|
|||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.springframework.test.context.jdbc.Sql.ExecutionPhase.BEFORE_TEST_CLASS;
|
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
|
/** Tests, if the Liquibase scripts can be applied to a database ionitialized with schemas
|
||||||
and test-data from a previous version.
|
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>
|
<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
|
<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;
|
-- Explicit pre-initialization because we cannot use \`pg_dump --create ...\`
|
||||||
CREATE ROLE restricted;
|
-- because the database is already created by Testcontainers.
|
||||||
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO restricted;
|
--
|
||||||
|
|
||||||
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>
|
</code></pre>
|
||||||
|
|
||||||
<li>add the dump to that reference-schema SQL-file:</p>
|
<li>add the dump to that reference-schema SQL-file:</p>
|
||||||
|
17155
src/test/resources/db/prod-only-office-schema-with-test-data.sql
Normal file
17155
src/test/resources/db/prod-only-office-schema-with-test-data.sql
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user