diff --git a/lib/pact_broker/deployments/deployed_version.rb b/lib/pact_broker/deployments/deployed_version.rb index fc9ce14c8..9e4b50190 100644 --- a/lib/pact_broker/deployments/deployed_version.rb +++ b/lib/pact_broker/deployments/deployed_version.rb @@ -102,11 +102,11 @@ def record_undeployed # version_id | integer | NOT NULL # pacticipant_id | integer | NOT NULL # environment_id | integer | NOT NULL -# target | text | -# target_for_index | text | NOT NULL DEFAULT ''::text # created_at | timestamp without time zone | NOT NULL # updated_at | timestamp without time zone | NOT NULL # undeployed_at | timestamp without time zone | +# target | text | +# target_for_index | text | NOT NULL DEFAULT ''::text # Indexes: # deployed_versions_pkey | PRIMARY KEY btree (id) # deployed_versions_uuid_index | UNIQUE btree (uuid) diff --git a/lib/pact_broker/deployments/environment.rb b/lib/pact_broker/deployments/environment.rb index f9ad6c7fc..279a68d43 100644 --- a/lib/pact_broker/deployments/environment.rb +++ b/lib/pact_broker/deployments/environment.rb @@ -44,6 +44,6 @@ def delete # environments_name_index | UNIQUE btree (name) # environments_uuid_index | UNIQUE btree (uuid) # Referenced By: -# deployed_versions | deployed_versions_environment_id_fkey | (environment_id) REFERENCES environments(id) # currently_deployed_version_ids | currently_deployed_version_ids_environment_id_fkey | (environment_id) REFERENCES environments(id) ON DELETE CASCADE +# deployed_versions | deployed_versions_environment_id_fkey | (environment_id) REFERENCES environments(id) # released_versions | released_versions_environment_id_fkey | (environment_id) REFERENCES environments(id) diff --git a/lib/pact_broker/domain/pacticipant.rb b/lib/pact_broker/domain/pacticipant.rb index d58d71d22..3ee231266 100644 --- a/lib/pact_broker/domain/pacticipant.rb +++ b/lib/pact_broker/domain/pacticipant.rb @@ -83,22 +83,22 @@ def any_versions? # pacticipants_name_key | UNIQUE btree (name) # ndx_ppt_name | btree (name) # Referenced By: -# versions | versions_pacticipant_id_fkey | (pacticipant_id) REFERENCES pacticipants(id) -# webhooks | fk_webhooks_consumer | (consumer_id) REFERENCES pacticipants(id) -# webhooks | fk_webhooks_provider | (provider_id) REFERENCES pacticipants(id) -# pact_versions | pact_versions_consumer_id_fkey | (consumer_id) REFERENCES pacticipants(id) -# pact_versions | pact_versions_provider_id_fkey | (provider_id) REFERENCES pacticipants(id) +# currently_deployed_version_ids | currently_deployed_version_ids_pacticipant_id_fkey | (pacticipant_id) REFERENCES pacticipants(id) ON DELETE CASCADE +# labels | labels_pacticipant_id_fkey | (pacticipant_id) REFERENCES pacticipants(id) +# latest_pact_publication_ids_for_consumer_versions | latest_pact_publication_ids_for_consumer_versi_consumer_id_fkey | (consumer_id) REFERENCES pacticipants(id) ON DELETE CASCADE +# latest_pact_publication_ids_for_consumer_versions | latest_pact_publication_ids_for_consumer_versi_provider_id_fkey | (provider_id) REFERENCES pacticipants(id) ON DELETE CASCADE +# latest_verification_id_for_pact_version_and_provider_version | latest_v_id_for_pv_and_pv_consumer_id_fk | (consumer_id) REFERENCES pacticipants(id) ON DELETE CASCADE +# latest_verification_id_for_pact_version_and_provider_version | latest_v_id_for_pv_and_pv_provider_id_fk | (provider_id) REFERENCES pacticipants(id) ON DELETE CASCADE # pact_publications | pact_publications_consumer_id_fkey | (consumer_id) REFERENCES pacticipants(id) # pact_publications | pact_publications_provider_id_fkey | (provider_id) REFERENCES pacticipants(id) +# pact_versions | pact_versions_consumer_id_fkey | (consumer_id) REFERENCES pacticipants(id) +# pact_versions | pact_versions_provider_id_fkey | (provider_id) REFERENCES pacticipants(id) +# triggered_webhooks | triggered_webhooks_consumer_id_fkey | (consumer_id) REFERENCES pacticipants(id) +# triggered_webhooks | triggered_webhooks_provider_id_fkey | (provider_id) REFERENCES pacticipants(id) # verifications | verifications_consumer_id_fkey | (consumer_id) REFERENCES pacticipants(id) # verifications | verifications_provider_id_fkey | (provider_id) REFERENCES pacticipants(id) +# versions | versions_pacticipant_id_fkey | (pacticipant_id) REFERENCES pacticipants(id) # webhook_executions | webhook_executions_consumer_id_fkey | (consumer_id) REFERENCES pacticipants(id) # webhook_executions | webhook_executions_provider_id_fkey | (provider_id) REFERENCES pacticipants(id) -# labels | labels_pacticipant_id_fkey | (pacticipant_id) REFERENCES pacticipants(id) -# triggered_webhooks | triggered_webhooks_consumer_id_fkey | (consumer_id) REFERENCES pacticipants(id) -# triggered_webhooks | triggered_webhooks_provider_id_fkey | (provider_id) REFERENCES pacticipants(id) -# latest_pact_publication_ids_for_consumer_versions | latest_pact_publication_ids_for_consumer_versi_consumer_id_fkey | (consumer_id) REFERENCES pacticipants(id) ON DELETE CASCADE -# latest_pact_publication_ids_for_consumer_versions | latest_pact_publication_ids_for_consumer_versi_provider_id_fkey | (provider_id) REFERENCES pacticipants(id) ON DELETE CASCADE -# latest_verification_id_for_pact_version_and_provider_version | latest_v_id_for_pv_and_pv_consumer_id_fk | (consumer_id) REFERENCES pacticipants(id) ON DELETE CASCADE -# latest_verification_id_for_pact_version_and_provider_version | latest_v_id_for_pv_and_pv_provider_id_fk | (provider_id) REFERENCES pacticipants(id) ON DELETE CASCADE -# currently_deployed_version_ids | currently_deployed_version_ids_pacticipant_id_fkey | (pacticipant_id) REFERENCES pacticipants(id) ON DELETE CASCADE +# webhooks | fk_webhooks_consumer | (consumer_id) REFERENCES pacticipants(id) +# webhooks | fk_webhooks_provider | (provider_id) REFERENCES pacticipants(id) diff --git a/lib/pact_broker/domain/verification.rb b/lib/pact_broker/domain/verification.rb index 5ae4db302..b2134f080 100644 --- a/lib/pact_broker/domain/verification.rb +++ b/lib/pact_broker/domain/verification.rb @@ -262,5 +262,5 @@ def method_missing(m, *args, &block) # verifications_pact_version_id_fkey | (pact_version_id) REFERENCES pact_versions(id) # verifications_provider_id_fkey | (provider_id) REFERENCES pacticipants(id) # Referenced By: -# triggered_webhooks | triggered_webhooks_verification_id_fkey | (verification_id) REFERENCES verifications(id) # latest_verification_id_for_pact_version_and_provider_version | latest_v_id_for_pv_and_pv_verification_id_fk | (verification_id) REFERENCES verifications(id) ON DELETE CASCADE +# triggered_webhooks | triggered_webhooks_verification_id_fkey | (verification_id) REFERENCES verifications(id) diff --git a/lib/pact_broker/domain/version.rb b/lib/pact_broker/domain/version.rb index 6de6dd096..4eb9500a4 100644 --- a/lib/pact_broker/domain/version.rb +++ b/lib/pact_broker/domain/version.rb @@ -254,11 +254,11 @@ def latest_for_pacticipant? # Foreign key constraints: # versions_pacticipant_id_fkey | (pacticipant_id) REFERENCES pacticipants(id) # Referenced By: -# tags | tags_version_id_fkey | (version_id) REFERENCES versions(id) -# pact_publications | pact_publications_consumer_version_id_fkey | (consumer_version_id) REFERENCES versions(id) -# verifications | fk_verifications_versions | (provider_version_id) REFERENCES versions(id) +# currently_deployed_version_ids | currently_deployed_version_ids_version_id_fkey | (version_id) REFERENCES versions(id) ON DELETE CASCADE +# deployed_versions | deployed_versions_version_id_fkey | (version_id) REFERENCES versions(id) # latest_pact_publication_ids_for_consumer_versions | latest_pact_publication_ids_for_consum_consumer_version_id_fkey | (consumer_version_id) REFERENCES versions(id) ON DELETE CASCADE # latest_verification_id_for_pact_version_and_provider_version | latest_v_id_for_pv_and_pv_provider_version_id_fk | (provider_version_id) REFERENCES versions(id) ON DELETE CASCADE -# deployed_versions | deployed_versions_version_id_fkey | (version_id) REFERENCES versions(id) -# currently_deployed_version_ids | currently_deployed_version_ids_version_id_fkey | (version_id) REFERENCES versions(id) ON DELETE CASCADE +# pact_publications | pact_publications_consumer_version_id_fkey | (consumer_version_id) REFERENCES versions(id) # released_versions | released_versions_version_id_fkey | (version_id) REFERENCES versions(id) +# tags | tags_version_id_fkey | (version_id) REFERENCES versions(id) +# verifications | fk_verifications_versions | (provider_version_id) REFERENCES versions(id) diff --git a/lib/pact_broker/integrations/integration.rb b/lib/pact_broker/integrations/integration.rb index 6a4daab67..38ffe3312 100644 --- a/lib/pact_broker/integrations/integration.rb +++ b/lib/pact_broker/integrations/integration.rb @@ -69,6 +69,7 @@ def latest_verification_publication_date end # Table: integrations +# Primary Key: (consumer_id, provider_id) # Columns: # consumer_id | integer | # consumer_name | text | diff --git a/lib/pact_broker/pacts/pact_publication.rb b/lib/pact_broker/pacts/pact_publication.rb index 86ab8e007..68b38f243 100644 --- a/lib/pact_broker/pacts/pact_publication.rb +++ b/lib/pact_broker/pacts/pact_publication.rb @@ -173,13 +173,14 @@ def cached_domain_for_delegation # Table: pact_publications # Columns: -# id | integer | PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY -# consumer_version_id | integer | NOT NULL -# provider_id | integer | NOT NULL -# revision_number | integer | NOT NULL -# pact_version_id | integer | NOT NULL -# created_at | timestamp without time zone | NOT NULL -# consumer_id | integer | +# id | integer | PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY +# consumer_version_id | integer | NOT NULL +# provider_id | integer | NOT NULL +# revision_number | integer | NOT NULL +# pact_version_id | integer | NOT NULL +# created_at | timestamp without time zone | NOT NULL +# consumer_id | integer | +# consumer_version_order | integer | # Indexes: # pact_publications_pkey | PRIMARY KEY btree (id) # cv_prov_revision_unq | UNIQUE btree (consumer_version_id, provider_id, revision_number) @@ -191,6 +192,6 @@ def cached_domain_for_delegation # pact_publications_pact_version_id_fkey | (pact_version_id) REFERENCES pact_versions(id) # pact_publications_provider_id_fkey | (provider_id) REFERENCES pacticipants(id) # Referenced By: -# webhook_executions | webhook_executions_pact_publication_id_fkey | (pact_publication_id) REFERENCES pact_publications(id) -# triggered_webhooks | triggered_webhooks_pact_publication_id_fkey | (pact_publication_id) REFERENCES pact_publications(id) # latest_pact_publication_ids_for_consumer_versions | latest_pact_publication_ids_for_consum_pact_publication_id_fkey | (pact_publication_id) REFERENCES pact_publications(id) ON DELETE CASCADE +# triggered_webhooks | triggered_webhooks_pact_publication_id_fkey | (pact_publication_id) REFERENCES pact_publications(id) +# webhook_executions | webhook_executions_pact_publication_id_fkey | (pact_publication_id) REFERENCES pact_publications(id) diff --git a/lib/pact_broker/pacts/pact_version.rb b/lib/pact_broker/pacts/pact_version.rb index f506ae6b8..af1cd564c 100644 --- a/lib/pact_broker/pacts/pact_version.rb +++ b/lib/pact_broker/pacts/pact_version.rb @@ -118,12 +118,14 @@ def verified_successfully_by_any_provider_version? # Table: pact_versions # Columns: -# id | integer | PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY -# consumer_id | integer | NOT NULL -# provider_id | integer | NOT NULL -# sha | text | NOT NULL -# content | text | -# created_at | timestamp without time zone | NOT NULL +# id | integer | PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY +# consumer_id | integer | NOT NULL +# provider_id | integer | NOT NULL +# sha | text | NOT NULL +# content | text | +# created_at | timestamp without time zone | NOT NULL +# messages_count | integer | +# interactions_count | integer | # Indexes: # pact_versions_pkey | PRIMARY KEY btree (id) # unq_pvc_con_prov_sha | UNIQUE btree (consumer_id, provider_id, sha) @@ -131,7 +133,7 @@ def verified_successfully_by_any_provider_version? # pact_versions_consumer_id_fkey | (consumer_id) REFERENCES pacticipants(id) # pact_versions_provider_id_fkey | (provider_id) REFERENCES pacticipants(id) # Referenced By: -# pact_publications | pact_publications_pact_version_id_fkey | (pact_version_id) REFERENCES pact_versions(id) -# verifications | verifications_pact_version_id_fkey | (pact_version_id) REFERENCES pact_versions(id) # latest_pact_publication_ids_for_consumer_versions | latest_pact_publication_ids_for_consumer_v_pact_version_id_fkey | (pact_version_id) REFERENCES pact_versions(id) ON DELETE CASCADE # latest_verification_id_for_pact_version_and_provider_version | latest_v_id_for_pv_and_pv_pact_version_id_fk | (pact_version_id) REFERENCES pact_versions(id) ON DELETE CASCADE +# pact_publications | pact_publications_pact_version_id_fkey | (pact_version_id) REFERENCES pact_versions(id) +# verifications | verifications_pact_version_id_fkey | (pact_version_id) REFERENCES pact_versions(id) diff --git a/lib/pact_broker/webhooks/triggered_webhook.rb b/lib/pact_broker/webhooks/triggered_webhook.rb index 5ef155db0..2547eaaa3 100644 --- a/lib/pact_broker/webhooks/triggered_webhook.rb +++ b/lib/pact_broker/webhooks/triggered_webhook.rb @@ -136,6 +136,7 @@ def number_of_attempts_remaining # triggered_webhooks_provider_id_index | btree (provider_id) # triggered_webhooks_verification_id_index | btree (verification_id) # triggered_webhooks_webhook_id_index | btree (webhook_id) +# triggered_webhooks_webhook_uuid_index | btree (webhook_uuid) # Foreign key constraints: # triggered_webhooks_consumer_id_fkey | (consumer_id) REFERENCES pacticipants(id) # triggered_webhooks_pact_publication_id_fkey | (pact_publication_id) REFERENCES pact_publications(id) diff --git a/lib/pact_broker/webhooks/webhook.rb b/lib/pact_broker/webhooks/webhook.rb index 4a0bb448f..8a3f55bd1 100644 --- a/lib/pact_broker/webhooks/webhook.rb +++ b/lib/pact_broker/webhooks/webhook.rb @@ -153,7 +153,7 @@ def self.properties_hash_from_domain webhook # fk_webhooks_consumer | (consumer_id) REFERENCES pacticipants(id) # fk_webhooks_provider | (provider_id) REFERENCES pacticipants(id) # Referenced By: -# webhook_headers | fk_webhookheaders_webhooks | (webhook_id) REFERENCES webhooks(id) -# webhook_executions | webhook_executions_webhook_id_fkey | (webhook_id) REFERENCES webhooks(id) # triggered_webhooks | triggered_webhooks_webhook_id_fkey | (webhook_id) REFERENCES webhooks(id) # webhook_events | webhook_events_webhook_id_fkey | (webhook_id) REFERENCES webhooks(id) ON DELETE CASCADE +# webhook_executions | webhook_executions_webhook_id_fkey | (webhook_id) REFERENCES webhooks(id) +# webhook_headers | fk_webhookheaders_webhooks | (webhook_id) REFERENCES webhooks(id)