Search in sources :

Example 6 with SybaseASADatabase

use of liquibase.database.core.SybaseASADatabase in project liquibase by liquibase.

the class CreateTableGeneratorTest method testAutoIncrementSybaseASADatabase.

@Test
public void testAutoIncrementSybaseASADatabase() throws Exception {
    for (Database database : TestContext.getInstance().getAllDatabases()) {
        if (database instanceof SybaseASADatabase) {
            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 DEFAULT AUTOINCREMENT NULL)", generatedSql[0].toSql());
        }
    }
}
Also used : SybaseASADatabase(liquibase.database.core.SybaseASADatabase) AutoIncrementConstraint(liquibase.statement.AutoIncrementConstraint) CreateTableStatement(liquibase.statement.core.CreateTableStatement) SQLiteDatabase(liquibase.database.core.SQLiteDatabase) DerbyDatabase(liquibase.database.core.DerbyDatabase) DB2Database(liquibase.database.core.DB2Database) H2Database(liquibase.database.core.H2Database) MSSQLDatabase(liquibase.database.core.MSSQLDatabase) MySQLDatabase(liquibase.database.core.MySQLDatabase) PostgresDatabase(liquibase.database.core.PostgresDatabase) OracleDatabase(liquibase.database.core.OracleDatabase) SybaseDatabase(liquibase.database.core.SybaseDatabase) SybaseASADatabase(liquibase.database.core.SybaseASADatabase) Database(liquibase.database.Database) HsqlDatabase(liquibase.database.core.HsqlDatabase) Sql(liquibase.sql.Sql) AbstractSqlGeneratorTest(liquibase.sqlgenerator.AbstractSqlGeneratorTest) Test(org.junit.Test)

Aggregations

SybaseASADatabase (liquibase.database.core.SybaseASADatabase)6 MSSQLDatabase (liquibase.database.core.MSSQLDatabase)5 SybaseDatabase (liquibase.database.core.SybaseDatabase)5 DB2Database (liquibase.database.core.DB2Database)4 OracleDatabase (liquibase.database.core.OracleDatabase)4 Sql (liquibase.sql.Sql)4 AutoIncrementConstraint (liquibase.statement.AutoIncrementConstraint)4 Database (liquibase.database.Database)3 DerbyDatabase (liquibase.database.core.DerbyDatabase)3 H2Database (liquibase.database.core.H2Database)3 HsqlDatabase (liquibase.database.core.HsqlDatabase)3 MySQLDatabase (liquibase.database.core.MySQLDatabase)3 PostgresDatabase (liquibase.database.core.PostgresDatabase)3 SQLiteDatabase (liquibase.database.core.SQLiteDatabase)3 AbstractSqlGeneratorTest (liquibase.sqlgenerator.AbstractSqlGeneratorTest)3 CreateTableStatement (liquibase.statement.core.CreateTableStatement)3 Test (org.junit.Test)3 IOException (java.io.IOException)1 AddColumnConfig (liquibase.change.AddColumnConfig)1 InformixDatabase (liquibase.database.core.InformixDatabase)1