Skip to content

Loading…

DBAL-791: [GH-514] [DBAL-789] Fix default values for TEXT/BLOB column type on MySQL #2022

Closed
doctrinebot opened this Issue · 2 comments

2 participants

@doctrinebot

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of deeky666:

Url: #514

Message:

MySQL does not support default values for TEXT and BLOB type columns. This causes CREATE TABLE statements to fail if a default value is supplied for those column types:

Doctrine\DBAL\DBALException: An exception occurred while executing 'CREATE TABLE text*blob_default_value (def_text LONGTEXT DEFAULT 'def' NOT NULL, def_text_null LONGTEXT DEFAULT 'def', def_blob LONGBLOB DEFAULT 'def' NOT NULL, def_blob_null LONGBLOB DEFAULT 'def') DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode*ci ENGINE = InnoDB':

SQLSTATE[42000]: Syntax error or access violation: 1101 BLOB/TEXT column 'def_text' can't have a default value

Additionally useless ALTER TABLE statements are created for those mappings with the schema tool because online and offline schema differ for those column types concerning default values:

ALTER TABLE creative CHANGE filename filename LONGTEXT DEFAULT '' NOT NULL;
@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-514] was closed:
#514

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added the Bug label
@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.5 milestone
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.