xperseguers / t3ext-ig_ldap_sso_auth

TYPO3 Extension ig_ldap_sso_auth. This extension provides LDAP and SSO support for TYPO3.
https://extensions.typo3.org/extension/ig_ldap_sso_auth
27 stars 62 forks source link

Extension Configuration (alter table) fails on Microsoft SQL. Cannot add NOT NULL columns to be_users #122

Closed OnkelM closed 2 years ago

OnkelM commented 3 years ago

This is a fresh typo3 installation. I added the ldap extension and executed Maintenance->Analyze database I got couple errors and this changes are still pending:

ALTER TABLE [be_users] ADD [tx_igldapssoauth_dn] NVARCHAR(255) NOT NULL ALTER TABLE [be_users] ADD CONSTRAINT DF_11BF33B_94BE3F76 DEFAULT '' FOR [tx_igldapssoauth_dn] ALTER TABLE [be_users] ADD [tx_igldapssoauth_id] INT NOT NULL ALTER TABLE [be_users] ADD CONSTRAINT DF_11BF33B_C1C5A825 DEFAULT 0 FOR [tx_igldapssoauth_id] CREATE INDEX [tx_igldapssoauth_dn] ON [be_users] ([tx_igldapssoauth_dn])

The Error is

Error: SQLSTATE [42000, 4901]: [Microsoft][ODBC Driver 13 for SQL Server] [SQL Server]ALTER TABLE only allows columns to be added that can contain nulls, or have a DEFAULT definition specified, or the column being added is an identity or timestamp column, or alternatively if none of the previous conditions are satisfied the table must be empty to allow addition of this column. Column 'tx_igldapssoauth_dn' cannot be added to non-empty table 'be_users' because it does not satisfy these conditions.

xperseguers commented 3 years ago

It looks like a problem with either TYPO3 Doctrine or the ODBC driver, looking at the content of ext_tables.sql I see this regarding table be_users:

CREATE TABLE be_users (
    tx_igldapssoauth_dn varchar(255) DEFAULT '' NOT NULL,
    tx_igldapssoauth_id int(11) unsigned DEFAULT '0' NOT NULL,

    KEY tx_igldapssoauth_dn (tx_igldapssoauth_dn(64))
);

The new column is NOT NULL but provides a DEFAULT value. I'd suggest to manually those columns, this should fix your problem. Then report. Thanks.