Package liquibase.statement.core

Examples of liquibase.statement.core.SetNullableStatement


    public SqlStatement[] generateStatements(Database database) {
        if (database instanceof PostgresDatabase) {
            String sequenceName = (getTableName() + "_" + getColumnName() + "_seq").toLowerCase();
            return new SqlStatement[]{
                    new CreateSequenceStatement(catalogName, schemaName, sequenceName),
                    new SetNullableStatement(catalogName, schemaName, getTableName(), getColumnName(), null, false),
                    new AddDefaultValueStatement(catalogName, schemaName, getTableName(), getColumnName(), getColumnDataType(), new SequenceNextValueFunction(sequenceName)),
            };
        }

        return new SqlStatement[]{new AddAutoIncrementStatement(getCatalogName(), getSchemaName(), getTableName(), getColumnName(), getColumnDataType(), getStartWith(), getIncrementBy())};
View Full Code Here


//todo      if (database instanceof SQLiteDatabase) {
//        // return special statements for SQLite databases
//        return generateStatementsForSQLiteDatabase(database);
//      }

      return new SqlStatement[] { new SetNullableStatement(
                getCatalogName(),
          getSchemaName(),
          getTableName(), getColumnName(), getColumnDataType(), true)
      };
    }
View Full Code Here

            statements.add(new UpdateStatement(getCatalogName(), getSchemaName(), getTableName())
                    .addNewColumnValue(getColumnName(), defaultNullValue)
                    .setWhereClause(database.escapeObjectName(getColumnName(), Column.class) + " IS NULL"));
        }
       
      statements.add(new SetNullableStatement(getCatalogName(), getSchemaName(), getTableName(), getColumnName(), getColumnDataType(), false));
        if (database instanceof DB2Database) {
            statements.add(new ReorganizeTableStatement(getCatalogName(), getSchemaName(), getTableName()));
        }          
       
        return statements.toArray(new SqlStatement[statements.size()]);
View Full Code Here

TOP

Related Classes of liquibase.statement.core.SetNullableStatement

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.