@@ -0,0 +1,1469 @@
+package org.ensembl.healthcheck.testcase.funcgen;%0A%0Aimport java.sql.Connection;%0Aimport java.sql.ResultSet;%0Aimport java.sql.SQLException;%0Aimport java.sql.Statement;%0A%0Aimport org.ensembl.healthcheck.DatabaseRegistryEntry;%0Aimport org.ensembl.healthcheck.ReportManager;%0Aimport org.ensembl.healthcheck.testcase.SingleDatabaseTestCase;%0A%0Apublic class CurrentSchemaBuildUnique extends SingleDatabaseTestCase %7B%0A%0A%09protected Connection con;%0A%09%0A%09@Override%0A%09public boolean run(DatabaseRegistryEntry dbre) %7B%0A%09%09%0A%09%09boolean passes = true;%0A%09%09%0A%09%09con = dbre.getConnection();%0A%09%09int countCurrentCoordSystems;%0A%09%09try %7B%0A%09%09%09Statement stmt = con.createStatement();%0A%09%09%09ResultSet rs = stmt.executeQuery(%22select group_concat(distinct schema_build) current_schema_build, count(distinct schema_build) as c from coord_system where is_current=true%22);%0A%09%09%09rs.next();%0A%09%09%09countCurrentCoordSystems = rs.getInt(%22c%22);%0A%09%09%09if (countCurrentCoordSystems%3E1) %7B%0A%09%09%09%09%0A%09%09%09%09String current_schema_build = rs.getString(%22current_schema_build%22);%0A%09%09%09%09%0A%09%09%09%09ReportManager.problem(this, con, %22There is more than one schema_build flagged as current.%22);%0A%09%09%09%09ReportManager.problem(this, con, %22The following schema builds are marked as current: %22 + current_schema_build);%0A%09%09%09%7D%0A%09%09%7D catch (SQLException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%09return false;%0A%09%09%7D%0A%09%09passes = countCurrentCoordSystems==1;%0A%09%09if (!passes) %7B%0A%09%09%09ReportManager.problem(this, con, %22Useful SQL: select * from coord_system where is_current=true%22);%0A%09%09%7D%0A%09%09return passes;%0A%09%7D%0A%7D%0A

Check that only one schema build type has been set to current in the coord_system table.