Uploaded image for project: 'Doctrine DBAL'
  1. Doctrine DBAL
  2. DBAL-346

Generated schema fails on MySQL (BLOB/TEXT cant have DEFAULT value)


    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.3
    • Component/s: Schema Managers
    • Security Level: All
    • Labels:
    • Environment:
      Symfony 2.1.x (dev/master), Doctrine 2.2.3, MySQL 5.5.x


      In my symfony 2.1 project i was including JMSPaymentCoreBundle and did the vanilla installation.

      After that i ran

      php app/console doctrine:schema:update --dump-sql
      php app/console doctrine:schema:update --force

      A lot of schema updates were done. I ran it again, and two schema updates were still showing up.
      Running the command again, and they still show up.

      I then tried to run the two schema updates against my database and MySQL complains with the following error:

      Error: 1101 - BLOB/TEXT column 'extended_data' can't have a default value

      According to the Documentation BLOB/TEXT indeed cannot have default values. I am not sure why Doctrine thinks it has to set this default value.

      The statements look like this:

      sascha@debian:/var/www/myproject/Symfony$ php app/console doctrine:schema:update --dump-sql
      ALTER TABLE payment_instructions CHANGE extended_data extended_data LONGTEXT NOT NULL COMMENT '(DC2Type:extended_payment_data)';
      ALTER TABLE financial_transactions CHANGE extended_data extended_data LONGTEXT DEFAULT NULL COMMENT '(DC2Type:extended_payment_data)'

      I already reported this problem in the JMSPaymentCoreBundle Issue Queue where i then was referred to over here.

      Also, i am not sure if Doctrine DBAL is the best match for this issue, so if it is wrong please move it to the right project issue queue.

      Thank you very much and best of Regards!


        There are no comments yet on this issue.


          • Assignee:
            beberlei Benjamin Eberlei
            thenetexperts Sascha Ahmann
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: