class DBAccessorImpl implements DBAccessor {

  @Override
  public void moveColumnToAnotherTable(String sourceTableName, DBColumnInfo sourceColumn, String sourceIDFieldName,
              String targetTableName, DBColumnInfo targetColumn, String targetIDFieldName, Object initialValue) throws SQLException {

    if (tableHasColumn(sourceTableName, sourceIDFieldName) &&
      tableHasColumn(sourceTableName, sourceColumn.getName()) &&
      tableHasColumn(targetTableName, targetIDFieldName)
    ) {

      final String moveSQL = dbmsHelper.getCopyColumnToAnotherTableStatement(sourceTableName, sourceColumn.getName(),
        sourceIDFieldName, targetTableName, targetColumn.getName(),targetIDFieldName);
      final boolean isTargetColumnNullable = targetColumn.isNullable();

      targetColumn.setNullable(true);  // setting column nullable by default to move rows with null

      addColumn(targetTableName, targetColumn);
      executeUpdate(moveSQL, false);

      if (initialValue != null) {
        String updateSQL = dbmsHelper.getColumnUpdateStatementWhereColumnIsNull(convertObjectName(targetTableName),
          convertObjectName(targetColumn.getName()), convertObjectName(targetColumn.getName()));

        executePreparedUpdate(updateSQL, initialValue);
      }

      if (!isTargetColumnNullable) {
        setColumnNullable(targetTableName, targetColumn.getName(), false);
      }
      dropColumn(sourceTableName, sourceColumn.getName());
    }
  }

  @Inject public  DBAccessorImpl(Configuration configuration);

}