Skip to content

Commit

Permalink
resolved priorities for Datatypes and ModifyDatatype generator
Browse files Browse the repository at this point in the history
  • Loading branch information
KushnirykOleh authored and vitaliimak committed May 30, 2024
1 parent db96d6f commit 7948b0a
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
name = "bignumeric",
minParameters = 0,
maxParameters = 0,
priority = 1
priority = LiquibaseDataType.PRIORITY_DATABASE
)
public class BignumericDataTypeBigQuery extends LiquibaseDataType {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
name = "boolean",
minParameters = 0,
maxParameters = 0,
priority = BIGQUERY_PRIORITY_DATABASE
priority = LiquibaseDataType.PRIORITY_DATABASE
)
public class BoolDataTypeBigQuery extends LiquibaseDataType {
public BoolDataTypeBigQuery() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
name = "float64",
minParameters = 0,
maxParameters = 0,
priority = BIGQUERY_PRIORITY_DATABASE
priority = LiquibaseDataType.PRIORITY_DATABASE
)
public class Float64DataTypeBigQuery extends LiquibaseDataType {
public Float64DataTypeBigQuery() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
name = "geography",
minParameters = 0,
maxParameters = 0,
priority = BIGQUERY_PRIORITY_DATABASE
priority = LiquibaseDataType.PRIORITY_DATABASE
)
public class GeographyDataTypeBigQuery extends LiquibaseDataType {
public GeographyDataTypeBigQuery() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
name = "int64",
minParameters = 0,
maxParameters = 0,
priority = 1
priority = LiquibaseDataType.PRIORITY_DATABASE
)
public class Int64DataTypeBigQuery extends LiquibaseDataType {
public Int64DataTypeBigQuery() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
name = "numeric",
minParameters = 0,
maxParameters = 0,
priority = 1
priority = LiquibaseDataType.PRIORITY_DATABASE
)
public class NumberDataTypeBigQuery extends LiquibaseDataType {
public NumberDataTypeBigQuery() {
public class NumericDataTypeBigQuery extends LiquibaseDataType {
public NumericDataTypeBigQuery() {
}

public boolean supports(Database database) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
import liquibase.datatype.core.VarcharType;
import liquibase.ext.bigquery.database.BigqueryDatabase;

import static liquibase.ext.bigquery.database.BigqueryDatabase.BIGQUERY_PRIORITY_DATABASE;
import liquibase.datatype.LiquibaseDataType;


@DataTypeInfo(
name = "string",
minParameters = 0,
maxParameters = 0,
priority = BIGQUERY_PRIORITY_DATABASE,
priority = LiquibaseDataType.PRIORITY_DATABASE,
aliases = { "varchar", "clob", "java.lang.String" }
)
public class StringDataTypeBigQuery extends VarcharType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import liquibase.ext.bigquery.database.BigqueryDatabase;
import liquibase.sql.Sql;
import liquibase.sql.UnparsedSql;
import liquibase.sqlgenerator.SqlGenerator;
import liquibase.sqlgenerator.SqlGeneratorChain;
import liquibase.sqlgenerator.core.ModifyDataTypeGenerator;
import liquibase.statement.core.ModifyDataTypeStatement;
Expand All @@ -16,6 +17,11 @@ public boolean supports(ModifyDataTypeStatement statement, Database database) {
return database instanceof BigqueryDatabase;
}

@Override
public int getPriority() {
return SqlGenerator.PRIORITY_DATABASE;
}

@Override
public Sql[] generateSql(ModifyDataTypeStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
String alterTable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ liquibase.ext.bigquery.datatype.core.GeographyDataTypeBigQuery
liquibase.ext.bigquery.datatype.core.Float64DataTypeBigQuery
liquibase.ext.bigquery.datatype.core.BoolDataTypeBigQuery
liquibase.ext.bigquery.datatype.core.Int64DataTypeBigQuery
liquibase.ext.bigquery.datatype.core.NumberDataTypeBigQuery
liquibase.ext.bigquery.datatype.core.NumericDataTypeBigQuery
liquibase.ext.bigquery.datatype.core.BignumericDataTypeBigQuery

0 comments on commit 7948b0a

Please sign in to comment.