From 82a755ce68f7a8546c8d724250d9ef8f67d8abef Mon Sep 17 00:00:00 2001 From: joel Date: Wed, 21 Feb 2024 19:27:25 +0800 Subject: [PATCH 1/2] fix: update file name so migration is applied --- ...15144230_remove_ip_address_from_saml_relay_state.up.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 migrations/20240115144230_remove_ip_address_from_saml_relay_state.up.sql diff --git a/migrations/20240115144230_remove_ip_address_from_saml_relay_state.up.sql b/migrations/20240115144230_remove_ip_address_from_saml_relay_state.up.sql new file mode 100644 index 000000000..169ec37b2 --- /dev/null +++ b/migrations/20240115144230_remove_ip_address_from_saml_relay_state.up.sql @@ -0,0 +1,7 @@ +do $$ +begin + if exists (select from information_schema.columns where table_schema = '{{ index .Options "Namespace" }}' and table_name = 'saml_relay_states' and column_name = 'from_ip_address') then + alter table {{ index .Options "Namespace" }}.saml_relay_states drop column from_ip_address; + end if; +end +$$; From a3e89297c822db19b804de2b42a3558cd78d4cd4 Mon Sep 17 00:00:00 2001 From: joel Date: Wed, 21 Feb 2024 19:28:38 +0800 Subject: [PATCH 2/2] fix: convert to rename --- ...40115144230_remove_ip_address_from_saml_relay_state.sql | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 migrations/20240115144230_remove_ip_address_from_saml_relay_state.sql diff --git a/migrations/20240115144230_remove_ip_address_from_saml_relay_state.sql b/migrations/20240115144230_remove_ip_address_from_saml_relay_state.sql deleted file mode 100644 index 169ec37b2..000000000 --- a/migrations/20240115144230_remove_ip_address_from_saml_relay_state.sql +++ /dev/null @@ -1,7 +0,0 @@ -do $$ -begin - if exists (select from information_schema.columns where table_schema = '{{ index .Options "Namespace" }}' and table_name = 'saml_relay_states' and column_name = 'from_ip_address') then - alter table {{ index .Options "Namespace" }}.saml_relay_states drop column from_ip_address; - end if; -end -$$;