County Table missing in the Database

Hello @Moses_Mutesasira , @mherman22 , @Agaba_Derrick_Junior
I’ve recently been looking into the issue: Add CountyService Integration Test, though the COUNTY table does not exist in the database, because its SQL command is not included in the OpenELIS-Global.sql file
Is this intentional, or not?, If it’s intentional, how are datasets supposed to be created?
Thanks!

1 Like

if this is intentional rather than an oversight we could have a work round strategy to go round when creating this test

we could add

@BeforeAll
public static void setupDatabase() {
    jdbcTemplate.execute("CREATE SEQUENCE IF NOT EXISTS county_seq");
    jdbcTemplate.execute("CREATE TABLE IF NOT EXISTS COUNTY (" +
        "ID VARCHAR(10) PRIMARY KEY, " +
        "LASTUPDATED TIMESTAMP, " +
        "REGION_ID VARCHAR(10), " +
        "COUNTY VARCHAR(75) NOT NULL)");
    
    jdbcTemplate.update("INSERT INTO COUNTY (ID, COUNTY) VALUES ('1', 'Test County')");
}

I have paraphrased this according to the county.hbm.xml data for the county service

2 Likes

Wow, thanks @Agaba_Derrick_Junior, this looks to be a viable workaround, though I think we should be sure first whether it was intentional to leave the table out

Thanks @Agaba_Derrick_Junior .
This is because some of the data models were deprecated when migrating from OpenELIS 1.x to 2.x

2 Likes