Skip to content

Commit fb6a2de

Browse files
authored
fix(gcp-resources): Remove bucket_name as PK of gcp_storage_bucket_policies (#6550)
#### Summary `gcp_storage_bucket_policies` used the parent bucket's name as a PK. This means we could only get 1 policy per bucket in `overwrite*` modes. Per a better field, this PR fixes it so we use `_cq_id` <!--
1 parent d230ede commit fb6a2de

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

plugins/source/gcp/docs/tables/gcp_storage_bucket_policies.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
https://cloud.google.com/iam/docs/reference/rest/v1/Policy
44

5-
The primary key for this table is **bucket_name**.
5+
The primary key for this table is **_cq_id**.
66

77
## Relations
88

@@ -14,8 +14,8 @@ This table depends on [gcp_storage_buckets](gcp_storage_buckets.md).
1414
| ------------- | ------------- |
1515
|_cq_source_name|String|
1616
|_cq_sync_time|Timestamp|
17-
|_cq_id|UUID|
17+
|_cq_id (PK)|UUID|
1818
|_cq_parent_id|UUID|
1919
|project_id|String|
20-
|bucket_name (PK)|String|
20+
|bucket_name|String|
2121
|bindings|JSON|

plugins/source/gcp/resources/services/storage/bucket_policies.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ func BucketPolicies() *schema.Table {
2424
Name: "bucket_name",
2525
Type: schema.TypeString,
2626
Resolver: schema.ParentColumnResolver("name"),
27-
CreationOptions: schema.ColumnCreationOptions{
28-
PrimaryKey: true,
29-
},
3027
},
3128
},
3229
}

0 commit comments

Comments
 (0)