-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing mysql 8.4 advanced tests (#966)
- Loading branch information
1 parent
03b8ead
commit 5d09b1c
Showing
4 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
...quibase/harness/generateChangelog/expectedChangeLog/mysql/8.4/addForeignKeyConstraint.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,53 @@ | ||
<?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" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog | ||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd"> | ||
<changeSet id="1" author="as"> | ||
<createTable tableName="test_table_base"> | ||
<column name="id" type="INT"> | ||
<constraints nullable="false" primaryKey="true"/> | ||
</column> | ||
</createTable> | ||
<rollback> | ||
<dropTable tableName="test_table_base"/> | ||
</rollback> | ||
</changeSet> | ||
<changeSet id="2" author="as"> | ||
<createTable tableName="test_table_reference"> | ||
<column name="id" type="INT"> | ||
<constraints nullable="false" primaryKey="true"/> | ||
</column> | ||
<column name="test_column" type="INT"> | ||
<constraints nullable="false"/> | ||
</column> | ||
</createTable> | ||
<rollback> | ||
<dropTable tableName="test_table_reference"/> | ||
</rollback> | ||
</changeSet> | ||
<changeSet id="3" author="as"> | ||
<addUniqueConstraint columnNames="test_column" | ||
constraintName="test_table_reference_unique" | ||
tableName="test_table_reference"/> | ||
<rollback> | ||
<dropUniqueConstraint constraintName="test_table_reference_unique" | ||
tableName="test_table_reference"/> | ||
</rollback> | ||
</changeSet> | ||
<changeSet id="4" author="as"> | ||
<addForeignKeyConstraint baseColumnNames="id" | ||
baseTableName="test_table_base" | ||
constraintName="test_fk" | ||
onDelete="CASCADE" | ||
onUpdate="RESTRICT" | ||
referencedColumnNames="test_column" | ||
referencedTableName="test_table_reference" | ||
validate="true"/> | ||
<rollback> | ||
<dropForeignKeyConstraint baseTableName="test_table_base" | ||
constraintName="test_fk"/> | ||
</rollback> | ||
</changeSet> | ||
</databaseChangeLog> |
26 changes: 26 additions & 0 deletions
26
...ources/liquibase/harness/generateChangelog/expectedChangeLog/mysql/8.4/createFunction.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,26 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<databaseChangeLog | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:pro="http://www.liquibase.org/xml/ns/pro" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog | ||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd"> | ||
<changeSet author="as" id="1"> | ||
<sql>SET GLOBAL log_bin_trust_function_creators = 1;</sql> | ||
<rollback/> | ||
</changeSet> | ||
<changeSet author="as" id="2"> | ||
<pro:createFunction | ||
encoding="UTF-8" | ||
replaceIfExists="true" | ||
functionName="test_function">CREATE FUNCTION test_function() | ||
RETURNS VARCHAR(20) | ||
BEGIN | ||
RETURN 'Hello'; | ||
END | ||
</pro:createFunction> | ||
<rollback> | ||
<pro:dropFunction functionName="test_function"/> | ||
</rollback> | ||
</changeSet> | ||
</databaseChangeLog> |
5 changes: 5 additions & 0 deletions
5
...ces/liquibase/harness/generateChangelog/expectedSql/mysql/8.4/addForeignKeyConstraint.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,5 @@ | ||
CREATE TABLE test_table_base (id INT NOT NULL, CONSTRAINT PK_TEST_TABLE_BASE PRIMARY KEY (id)); | ||
|
||
CREATE TABLE test_table_reference (id INT NOT NULL, test_column INT NOT NULL, CONSTRAINT PK_TEST_TABLE_REFERENCE PRIMARY KEY (id), UNIQUE (test_column)); | ||
|
||
ALTER TABLE test_table_base ADD CONSTRAINT test_fk FOREIGN KEY (id) REFERENCES test_table_reference (test_column) ON UPDATE RESTRICT ON DELETE CASCADE; |
5 changes: 5 additions & 0 deletions
5
...in/resources/liquibase/harness/generateChangelog/expectedSql/mysql/8.4/createFunction.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,5 @@ | ||
CREATE FUNCTION `test_function`() RETURNS varchar(20) CHARSET utf8mb4 | ||
BEGIN | ||
RETURN 'Hello'; | ||
END; | ||
|