Note that there are some explanatory texts on larger screens.

plurals
  1. POContinuous Integration: keeping the test DB schema up-to-date
    primarykey
    data
    text
    <p>I'm setting up a continuous integration server (Hudson) to build a Java project and run the relevant unit/integration tests. Most of these tests access a database and the test data is kept in a DbUnit XML file.</p> <p>I'm looking for a way to automatically keep the test database schema up-to-date. Currently the SQL script for a particular release is stored in a directory named after the release version:</p> <pre><code>└───scripts ├───0.1.0 ├───0.1.1 ├───0.1.2 ├───0.1.4 </code></pre> <p>For example, the SQL script for version 0.1.4 is </p> <pre><code>scripts\0.1.4\script-0.1.4.sql </code></pre> <p>The problem is that these scripts contain a mixture of schema changes (e.g. ALTER TABLE...) and changes to the static tables (e.g. add a new role to the USER_TYPE table).</p> <p>In the case of the unit tests I only want to apply the schema changes, because as mentioned above, all the data for the unit tests is kept in a DbUnit XML file. Although I could separate these two types of database changes into different files, there will often be a dependency between the schema changes and the data changes that will need to be somehow enforced when the release is being applied to QA, production, etc.</p> <p>Anyway, this is just a very long-winded way of asking whether anyone has come up with a robust way to automatically keep their test schema up-to-date? I know <a href="http://www.unitils.org/summary.html" rel="nofollow noreferrer">Unitils</a> has some support for keeping a test schema up-to-date, but I'm not sure if it can 'ignore' data update statements in the SQL delta scripts.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload