File tree Expand file tree Collapse file tree 6 files changed +141
-4
lines changed
java/liquibase/ext/databricks/datatype
resources/META-INF/services Expand file tree Collapse file tree 6 files changed +141
-4
lines changed Original file line number Diff line number Diff line change 5
5
6
6
<groupId >org.liquibase.ext</groupId >
7
7
<artifactId >liquibase-databricks</artifactId >
8
- <version >1.1.2 -SNAPSHOT</version >
8
+ <version >1.1.3 -SNAPSHOT</version >
9
9
10
10
<name >Liquibase Extension: Databricks support</name >
11
11
<description >Liquibase Extension for Databricks.</description >
Original file line number Diff line number Diff line change
1
+ package liquibase .ext .databricks .datatype ;
2
+
3
+ import liquibase .change .core .LoadDataChange ;
4
+ import liquibase .database .Database ;
5
+ import liquibase .datatype .DataTypeInfo ;
6
+ import liquibase .datatype .DatabaseDataType ;
7
+ import liquibase .datatype .LiquibaseDataType ;
8
+ import liquibase .ext .databricks .database .DatabricksDatabase ;
9
+ import liquibase .servicelocator .PrioritizedService ;
10
+
11
+ @ DataTypeInfo (
12
+ name = "boolean" ,
13
+ minParameters = 0 ,
14
+ maxParameters = 0 ,
15
+ priority = PrioritizedService .PRIORITY_DATABASE
16
+ )
17
+ public class BooleanDatatypeDatabricks extends LiquibaseDataType {
18
+
19
+ public BooleanDatatypeDatabricks () {
20
+ // empty constructor
21
+ }
22
+
23
+ @ Override
24
+ public boolean supports (Database database ) {
25
+ return database instanceof DatabricksDatabase ;
26
+ }
27
+
28
+ @ Override
29
+ public DatabaseDataType toDatabaseDataType (Database database ) {
30
+ if (database instanceof DatabricksDatabase ) {
31
+
32
+ DatabaseDataType type = new DatabaseDataType ("BOOLEAN" , this .getParameters ());
33
+ type .setType ("BOOLEAN" );
34
+ return type ;
35
+ } else {
36
+ return super .toDatabaseDataType (database );
37
+ }
38
+
39
+ }
40
+
41
+ public LoadDataChange .LOAD_DATA_TYPE getLoadTypeName () {
42
+ return LoadDataChange .LOAD_DATA_TYPE .BOOLEAN ;
43
+ }
44
+ }
Original file line number Diff line number Diff line change
1
+ package liquibase .ext .databricks .datatype ;
2
+
3
+ import liquibase .change .core .LoadDataChange ;
4
+ import liquibase .database .Database ;
5
+ import liquibase .datatype .DataTypeInfo ;
6
+ import liquibase .datatype .DatabaseDataType ;
7
+ import liquibase .datatype .LiquibaseDataType ;
8
+ import liquibase .ext .databricks .database .DatabricksDatabase ;
9
+ import liquibase .servicelocator .PrioritizedService ;
10
+
11
+ @ DataTypeInfo (
12
+ name = "double" ,
13
+ minParameters = 0 ,
14
+ maxParameters = 0 ,
15
+ priority = PrioritizedService .PRIORITY_DATABASE
16
+ )
17
+ public class DoubleDatatypeDatabricks extends LiquibaseDataType {
18
+
19
+ public DoubleDatatypeDatabricks () {
20
+ // empty constructor
21
+ }
22
+
23
+ @ Override
24
+ public boolean supports (Database database ) {
25
+ return database instanceof DatabricksDatabase ;
26
+ }
27
+
28
+ @ Override
29
+ public DatabaseDataType toDatabaseDataType (Database database ) {
30
+ if (database instanceof DatabricksDatabase ) {
31
+
32
+ DatabaseDataType type = new DatabaseDataType ("DOUBLE" , this .getParameters ());
33
+ type .setType ("DOUBLE" );
34
+ return type ;
35
+ } else {
36
+ return super .toDatabaseDataType (database );
37
+ }
38
+
39
+ }
40
+
41
+ public LoadDataChange .LOAD_DATA_TYPE getLoadTypeName () {
42
+ return LoadDataChange .LOAD_DATA_TYPE .NUMERIC ;
43
+ }
44
+ }
Original file line number Diff line number Diff line change
1
+ package liquibase .ext .databricks .datatype ;
2
+
3
+ import liquibase .change .core .LoadDataChange ;
4
+ import liquibase .database .Database ;
5
+ import liquibase .datatype .DataTypeInfo ;
6
+ import liquibase .datatype .DatabaseDataType ;
7
+ import liquibase .datatype .LiquibaseDataType ;
8
+ import liquibase .ext .databricks .database .DatabricksDatabase ;
9
+ import liquibase .servicelocator .PrioritizedService ;
10
+
11
+
12
+ @ DataTypeInfo (
13
+ name = "float" ,
14
+ minParameters = 0 ,
15
+ maxParameters = 0 ,
16
+ priority = PrioritizedService .PRIORITY_DATABASE
17
+ )
18
+ public class FloatDatatypeDatabricks extends LiquibaseDataType {
19
+ public FloatDatatypeDatabricks () {
20
+ // empty constructor
21
+ }
22
+
23
+ @ Override
24
+ public boolean supports (Database database ) {
25
+ return database instanceof DatabricksDatabase ;
26
+ }
27
+
28
+ @ Override
29
+ public DatabaseDataType toDatabaseDataType (Database database ) {
30
+ if (database instanceof DatabricksDatabase ) {
31
+
32
+ DatabaseDataType type = new DatabaseDataType ("FLOAT" , this .getParameters ());
33
+ type .setType ("FLOAT" );
34
+ return type ;
35
+ } else {
36
+ return super .toDatabaseDataType (database );
37
+ }
38
+
39
+ }
40
+
41
+ public LoadDataChange .LOAD_DATA_TYPE getLoadTypeName () {
42
+ return LoadDataChange .LOAD_DATA_TYPE .NUMERIC ;
43
+ }
44
+ }
Original file line number Diff line number Diff line change 6
6
import liquibase .datatype .DatabaseDataType ;
7
7
import liquibase .datatype .LiquibaseDataType ;
8
8
import liquibase .ext .databricks .database .DatabricksDatabase ;
9
-
10
- import static liquibase .ext .databricks .database .DatabricksDatabase .PRIORITY_DATABASE ;
9
+ import liquibase .servicelocator .PrioritizedService ;
11
10
12
11
13
12
@ DataTypeInfo (
14
13
name = "int" ,
15
14
minParameters = 0 ,
16
15
maxParameters = 0 ,
17
- priority = PRIORITY_DATABASE
16
+ priority = PrioritizedService . PRIORITY_DATABASE
18
17
)
19
18
public class IntegerDatatypeDatabricks extends LiquibaseDataType {
20
19
public IntegerDatatypeDatabricks () {
20
+ // empty constructor
21
21
}
22
22
23
+ @ Override
23
24
public boolean supports (Database database ) {
24
25
return database instanceof DatabricksDatabase ;
25
26
}
26
27
28
+ @ Override
27
29
public DatabaseDataType toDatabaseDataType (Database database ) {
28
30
if (database instanceof DatabricksDatabase ) {
29
31
Original file line number Diff line number Diff line change @@ -2,3 +2,6 @@ liquibase.ext.databricks.datatype.DatetimeDatatypeDatabricks
2
2
liquibase.ext.databricks.datatype.BigintDatatypeDatabricks
3
3
liquibase.ext.databricks.datatype.StringDatatypeDatabricks
4
4
liquibase.ext.databricks.datatype.IntegerDatatypeDatabricks
5
+ liquibase.ext.databricks.datatype.BooleanDatatypeDatabricks
6
+ liquibase.ext.databricks.datatype.FloatDatatypeDatabricks
7
+ liquibase.ext.databricks.datatype.DoubleDatatypeDatabricks
You can’t perform that action at this time.
0 commit comments