Package liquibase.statement

Examples of liquibase.statement.AutoIncrementConstraint


        if (database instanceof MSSQLDatabase) {
          CreateTableStatement statement = new CreateTableStatement(CATALOG_NAME, SCHEMA_NAME, TABLE_NAME);
          statement.addColumn(
            COLUMN_NAME1,
            DataTypeFactory.getInstance().fromDescription("BIGINT{autoIncrement:true}", database),
            new AutoIncrementConstraint(COLUMN_NAME1, BigInteger.ZERO, BigInteger.TEN)
          );

          Sql[] generatedSql = this.generatorUnderTest.generateSql(statement, database, null);

        assertEquals("CREATE TABLE [SCHEMA_NAME].[TABLE_NAME] ([COLUMN1_NAME] BIGINT IDENTITY (0, 10))", generatedSql[0].toSql());
View Full Code Here


        if (database instanceof MySQLDatabase) {
          CreateTableStatement statement = new CreateTableStatement(CATALOG_NAME, SCHEMA_NAME, TABLE_NAME);
          statement.addColumn(
            COLUMN_NAME1,
            DataTypeFactory.getInstance().fromDescription("BIGINT{autoIncrement:true}", database),
            new AutoIncrementConstraint(COLUMN_NAME1)
          );

          Sql[] generatedSql = this.generatorUnderTest.generateSql(statement, database, null);

          assertEquals("CREATE TABLE CATALOG_NAME.TABLE_NAME (COLUMN1_NAME BIGINT AUTO_INCREMENT NULL)", generatedSql[0].toSql());
View Full Code Here

        if (database instanceof MySQLDatabase) {
          CreateTableStatement statement = new CreateTableStatement(CATALOG_NAME, SCHEMA_NAME, TABLE_NAME);
          statement.addColumn(
            COLUMN_NAME1,
            DataTypeFactory.getInstance().fromDescription("BIGINT{autoIncrement:true}", database),
            new AutoIncrementConstraint(COLUMN_NAME1, BigInteger.valueOf(2), null)
          );

          Sql[] generatedSql = this.generatorUnderTest.generateSql(statement, database, null);

          assertEquals("CREATE TABLE CATALOG_NAME.TABLE_NAME (COLUMN1_NAME BIGINT AUTO_INCREMENT NULL) AUTO_INCREMENT=2", generatedSql[0].toSql());
View Full Code Here

        if (database instanceof MySQLDatabase) {
          CreateTableStatement statement = new CreateTableStatement(CATALOG_NAME, SCHEMA_NAME, TABLE_NAME);
          statement.addColumn(
            COLUMN_NAME1,
            DataTypeFactory.getInstance().fromDescription("BIGINT{autoIncrement:true}", database),
            new AutoIncrementConstraint(COLUMN_NAME1, BigInteger.valueOf(2), BigInteger.TEN)
          );

          Sql[] generatedSql = this.generatorUnderTest.generateSql(statement, database, null);

          // increment by not supported by MySQL
View Full Code Here

        if (database instanceof PostgresDatabase) {
          CreateTableStatement statement = new CreateTableStatement(CATALOG_NAME, SCHEMA_NAME, TABLE_NAME);
          statement.addColumn(
            COLUMN_NAME1,
            DataTypeFactory.getInstance().fromDescription("BIGINT{autoIncrement:true}", database),
            new AutoIncrementConstraint(COLUMN_NAME1)
          );

          Sql[] generatedSql = this.generatorUnderTest.generateSql(statement, database, null);

          assertEquals("CREATE TABLE SCHEMA_NAME.TABLE_NAME (COLUMN1_NAME BIGSERIAL)", generatedSql[0].toSql());
View Full Code Here

        if (database instanceof PostgresDatabase) {
          CreateTableStatement statement = new CreateTableStatement(CATALOG_NAME, SCHEMA_NAME, TABLE_NAME);
          statement.addColumn(
            COLUMN_NAME1,
            DataTypeFactory.getInstance().fromDescription("BIGINT{autoIncrement:true}", database),
            new AutoIncrementConstraint(COLUMN_NAME1, BigInteger.ZERO, null)
          );

          Sql[] generatedSql = this.generatorUnderTest.generateSql(statement, database, null);

          // start with supported over generated sequence
View Full Code Here

        if (database instanceof PostgresDatabase) {
          CreateTableStatement statement = new CreateTableStatement(CATALOG_NAME, SCHEMA_NAME, TABLE_NAME);
          statement.addColumn(
            COLUMN_NAME1,
            DataTypeFactory.getInstance().fromDescription("BIGINT{autoIncrement:true}", database),
            new AutoIncrementConstraint(COLUMN_NAME1, BigInteger.ZERO, BigInteger.TEN)
          );

          Sql[] generatedSql = this.generatorUnderTest.generateSql(statement, database, null);

          // start with and increment by supported over generated sequence
View Full Code Here

        if (database instanceof SQLiteDatabase) {
          CreateTableStatement statement = new CreateTableStatement(CATALOG_NAME, SCHEMA_NAME, TABLE_NAME);
          statement.addColumn(
            COLUMN_NAME1,
            DataTypeFactory.getInstance().fromDescription("BIGINT{autoIncrement:true}", database),
            new AutoIncrementConstraint(COLUMN_NAME1)
          );

          Sql[] generatedSql = this.generatorUnderTest.generateSql(statement, database, null);

          assertEquals("CREATE TABLE SCHEMA_NAME.TABLE_NAME (COLUMN1_NAME BIGINT AUTOINCREMENT)", generatedSql[0].toSql());
View Full Code Here

        if (database instanceof SQLiteDatabase) {
          CreateTableStatement statement = new CreateTableStatement(CATALOG_NAME, SCHEMA_NAME, TABLE_NAME);
          statement.addColumn(
            COLUMN_NAME1,
            DataTypeFactory.getInstance().fromDescription("BIGINT{autoIncrement:true}", database),
            new AutoIncrementConstraint(COLUMN_NAME1, BigInteger.valueOf(2), null)
          );

          Sql[] generatedSql = this.generatorUnderTest.generateSql(statement, database, null);

          // start with not supported by SQLlite
View Full Code Here

        if (database instanceof SQLiteDatabase) {
          CreateTableStatement statement = new CreateTableStatement(CATALOG_NAME, SCHEMA_NAME, TABLE_NAME);
          statement.addColumn(
            COLUMN_NAME1,
            DataTypeFactory.getInstance().fromDescription("BIGINT{autoIncrement:true}", database),
            new AutoIncrementConstraint(COLUMN_NAME1, BigInteger.valueOf(2), BigInteger.TEN)
          );

          Sql[] generatedSql = this.generatorUnderTest.generateSql(statement, database, null);

          // start with and increment by not supported by SQLite
View Full Code Here

TOP

Related Classes of liquibase.statement.AutoIncrementConstraint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.