Ability to specify autoincrement start values

Hello,

I found a feature request on “Ability to specify autoincrement start values” in jira http://liquibase.jira.com/browse/CORE-40.

And it’s marked as fixed in 2.0.2 version. But I couldn’t find any documentation about it. How to use that new feature?

Thanks for the reply!

I spent some time looking at liquibase source code. Seems described feature is available not for all databases. Well, for my case I use HSQL for unit tests and postgreSQL for production. And I need to add startWith attribute to the ID column in some table.

Then for my changeset

  1. CREATE TABLE some_table (id serial NOT NULL, name TEXT NOT NULL, CONSTRAINT PK_SOME_TABLE PRIMARY KEY (id))

As you see, startWith attribute for postgreSQL is absent. That’s a pity.

Here’s the commit history in GitHub for that update.  You can see the code updates and maybe that will help.


Here’s a test case from the CreateTableGeneratorTest.java class, look at line 10 and maybe that will help!


  1. @Test
  2.     public void testAutoIncrementStartWithIncrementByMySQLDatabase() throws Exception {
  3.     }
  4.     }

Thanks for finding that. I created  http://liquibase.jira.com/browse/CORE-1103 to track it.


Nathan

I noticed a similar issue with MS SQL Server and created http://liquibase.jira.com/browse/CORE-1182.

By the way, is there a liquibase XSD schema that takes into account the column tag ? http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd does not.