# County Table missing in the Database

**URL:** <https://talk.openelis-global.org/t/county-table-missing-in-the-database/1585>\
**Category:** Development\
**Tags:** dev\
**Created:** [June 26, 2025, 2:01am UTC](https://talk.openelis-global.org/t/county-table-missing-in-the-database/1585 "2025-06-26T02:01:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ariho-Seth](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/ariho-seth/32/1278_2.png) [@Ariho-Seth](https://talk.openelis-global.org/u/Ariho-Seth)\
**Post date:** [June 26, 2025, 2:01am UTC](https://talk.openelis-global.org/t/county-table-missing-in-the-database/1585/1 "2025-06-26T02:01:11Z")

</div>

Hello @Moses_Mutesasira , @mherman22 , @Agaba_Derrick_Junior  
I’ve recently been looking into the issue: [Add CountyService Integration Test](https://github.com/DIGI-UW/OpenELIS-Global-2/issues/2023), though the `COUNTY` table does not exist in the database, because its SQL command is not included in the [OpenELIS-Global.sql](https://github.com/DIGI-UW/OpenELIS-Global-2/blob/develop/src/test/resources/postgre-db-init/OpenELIS-Global.sql#:~:text=OpenELIS%2D-,Global.sql) file  
Is this intentional, or not?, If it’s intentional, how are datasets supposed to be created?  
Thanks!

---

<div class="post-metadata">

**Author:** ![Agaba\_Derrick\_Junior](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/agaba_derrick_junior/32/503_2.png) [@Agaba\_Derrick\_Junior](https://talk.openelis-global.org/u/Agaba_Derrick_Junior)\
**Post date:** [June 26, 2025, 6:50am UTC](https://talk.openelis-global.org/t/county-table-missing-in-the-database/1585/2 "2025-06-26T06:50:36Z")

</div>

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

```auto
@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

---

<div class="post-metadata">

**Author:** ![Ariho-Seth](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/ariho-seth/32/1278_2.png) [@Ariho-Seth](https://talk.openelis-global.org/u/Ariho-Seth)\
**Post date:** [June 26, 2025, 9:03am UTC](https://talk.openelis-global.org/t/county-table-missing-in-the-database/1585/3 "2025-06-26T09:03:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Moses\_Mutesasira](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/moses_mutesasira/32/72_2.png) [@Moses\_Mutesasira](https://talk.openelis-global.org/u/Moses_Mutesasira)\
**Post date:** [July 17, 2025, 6:42am UTC](https://talk.openelis-global.org/t/county-table-missing-in-the-database/1585/4 "2025-07-17T06:42:49Z")

</div>

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