generated from liquibase/liquibase-extension-example
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
92 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/java/liquibase/ext/databricks/change/createTable/ExtendedTableProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package liquibase.ext.databricks.change.createTable; | ||
|
||
import liquibase.serializer.AbstractLiquibaseSerializable; | ||
|
||
public class ExtendedTableProperties extends AbstractLiquibaseSerializable{ | ||
private String tableLocation; | ||
private String tblProperties; | ||
|
||
@Override | ||
public String getSerializedObjectName() { | ||
return "extendedTableProperties"; | ||
} | ||
|
||
@Override | ||
public String getSerializedObjectNamespace() { | ||
return "http://www.liquibase.org/xml/ns/databricks"; | ||
} | ||
|
||
public String getTableLocation() { | ||
return tableLocation; | ||
} | ||
|
||
public void setTableLocation(String tableLocation) { | ||
this.tableLocation = tableLocation; | ||
} | ||
|
||
public String getTblProperties() { | ||
return tblProperties; | ||
} | ||
|
||
public void setTblProperties(String tblProperties) { | ||
this.tblProperties = tblProperties; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/test/resources/liquibase/harness/change/changelogs/databricks/createTable.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<databaseChangeLog | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:databricks="http://www.liquibase.org/xml/ns/databricks" | ||
|
||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog | ||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd | ||
http://www.liquibase.org/xml/ns/databricks | ||
http://www.liquibase.org/xml/ns/databricks/liquibase-databricks-latest.xsd"> | ||
|
||
<changeSet id="1" author="oleh"> | ||
<createTable tableName="test_table"> | ||
<column name="test_id" type="int"> | ||
<constraints primaryKey="true" nullable="false"/> | ||
</column> | ||
<column name="test_column" type="varchar(50)"> | ||
<constraints nullable="false"/> | ||
</column> | ||
</createTable> | ||
</changeSet> | ||
|
||
<changeSet id="2" author="as"> | ||
<createTable tableName="test_table_properties"> | ||
<column name="test_id" type="int"> | ||
<constraints primaryKey="true" nullable="false"/> | ||
</column> | ||
<databricks:extendedTableProperties tblProperties="'external.location'='s3://mybucket/mytable','this.is.my.key'=12,'this.is.my.key2'=true"/> | ||
</createTable> | ||
</changeSet> | ||
</databaseChangeLog> |
3 changes: 2 additions & 1 deletion
3
src/test/resources/liquibase/harness/change/expectedSql/databricks/createTable.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
CREATE TABLE main.liquibase_harness_test_ds.test_table (test_id INT NOT NULL, test_column VARCHAR(50) NOT NULL, CONSTRAINT PK_TEST_TABLE PRIMARY KEY (test_id)) USING delta TBLPROPERTIES('delta.feature.allowColumnDefaults' = 'supported', 'delta.columnMapping.mode' = 'name', 'delta.enableDeletionVectors' = true) | ||
CREATE TABLE main.liquibase_harness_test_ds.test_table (test_id INT NOT NULL, test_column VARCHAR(50) NOT NULL, CONSTRAINT PK_TEST_TABLE PRIMARY KEY (test_id)) USING delta TBLPROPERTIES('delta.feature.allowColumnDefaults' = 'supported', 'delta.columnMapping.mode' = 'name', 'delta.enableDeletionVectors' = true) | ||
CREATE TABLE main.liquibase_harness_test_ds.test_table_properties (test_id INT NOT NULL, CONSTRAINT PK_TEST_TABLE_PROPERTIES PRIMARY KEY (test_id)) TBLPROPERTIES ('external.location'='s3://mybucket/mytable','this.is.my.key'=12,'this.is.my.key2'=true) |