Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Commit

Permalink
fix: Fixed pk constraint in aws_rds_certificates (#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
amanenk authored Jan 31, 2022
1 parent acccf30 commit 54d50e7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions resources/provider/migrations/postgres/16_v0.10.2.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE IF EXISTS aws_rds_certificates
DROP CONSTRAINT aws_rds_certificates_pk;
ALTER TABLE IF EXISTS aws_rds_certificates
ADD CONSTRAINT aws_rds_certificates_pk PRIMARY KEY (arn);
4 changes: 4 additions & 0 deletions resources/provider/migrations/postgres/16_v0.10.2.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE IF EXISTS aws_rds_certificates
DROP CONSTRAINT aws_rds_certificates_pk;
ALTER TABLE IF EXISTS aws_rds_certificates
ADD CONSTRAINT aws_rds_certificates_pk PRIMARY KEY (account_id, arn);
4 changes: 4 additions & 0 deletions resources/provider/migrations/timescale/16_v0.10.2.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE IF EXISTS aws_rds_certificates
DROP CONSTRAINT aws_rds_certificates_pk;
ALTER TABLE IF EXISTS aws_rds_certificates
ADD CONSTRAINT aws_rds_certificates_pk PRIMARY KEY (cq_fetch_date, arn);
4 changes: 4 additions & 0 deletions resources/provider/migrations/timescale/16_v0.10.2.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE IF EXISTS aws_rds_certificates
DROP CONSTRAINT aws_rds_certificates_pk;
ALTER TABLE IF EXISTS aws_rds_certificates
ADD CONSTRAINT aws_rds_certificates_pk PRIMARY KEY (cq_fetch_date, account_id, arn);
2 changes: 1 addition & 1 deletion resources/services/rds/certificates.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func RdsCertificates() *schema.Table {
Multiplex: client.ServiceAccountRegionMultiplexer("rds"),
IgnoreError: client.IgnoreAccessDeniedServiceDisabled,
DeleteFilter: client.DeleteAccountRegionFilter,
Options: schema.TableCreationOptions{PrimaryKeys: []string{"arn"}},
Options: schema.TableCreationOptions{PrimaryKeys: []string{"account_id", "arn"}},
Columns: []schema.Column{
{
Name: "account_id",
Expand Down

0 comments on commit 54d50e7

Please sign in to comment.