Skip to content

[BUGFIX] Add default values to text fields - #230

Open
mschwemer wants to merge 1 commit into
bobosch:masterfrom
mschwemer:bugfix/229_database-definition
Open

[BUGFIX] Add default values to text fields#230
mschwemer wants to merge 1 commit into
bobosch:masterfrom
mschwemer:bugfix/229_database-definition

Conversation

@mschwemer

Copy link
Copy Markdown
Contributor

Since mysql 8.0.13 and mariadb 10.2.1 NOT NULL without a defined default value are not allowed any more. Adding a default value solves the issue.

Fixes: #229

Since mysql 8.0.13 and mariadb 10.2.1 `NOT NULL` without a defined
default value are not allowed any more. Adding a default value solves
the issue.

Fixes: bobosch#229
@bobosch

bobosch commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Mysql does not allow default values on text fileds :-(

https://dev.mysql.com/doc/refman/9.7/en/blob.html
"BLOB and TEXT columns cannot have DEFAULT values."

@mschwemer

Copy link
Copy Markdown
Contributor Author

Hmmm ...

ext_tables.sql is SQL pseudo code, which is parsed via doctrine dbal and not a mysql native sql code. Prior to mysql 8.0.13 the default part is stripped off https://github.com/doctrine/dbal/blob/1a2fbd0e/src/Platforms/MySQLPlatform.php#L28-L34.

With mysql 8.0.13 it is possible to provide default values for TEXT fields: https://dev.mysql.com/doc/refman/8.0/en/data-type-defaults.html#data-type-defaults-explicit-old ... 3rd paragraph:

The BLOB, TEXT, GEOMETRY, and JSON data types can be assigned a default value only if the value is written as an expression, even if the expression value is a literal.

I would update the PR using an expression for the default value, if you like.

@bobosch

bobosch commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Also all sysext have no DEFAULT on text and blob fields ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exception, when creating a new maker

2 participants