From 161e99976f51a6155c76c4a3b48d02b7440c4b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20W=C3=B3jcik?= Date: Fri, 26 Jun 2026 15:09:36 +0200 Subject: [PATCH] split migration to avoid changing existing one --- migrations/20260601090254_[2.0.2]_smtp_xoauth2.down.sql | 3 +-- migrations/20260601090254_[2.0.2]_smtp_xoauth2.up.sql | 3 +-- .../20260601090255_[2.0.2]_smtp_oauth_tenant_id.down.sql | 2 ++ migrations/20260601090255_[2.0.2]_smtp_oauth_tenant_id.up.sql | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 migrations/20260601090255_[2.0.2]_smtp_oauth_tenant_id.down.sql create mode 100644 migrations/20260601090255_[2.0.2]_smtp_oauth_tenant_id.up.sql diff --git a/migrations/20260601090254_[2.0.2]_smtp_xoauth2.down.sql b/migrations/20260601090254_[2.0.2]_smtp_xoauth2.down.sql index 380f19390..31452abf3 100644 --- a/migrations/20260601090254_[2.0.2]_smtp_xoauth2.down.sql +++ b/migrations/20260601090254_[2.0.2]_smtp_xoauth2.down.sql @@ -3,6 +3,5 @@ ALTER TABLE settings DROP smtp_oauth_issuer_url, DROP smtp_oauth_client_id, DROP smtp_oauth_client_secret, - DROP smtp_oauth_refresh_token, - DROP smtp_oauth_tenant_id; + DROP smtp_oauth_refresh_token; DROP TYPE smtp_authentication; diff --git a/migrations/20260601090254_[2.0.2]_smtp_xoauth2.up.sql b/migrations/20260601090254_[2.0.2]_smtp_xoauth2.up.sql index f9193f254..a8da4e83a 100644 --- a/migrations/20260601090254_[2.0.2]_smtp_xoauth2.up.sql +++ b/migrations/20260601090254_[2.0.2]_smtp_xoauth2.up.sql @@ -8,6 +8,5 @@ ALTER TABLE settings ADD smtp_oauth_issuer_url text NULL, ADD smtp_oauth_client_id text NULL, ADD smtp_oauth_client_secret text NULL, - ADD smtp_oauth_refresh_token text NULL, - ADD smtp_oauth_tenant_id text NULL; + ADD smtp_oauth_refresh_token text NULL; UPDATE settings SET smtp_authentication = 'login' WHERE smtp_user IS NOT NULL AND smtp_password IS NOT NULL; diff --git a/migrations/20260601090255_[2.0.2]_smtp_oauth_tenant_id.down.sql b/migrations/20260601090255_[2.0.2]_smtp_oauth_tenant_id.down.sql new file mode 100644 index 000000000..b8922ea8b --- /dev/null +++ b/migrations/20260601090255_[2.0.2]_smtp_oauth_tenant_id.down.sql @@ -0,0 +1,2 @@ +ALTER TABLE settings + DROP COLUMN smtp_oauth_tenant_id; diff --git a/migrations/20260601090255_[2.0.2]_smtp_oauth_tenant_id.up.sql b/migrations/20260601090255_[2.0.2]_smtp_oauth_tenant_id.up.sql new file mode 100644 index 000000000..0decb10ef --- /dev/null +++ b/migrations/20260601090255_[2.0.2]_smtp_oauth_tenant_id.up.sql @@ -0,0 +1,2 @@ +ALTER TABLE settings + ADD COLUMN smtp_oauth_tenant_id text NULL;