From 9a4a15d19d4c9af029a0aa7e354eb8e286848e45 Mon Sep 17 00:00:00 2001 From: Paul Sarando Date: Thu, 27 Apr 2023 19:40:10 -0700 Subject: [PATCH] CORE-1892 Add app_versions Foreign Key for integration_data_id --- .../000035_app_integration_data_id_fk.down.sql | 13 +++++++++++++ .../000035_app_integration_data_id_fk.up.sql | 15 +++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 migrations/000035_app_integration_data_id_fk.down.sql create mode 100644 migrations/000035_app_integration_data_id_fk.up.sql diff --git a/migrations/000035_app_integration_data_id_fk.down.sql b/migrations/000035_app_integration_data_id_fk.down.sql new file mode 100644 index 0000000..aeedc1e --- /dev/null +++ b/migrations/000035_app_integration_data_id_fk.down.sql @@ -0,0 +1,13 @@ +BEGIN; + +SET search_path = public, pg_catalog; + +-- +-- Foreign Key for `integration_data_id` column in `app_versions` table. +-- +ALTER TABLE IF EXISTS app_versions + DROP CONSTRAINT IF EXISTS app_integration_data_id_fk; + +DROP INDEX IF EXISTS app_versions_integration_data_id; + +COMMIT; diff --git a/migrations/000035_app_integration_data_id_fk.up.sql b/migrations/000035_app_integration_data_id_fk.up.sql new file mode 100644 index 0000000..24bf7bb --- /dev/null +++ b/migrations/000035_app_integration_data_id_fk.up.sql @@ -0,0 +1,15 @@ +BEGIN; + +SET search_path = public, pg_catalog; + +-- +-- Foreign Key for `integration_data_id` column in `app_versions` table. +-- +ALTER TABLE ONLY app_versions + ADD CONSTRAINT app_integration_data_id_fk + FOREIGN KEY (integration_data_id) + REFERENCES integration_data(id); + +CREATE INDEX IF NOT EXISTS app_versions_integration_data_id ON app_versions(integration_data_id); + +COMMIT;