liquibase.datatype.DatabaseDataType Java Examples

The following examples show how to use liquibase.datatype.DatabaseDataType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MetastoreDateType.java    From liquibase-impala with Apache License 2.0 5 votes vote down vote up
@Override
public DatabaseDataType toDatabaseDataType(Database database) {
    if (database instanceof HiveMetastoreDatabase) {
        return new DatabaseDataType("TIMESTAMP", getParameters());
    }

    return super.toDatabaseDataType(database);
}
 
Example #2
Source File: MetastoreVarcharType.java    From liquibase-impala with Apache License 2.0 5 votes vote down vote up
@Override
public DatabaseDataType toDatabaseDataType(Database database) {
    if (database instanceof HiveMetastoreDatabase) {
        return new DatabaseDataType("STRING", getParameters());
    }

    return super.toDatabaseDataType(database);
}
 
Example #3
Source File: MetastoreBigIntType.java    From liquibase-impala with Apache License 2.0 5 votes vote down vote up
@Override
public DatabaseDataType toDatabaseDataType(Database database) {
    if (database instanceof HiveMetastoreDatabase) {
        return new DatabaseDataType("BIGINT");
    }

    return super.toDatabaseDataType(database);
}
 
Example #4
Source File: MetastoreDateTimeType.java    From liquibase-impala with Apache License 2.0 5 votes vote down vote up
@Override
public DatabaseDataType toDatabaseDataType(Database database) {
    if (database instanceof HiveMetastoreDatabase) {
        return new DatabaseDataType("TIMESTAMP", getParameters());
    }

    return super.toDatabaseDataType(database);
}
 
Example #5
Source File: MetastoreCharType.java    From liquibase-impala with Apache License 2.0 5 votes vote down vote up
@Override
public DatabaseDataType toDatabaseDataType(Database database) {
    if (database instanceof HiveMetastoreDatabase) {
        return new DatabaseDataType("STRING", getParameters());
    }

    return super.toDatabaseDataType(database);
}
 
Example #6
Source File: MetastoreTextType.java    From liquibase-impala with Apache License 2.0 5 votes vote down vote up
@Override
public DatabaseDataType toDatabaseDataType(Database database) {
    if (database instanceof HiveMetastoreDatabase) {
        return new DatabaseDataType("STRING", getParameters());
    }

    return super.toDatabaseDataType(database);
}
 
Example #7
Source File: MetastoreTimeType.java    From liquibase-impala with Apache License 2.0 5 votes vote down vote up
@Override
public DatabaseDataType toDatabaseDataType(Database database) {
    if (database instanceof HiveMetastoreDatabase) {
        return new DatabaseDataType("TIMESTAMP", getParameters());
    }

    return super.toDatabaseDataType(database);
}
 
Example #8
Source File: MetastoreNumberType.java    From liquibase-impala with Apache License 2.0 5 votes vote down vote up
@Override
public DatabaseDataType toDatabaseDataType(Database database) {
    if (database instanceof HiveMetastoreDatabase) {
        return new DatabaseDataType("DOUBLE", getParameters());
    }

    return super.toDatabaseDataType(database);
}
 
Example #9
Source File: MetastoreBinaryType.java    From liquibase-impala with Apache License 2.0 5 votes vote down vote up
@Override
public DatabaseDataType toDatabaseDataType(Database database) {
    if (database instanceof HiveMetastoreDatabase) {
        return new DatabaseDataType("BINARY");
    }

    return super.toDatabaseDataType(database);
}
 
Example #10
Source File: MySQL8VarcharType.java    From keycloak with Apache License 2.0 5 votes vote down vote up
@Override
public DatabaseDataType toDatabaseDataType(Database database) {
    if (database instanceof MySQLDatabase) {
        try {
            if (database.getDatabaseMajorVersion() >= 8 && getSize() > 255) {
                return new DatabaseDataType(database.escapeDataTypeName("TEXT"), getSize());
            }
        } catch (DatabaseException e) {
            throw new RuntimeException(e);
        }
    }
    return super.toDatabaseDataType(database);
}
 
Example #11
Source File: MetastoreAddColumnGenerator.java    From liquibase-impala with Apache License 2.0 4 votes vote down vote up
@Override
protected String generateSingleColumnSQL(AddColumnStatement statement, Database database) {
    DatabaseDataType databaseColumnType = DataTypeFactory.getInstance().fromDescription(statement.getColumnType(), database).toDatabaseDataType(database);
    return " ADD COLUMNS (" + database.escapeColumnName(statement.getCatalogName(), statement.getSchemaName(), statement.getTableName(), statement.getColumnName()) + " " + databaseColumnType + ")";
}
 
Example #12
Source File: ImpalaAddColumnGenerator.java    From liquibase-impala with Apache License 2.0 4 votes vote down vote up
@Override
protected String generateSingleColumnSQL(AddColumnStatement statement, Database database) {
    DatabaseDataType databaseColumnType = DataTypeFactory.getInstance().fromDescription(statement.getColumnType(), database).toDatabaseDataType(database);
    return " ADD COLUMNS (" + database.escapeColumnName(statement.getCatalogName(), statement.getSchemaName(), statement.getTableName(), statement.getColumnName()) + " " + databaseColumnType + ")";
}