Skip to content

Commit

Permalink
Update changelogs to be identical to XML
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliimak committed Aug 29, 2024
1 parent e7a3926 commit 7ab307e
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
"clusterColumns": "test_id,test_new"
}
}
],
"rollback": [
{
"dropTable": {
"tableName": "test_table_clustered_new"
}
}
]
}
},
Expand All @@ -45,6 +52,12 @@
]
}
}
],
"rollback": [
{
"empty": {
}
}
]
}
},
Expand All @@ -59,6 +72,12 @@
"tableName": "test_table_clustered_new"
}
}
],
"rollback": [
{
"empty": {
}
}
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,24 @@

<changeSet id="1" author="as">
<createTable tableName="test_table_clustered_new" >
<column name="test_id" type="int" >
<constraints primaryKey="true" nullable="false" />
</column>
<column name="test_new" type="int">
</column>
<databricks:clusterColumns>test_id</databricks:clusterColumns>
<column name="test_id" type="int" />
<column name="test_new" type="int"/>
<databricks:clusterColumns>test_id,test_new</databricks:clusterColumns>
</createTable>
<rollback>
<!-- The dropTable will drop a full table whether it has clustered columns or not. -->
<dropTable tableName="test_table_clustered_new"/>
</rollback>
</changeSet>
<changeSet id="2" author="your.name">
<databricks:alterCluster tableName="test_table_clustered_new">
<databricks:column name="test_id"/>
</databricks:alterCluster>
<rollback/>
</changeSet>
<changeSet id="3" author="your.name">
<!-- The Databricks does not allow clustered columns to be dropped, so they should be unclustered before the dropColumn in the alterCluster. -->
<dropColumn tableName="test_table_clustered_new" columnName="test_new"/>
<rollback/>
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,26 @@ databaseChangeLog:
name: test_new
type: int
clusterColumns: test_id, test_new
rollback:
dropTable:
tableName: test_table_clustered_new
- changeSet:
id: 2
author: your.name
changes:
- alterCluster:
tableName: test_table_clustered_new
columns:
- column:
name: test_id
rollback:
empty
- changeSet:
id: 3
author: your.name
changes:
- dropColumn:
columnName: test_new
tableName: test_table_clustered_new
rollback:
empty
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
CREATE TABLE main.liquibase_harness_test_ds.test_table_clustered_new (test_id INT NOT NULL, test_new INT, CONSTRAINT PK_TEST_TABLE_CLUSTERED_NEW PRIMARY KEY (test_id)) USING delta TBLPROPERTIES('delta.feature.allowColumnDefaults' = 'supported', 'delta.columnMapping.mode' = 'name', 'delta.enableDeletionVectors' = true) CLUSTER BY (test_id)
CREATE TABLE main.liquibase_harness_test_ds.test_table_clustered_new (test_id INT, test_new INT) USING delta TBLPROPERTIES('delta.feature.allowColumnDefaults' = 'supported', 'delta.columnMapping.mode' = 'name', 'delta.enableDeletionVectors' = true) CLUSTER BY (test_id, test_new)
ALTER TABLE main.liquibase_harness_test_ds.test_table_clustered_new CLUSTER BY (test_id)
ALTER TABLE main.liquibase_harness_test_ds.test_table_clustered_new DROP COLUMN test_new

0 comments on commit 7ab307e

Please sign in to comment.