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

Fix elasticsearch domains PK #384

Merged
merged 3 commits into from
Dec 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this provider will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
### :spider: Fixed
* Fixed PK error with elasticsearch domains [#384](https://github.com/cloudquery/cq-provider-aws/pull/384).

## [v0.8.4] - 2021-12-23
###### SDK Version: 0.5.7

Expand Down
5 changes: 5 additions & 0 deletions resources/provider/migrations/12_v0.8.5.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE IF EXISTS "aws_elasticsearch_domains" DROP CONSTRAINT IF EXISTS "aws_elasticsearch_domains_pk";

ALTER TABLE "aws_elasticsearch_domains"
ADD CONSTRAINT "aws_elasticsearch_domains_pk"
PRIMARY KEY(account_id, id);
5 changes: 5 additions & 0 deletions resources/provider/migrations/12_v0.8.5.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE IF EXISTS "aws_elasticsearch_domains" DROP CONSTRAINT IF EXISTS "aws_elasticsearch_domains_pk";

ALTER TABLE "aws_elasticsearch_domains"
ADD CONSTRAINT "aws_elasticsearch_domains_pk"
PRIMARY KEY(account_id, region, id);
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func ElasticsearchDomains() *schema.Table {
Multiplex: client.ServiceAccountRegionMultiplexer("es"),
IgnoreError: client.IgnoreAccessDeniedServiceDisabled,
DeleteFilter: client.DeleteAccountRegionFilter,
Options: schema.TableCreationOptions{PrimaryKeys: []string{"account_id", "id"}},
Options: schema.TableCreationOptions{PrimaryKeys: []string{"account_id", "region", "id"}},
Columns: []schema.Column{
{
Name: "account_id",
Expand Down