-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add BigQuery Table Constraints Field #8885
Add BigQuery Table Constraints Field #8885
Conversation
Hello! I am a robot. It looks like you are a: @zli82016, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
Tests analyticsTotal tests: Action takenFound 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccBigQueryTable_updateTableConstraints|TestAccBigQueryTable_ForeignKey|TestAccBigQueryTable_PrimaryKey|TestAccDataSourceGoogleServiceAccountIdToken_impersonation |
Rerun these tests in REPLAYING mode to catch issues
|
/gcbrun |
mmv1/third_party/terraform/services/bigquery/resource_bigquery_table_test.go
Outdated
Show resolved
Hide resolved
dataset_id = "%s" | ||
} | ||
|
||
resource "google_bigquery_table" "table_pk" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason to add resource google_bigquery_table.table_pk
? It looks like resource google_bigquery_table.test
is used as the testing resource by specifying resourceName := "google_bigquery_table.test"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zli82016 A foreign key in a table needs to be linked to a primary key in another table. This is currently not enforced by BigQuery, however I added a primary key table anyway because this is the way it's intended to be used by users, and in case these constraints become enforced.
dataset_id = "%s" | ||
} | ||
|
||
resource "google_bigquery_table" "table_pk" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason to add resource google_bigquery_table.table_pk?
mmv1/third_party/terraform/services/bigquery/resource_bigquery_table_test.go
Outdated
Show resolved
Hide resolved
mmv1/third_party/terraform/services/bigquery/resource_bigquery_table_test.go
Outdated
Show resolved
Hide resolved
mmv1/third_party/terraform/services/bigquery/resource_bigquery_table_test.go
Outdated
Show resolved
Hide resolved
The failure of unit tests is unrelated to this PR. |
Tests analyticsTotal tests: Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccBigQueryTable_updateTableConstraints |
Rerun these tests in REPLAYING mode to catch issues
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
* Add BigQuery Table Constraints Field * fix indentation for resource_bigquery_table_test
* Add BigQuery Table Constraints Field * fix indentation for resource_bigquery_table_test
Add BigQuery Table Constraints Field
Fixes hashicorp/terraform-provider-google#15090
API: https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#TableConstraints
Release Note Template for Downstream PRs (will be copied)