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
95 additions
and
3 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
18 changes: 18 additions & 0 deletions
18
...rces/liquibase/harness/change/changelogs/databricks/createTableWithTwoIdentityColumns.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,18 @@ | ||
<?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 author="oleh" id="1"> | ||
<createTable tableName="createTableWithTwoIdentityColumns" > | ||
<column name="IdentityByDefault" type="long" autoIncrement="true" generationType="IDENTITY" startWith="10" incrementBy="5"/> | ||
<column name="IdentityAlways" type="long" defaultValueComputed="GENERATED ALWAYS AS IDENTITY (START WITH 11 INCREMENT BY 2)"/> | ||
</createTable> | ||
</changeSet> | ||
|
||
</databaseChangeLog> |
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
41 changes: 41 additions & 0 deletions
41
...quibase/harness/change/expectedSnapshot/databricks/createTableWithTwoIdentityColumns.json
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,41 @@ | ||
{ | ||
"snapshot": { | ||
"objects": { | ||
"liquibase.structure.core.Table": [ | ||
{ | ||
"table": { | ||
"name": "createTableWithTwoIdentityColumns" | ||
} | ||
} | ||
], | ||
"liquibase.structure.core.Column": [ | ||
{ | ||
"column": { | ||
"name": "IdentityByDefault", | ||
"type": { | ||
"typeName": "BIGINT" | ||
}, | ||
"autoIncrementInformation": { | ||
"generationType": "BY DEFAULT", | ||
"startWith": "10\\!\\{java.math.BigInteger\\}", | ||
"incrementBy": "5\\!\\{java.math.BigInteger\\}" | ||
} | ||
} | ||
}, | ||
{ | ||
"column": { | ||
"name": "IdentityAlways", | ||
"type": { | ||
"typeName": "BIGINT" | ||
}, | ||
"autoIncrementInformation": { | ||
"generationType": "ALWAYS", | ||
"startWith": "11\\!\\{java.math.BigInteger\\}", | ||
"incrementBy": "2\\!\\{java.math.BigInteger\\}" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...esources/liquibase/harness/change/expectedSql/databricks/createTableWithDefaultValues.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 @@ | ||
CREATE TABLE main.liquibase_harness_test_ds.tableWithDefaultValues (longcolumn LONG GENERATED BY DEFAULT AS IDENTITY (START WITH 1 INCREMENT BY 1), eventTime TIMESTAMP DEFAULT current_timestamp() NOT NULL, year INT DEFAULT YEAR(CURRENT_TIMESTAMP()), eventDate date DEFAULT CAST(CURRENT_TIMESTAMP() AS DATE), eventDescription STRING DEFAULT 'default string, regular ? almost();!$#@^%[] String bigint' NOT NULL, eventShortDescription STRING DEFAULT 'short desc') USING delta TBLPROPERTIES('delta.feature.allowColumnDefaults' = 'supported', 'delta.columnMapping.mode' = 'name', 'delta.enableDeletionVectors' = true) | ||
CREATE TABLE main.liquibase_harness_test_ds.tableWithDefaultValues (longcolumn LONG GENERATED BY DEFAULT AS IDENTITY (START WITH 10 INCREMENT BY 5), eventTime TIMESTAMP DEFAULT current_timestamp() NOT NULL, year INT DEFAULT YEAR(CURRENT_TIMESTAMP()), eventDate date DEFAULT CAST(CURRENT_TIMESTAMP() AS DATE), eventDescription STRING DEFAULT 'default string, regular ? almost();!$#@^%[] String bigint' NOT NULL, eventShortDescription STRING DEFAULT 'short desc') USING delta TBLPROPERTIES('delta.feature.allowColumnDefaults' = 'supported', 'delta.columnMapping.mode' = 'name', 'delta.enableDeletionVectors' = true) |
1 change: 1 addition & 0 deletions
1
...ces/liquibase/harness/change/expectedSql/databricks/createTableWithTwoIdentityColumns.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
CREATE TABLE main.liquibase_harness_test_ds.createTableWithTwoIdentityColumns (IdentityByDefault LONG GENERATED BY DEFAULT AS IDENTITY (START WITH 10 INCREMENT BY 5), IdentityAlways LONG GENERATED ALWAYS AS IDENTITY (START WITH 11 INCREMENT BY 2)) USING delta TBLPROPERTIES('delta.feature.allowColumnDefaults' = 'supported', 'delta.columnMapping.mode' = 'name', 'delta.enableDeletionVectors' = true) |