1.9.5 to 2.0-rc6 (Empty result set, expected one row)

There seems to be a change to the way the precondition’s functionality. During an attempted upgrade I was unable to figure out a workaround for an old use case of this check which was intended not only to ensure that there was no element with an ID of -1 but more so checking that there was nothing in the table.

Is there any new command for verifying if a table has any data at all? If not I don’t see how to reliably test whether or not to load data into an empty table where the table could already have the data or be newly created, in the case of a new database being generated.

       
  select category_description from element_category where category_id = -1

When i use the liquibase scripts to generate a fresh database for testing I get the following error:

Error setting up or running Liquibase: Migration failed for change set src/test/resources/liquibase/changelogs/2010-10-25-release/db.changelog-2010-04-07-imprint_category_integrity.xml::IMPRINT_CATEGORY_INTEGRITY_FIX_FOREIGN_KEY_DATA::Martin Dale Lyness:
    Reason:
          src/test/resources/liquibase/db.changelog-master.xml : Empty result set, expected one row
:
          Caused By: Precondition Error

That worked in 1.9?  I would not have expected it to.  The sqlCheck should have always assumed there would be a single row returned.  For “what rows are in the database” type queries, I’ve usually used something like select count(*) from element_category where category_id = -1 and category_description =‘Unknown’/sqlCheck>

which will always return a value even if there are now rows in the database.

Nathan