Package liquibase.statement.core

Examples of liquibase.statement.core.CreateTableStatement.addColumn()


            if (constraints != null && constraints.isPrimaryKey() != null && constraints.isPrimaryKey()) {

                statement.addPrimaryKeyColumn(column.getName(), columnType, defaultValue, constraints.getPrimaryKeyName(), constraints.getPrimaryKeyTablespace());

            } else {
                statement.addColumn(column.getName(),
                        columnType,
                        defaultValue,
                        column.getRemarks());
            }
View Full Code Here


    }

    @Override
    protected CreateTableStatement createSampleSqlStatement() {
        CreateTableStatement statement = new CreateTableStatement(CATALOG_NAME, SCHEMA_NAME, TABLE_NAME);
        statement.addColumn(COLUMN_NAME1, new IntType());
        return statement;
    }

    @Test
    public void testWithColumnWithDefaultValue() {
View Full Code Here

    @Test
    public void testWithColumnWithDefaultValue() {
        for (Database database : TestContext.getInstance().getAllDatabases()) {
            if (database instanceof OracleDatabase) {
                CreateTableStatement statement = new CreateTableStatement(CATALOG_NAME, SCHEMA_NAME, TABLE_NAME);
                statement.addColumn(COLUMN_NAME1, DataTypeFactory.getInstance().fromDescription("java.sql.Types.TIMESTAMP", database), new ColumnConfig().setDefaultValue("null").getDefaultValueObject());
                if (shouldBeImplementation(database)) {
                    assertEquals("CREATE TABLE CATALOG_NAME.TABLE_NAME (COLUMN1_NAME TIMESTAMP DEFAULT null)", this.generatorUnderTest.generateSql(statement, database, null)[0].toSql());
                }
            }
        }
View Full Code Here

    @Test
    public void testWithColumnSpecificIntType() {
        for (Database database : TestContext.getInstance().getAllDatabases()) {
                CreateTableStatement statement = new CreateTableStatement(CATALOG_NAME, SCHEMA_NAME, TABLE_NAME);
                statement.addColumn(COLUMN_NAME1, DataTypeFactory.getInstance().fromDescription("int(11) unsigned", database));
        }
    }

    //    @Test
//    public void createTable_standard() throws Exception {
View Full Code Here

    @Test
    public void testAutoIncrementDB2Database() throws Exception {
      for (Database database : TestContext.getInstance().getAllDatabases()) {
        if (database instanceof DB2Database) {
          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)
          );
View Full Code Here

    @Test
    public void testAutoIncrementStartWithDB2Database() throws Exception {
      for (Database database : TestContext.getInstance().getAllDatabases()) {
        if (database instanceof DB2Database) {
          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)
          );
View Full Code Here

    @Test
    public void testAutoIncrementStartWithIncrementByDB2Database() throws Exception {
      for (Database database : TestContext.getInstance().getAllDatabases()) {
        if (database instanceof DB2Database) {
          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)
          );
View Full Code Here

    @Test
    public void testAutoIncrementDerbyDatabase() throws Exception {
      for (Database database : TestContext.getInstance().getAllDatabases()) {
        if (database instanceof DerbyDatabase) {
          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)
          );
View Full Code Here

    @Test
    public void testAutoIncrementStartWithDerbyDatabase() throws Exception {
      for (Database database : TestContext.getInstance().getAllDatabases()) {
        if (database instanceof DerbyDatabase) {
          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)
          );
View Full Code Here

    @Test
    public void testAutoIncrementStartWithIncrementByDerbyDatabase() throws Exception {
      for (Database database : TestContext.getInstance().getAllDatabases()) {
        if (database instanceof DerbyDatabase) {
          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)
          );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.