Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DAT-18244] fixed FK tests, init script, JSONAssert #338

Merged
merged 3 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<dependency>
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
<version>1.5.2</version>
<version>1.5.3</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
//import org.junit.jupiter.api.BeforeEach;
//import org.junit.jupiter.api.Test;
//
//import static org.junit.jupiter.api.Assertions.assertEquals;
//import static org.junit.jupiter.api.Assertions.assertInstanceOf;

public class BigQueryMergeColumnChangeTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
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="v">
<addPrimaryKey tableName="authors" columnNames="id" constraintName="pk_authors"/>
</changeSet>
<changeSet author="oleh" id="1">
<addForeignKeyConstraint baseColumnNames="author_id"
baseTableName="posts"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?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="oleh">
<addForeignKeyConstraint baseColumnNames="author_id"
baseTableName="posts"
constraintName="fk_posts_authors_test"
referencedColumnNames="id"
referencedTableName="authors"/>
<addForeignKeyConstraint baseColumnNames="id"
baseTableName="posts"
constraintName="fk_posts_authors_test2"
referencedColumnNames="id"
referencedTableName="authors"/>
<rollback/>
</changeSet>
<changeSet id="2" author="oleh">
<dropAllForeignKeyConstraints baseTableName="posts"/>
<rollback/>
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
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="v">
<addPrimaryKey tableName="authors" columnNames="id" constraintName="pk_authors"/>
</changeSet>
<changeSet author="oleh" id="1">
<addForeignKeyConstraint baseColumnNames="author_id"
baseTableName="posts"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ CREATE TABLE authors (
last_name STRING NOT NULL,
email STRING NOT NULL,
birthdate DATE NOT NULL,
added TIMESTAMP NOT NULL
added TIMESTAMP NOT NULL,
PRIMARY KEY (id) NOT ENFORCED
);

INSERT INTO authors VALUES (1,'Eileen','Lubowitz','[email protected]','1991-03-04','2004-05-30 02:08:25');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
ALTER TABLE harness_test_ds.authors ADD PRIMARY KEY (id) NOT ENFORCED
ALTER TABLE harness_test_ds.posts ADD CONSTRAINT fk_posts_authors_test FOREIGN KEY (author_id) REFERENCES harness_test_ds.authors (id) NOT ENFORCED
ALTER TABLE oleh.posts ADD CONSTRAINT fk_posts_authors_test FOREIGN KEY (author_id) REFERENCES oleh.authors (id) NOT ENFORCED
KushnirykOleh marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
INVALID TEST -- BigQuery does not support FK
ALTER TABLE oleh.posts ADD CONSTRAINT fk_posts_authors_test FOREIGN KEY (author_id) REFERENCES oleh.authors (id) NOT ENFORCED
ALTER TABLE oleh.posts ADD CONSTRAINT fk_posts_authors_test2 FOREIGN KEY (id) REFERENCES oleh.authors (id) NOT ENFORCED
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
ALTER TABLE harness_test_ds.authors ADD PRIMARY KEY (id) NOT ENFORCED
ALTER TABLE harness_test_ds.posts ADD CONSTRAINT fk_posts_authors_test FOREIGN KEY (author_id) REFERENCES harness_test_ds.authors (id) NOT ENFORCED
ALTER TABLE harness_test_ds.posts DROP CONSTRAINT fk_posts_authors_test
ALTER TABLE oleh.posts ADD CONSTRAINT fk_posts_authors_test FOREIGN KEY (author_id) REFERENCES oleh.authors (id) NOT ENFORCED
ALTER TABLE oleh.posts DROP CONSTRAINT fk_posts_authors_test
Loading