# Generate Change Log in case sensitive database fails.

**URL:** <https://forum.liquibase.org/t/generate-change-log-in-case-sensitive-database-fails/1048>\
**Category:** General Discussion\
**Created:** [January 4, 2011, 4:46pm UTC](https://forum.liquibase.org/t/generate-change-log-in-case-sensitive-database-fails/1048 "2011-01-04T16:46:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikec62](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@mikec62](https://forum.liquibase.org/u/mikec62)\
**Post date:** [January 4, 2011, 4:46pm UTC](https://forum.liquibase.org/t/generate-change-log-in-case-sensitive-database-fails/1048/1 "2011-01-04T16:46:00Z")

</div>

I tried generating a change log using many different versions of Liquibase and keep getting an error with “invalid column name”. I eventually downloaded the source and debugged the code and found the problem occurs when there are two different tables with the same name, but a difference in case. Problem is in class liquibase.database.Database.DatabaseSnapshot, Method getTable :

&nbsp; &nbsp; public Table getTable(String tableName) {  
&nbsp; &nbsp; &nbsp; &nbsp; for (Table table : getTables()) {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (table.getName().equalsIgnoreCase(tableName)) {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return table;  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }  
&nbsp; &nbsp; &nbsp; &nbsp; }  
&nbsp; &nbsp; &nbsp; &nbsp; return null;  
&nbsp; &nbsp; }

changed “equalsIgnoreCase” to “equals” and appears to work. Unsure if there are problems elsewhere in the code

---

<div class="post-metadata">

**Author:** ![sven\_lb](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@sven\_lb](https://forum.liquibase.org/u/sven_lb)\
**Post date:** [January 4, 2011, 4:46pm UTC](https://forum.liquibase.org/t/generate-change-log-in-case-sensitive-database-fails/1048/2 "2011-01-04T16:46:00Z")

</div>

Yes, I noticed this also and raised an issue: [http://liquibase.jira.com/browse/CORE-813](http://liquibase.jira.com/browse/CORE-813)

But I am not sure how this could easily be fixed. I think the problem is that SQL identifiers are case sensitive on some database and not case sensitive on others. I guess Liquibase tries to normalize them to uppercase names (and additionally escapes them if they are contained in a database specific list). I have no clue what would happen if all equalsIgnoreCase() would be replaced by equals() and all toUpperCase() would be removed. Likely this would break existing scenarios - especially if different databases are involved.

BTW that is still a question to me: Is Liquibase meant to support a workflow where you generate changesets in a development environment and apply changes to a testing / production environment with another database flavour?

Sven

---

<div class="post-metadata">

**Author:** ![dvberkel](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dvberkel](https://forum.liquibase.org/u/dvberkel)\
**Post date:** [January 4, 2011, 4:46pm UTC](https://forum.liquibase.org/t/generate-change-log-in-case-sensitive-database-fails/1048/3 "2011-01-04T16:46:00Z")

</div>

@sven With respect to your question concerning workflow with different database flavours: I am under the impression that liquibase is meant to support this workflow.

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [January 4, 2011, 4:46pm UTC](https://forum.liquibase.org/t/generate-change-log-in-case-sensitive-database-fails/1048/4 "2011-01-04T16:46:00Z")

</div>

It should work.&nbsp; I submitted some fixes for the 2.0.1 release that should solve it for you.&nbsp; I’m hoping to release 2.0.1 next week

Nathan

---

<div class="post-metadata">

**Author:** ![sven\_lb](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@sven\_lb](https://forum.liquibase.org/u/sven_lb)\
**Post date:** [January 4, 2011, 4:46pm UTC](https://forum.liquibase.org/t/generate-change-log-in-case-sensitive-database-fails/1048/5 "2011-01-04T16:46:00Z")

</div>

Thanks for replying. I don’t know if the issue of the OP is solved, but I would like to let you know that CORE-813 is not solved by these fixes.  
But I do not want to hijack this thread, therefore I posted some comments there:  
[http://liquibase.jira.com/browse/CORE-813](http://liquibase.jira.com/browse/CORE-813)

Best regards,

Sven

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [January 4, 2011, 4:46pm UTC](https://forum.liquibase.org/t/generate-change-log-in-case-sensitive-database-fails/1048/6 "2011-01-04T16:46:00Z")

</div>

I’ll take a look at your issue.&nbsp; Thanks for the info.

Nathan
