Related Documents
Document Properties
Kbid
305E96
Last Modified
28-Jul-2022
Added to KB
31-Aug-2022
Public Access
Everyone
Status
Online
Doc Type
Guidelines, Concepts & Cookbooks
Product
ICM 7.10

Guide - 7.10.38.14 Fix NOT NULL Constraints

Table of Contents


Product Version

7.10

Product To Version


Status

1 Introduction

Versions prior to 7.10.38.11 contained an issue that led to missing not null constraints on database tables belonging to persistent objects with fields that have been declared as required.

1.1 Fix NOT NULL Constraints

The fix is applied by the TablePreparer's migration part which is run on each database migration. It tries to apply the required flag as null/not null constraint. Normally this is not an issue, but in one exception:

The column needs to have the not null constraint applied, and a null value had been written into the column prior to this migration run.

If this is the case, a warning message using the following pattern is logged:

warning message
Skipping to change <tableName>.<columnName> from NULL to NOT NULL because there are NULL values present

If this message appears in the logs after the migration has been run, the migration of the column has to be done manually:

  1. Ensure that there is no null value inside the column (update all null values to non-nulls).
  2. Apply the not null constraint.

Disclaimer

The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

Customer Support
Knowledge Base
Product Resources
Tickets