Skip to content

Commit 88c1993

Browse files
authored
fix(gcp-resources): Add project_id and name as PKs of gcp_run_locations (#6548)
#### Summary `gcp_run_locations` was missing PKs, this should be a non breaking change as the data exists <!--
1 parent 237e28d commit 88c1993

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

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

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

33
https://cloud.google.com/run/docs/reference/rest/v1/projects.locations#Location
44

5-
The primary key for this table is **_cq_id**.
5+
The composite primary key for this table is (**project_id**, **name**).
66

77
## Relations
88

@@ -15,11 +15,11 @@ The following tables depend on gcp_run_locations:
1515
| ------------- | ------------- |
1616
|_cq_source_name|String|
1717
|_cq_sync_time|Timestamp|
18-
|_cq_id (PK)|UUID|
18+
|_cq_id|UUID|
1919
|_cq_parent_id|UUID|
20-
|project_id|String|
20+
|project_id (PK)|String|
21+
|name (PK)|String|
2122
|display_name|String|
2223
|labels|JSON|
2324
|location_id|String|
24-
|metadata|IntArray|
25-
|name|String|
25+
|metadata|IntArray|

plugins/source/gcp/resources/services/run/locations.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ func Locations() *schema.Table {
1919
Name: "project_id",
2020
Type: schema.TypeString,
2121
Resolver: client.ResolveProject,
22+
CreationOptions: schema.ColumnCreationOptions{
23+
PrimaryKey: true,
24+
},
25+
},
26+
{
27+
Name: "name",
28+
Type: schema.TypeString,
29+
Resolver: schema.PathResolver("Name"),
30+
CreationOptions: schema.ColumnCreationOptions{
31+
PrimaryKey: true,
32+
},
2233
},
2334
},
2435
Relations: []*schema.Table{

0 commit comments

Comments
 (0)