From 8d1b68abcfe3bcb4e6f9a4f0e1d63de0323efa76 Mon Sep 17 00:00:00 2001
From: Martin Krisell <martin.krisell@gmail.com>
Date: Mon, 26 Oct 2020 21:36:11 +0100
Subject: [PATCH] Fix SQLServer ALTER syntax (#1380)

---
 modules/saml/lib/SP/LogoutStore.php | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/saml/lib/SP/LogoutStore.php b/modules/saml/lib/SP/LogoutStore.php
index 0cbde2f92..7bcc512c4 100644
--- a/modules/saml/lib/SP/LogoutStore.php
+++ b/modules/saml/lib/SP/LogoutStore.php
@@ -42,6 +42,11 @@ class LogoutStore
                         'ALTER TABLE ' . $store->prefix . '_saml_LogoutStore ALTER COLUMN _expire TYPE TIMESTAMP'
                     ];
                     break;
+                case 'sqlsrv':
+                    $update = [
+                        'ALTER TABLE ' . $store->prefix . '_saml_LogoutStore ALTER COLUMN _expire DATETIME NOT NULL'
+                    ];
+                    break;
                 case 'sqlite':
                     /**
                      * Because SQLite does not support field alterations, the approach is to:
@@ -119,6 +124,11 @@ class LogoutStore
                         'ALTER TABLE ' . $store->prefix .
                         '_saml_LogoutStore ALTER COLUMN _authSource TYPE VARCHAR(255)'];
                     break;
+               case 'sqlsrv':
+                    $update = [
+                        'ALTER TABLE ' . $store->prefix . '_saml_LogoutStore ALTER COLUMN _authSource VARCHAR(255) NOT NULL'
+                    ];
+                    break;
                 case 'sqlite':
                     /**
                      * Because SQLite does not support field alterations, the approach is to:
-- 
GitLab