Some of my databases have an auto-increment on the id column of my log table, while others don’t. As I need this auto-increment on all of my databases, I created a changeSet like this:
- <addAutoIncrement columnDataType="int"
- columnName="id"
- incrementBy="1"
- startWith="1"
- tableName="log"/>
However, this fails when I run it on my databases that already have this auto-increment.
I’d like something like this:
- <autoIncrementExists columnName="id"
- tableName="log"/>
- <addAutoIncrement columnDataType="int"
- columnName="id"
- incrementBy="1"
- startWith="1"
- tableName="log"/>
Is this possible in any way?
PS: If you’re wondering why I ended up with this inconsistency on my databases, it’s because MySQL deletes the auto-increment when you change a column type, while PostgreSQL doesn’t.