Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-18770

eZDbSchema exports badly default value on MySQL

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • Database related, Misc
    • None

    Description

      I have a table in mysql (in attachment, mytable.sql), I export it to a db_schema.dba (also in attachment)

      Then (I drop mytable table), and I load again this db_schema.dba to test the file with:

      bin/php/ezsqlinsertschema.php --type=mysql --user=root db_schema.dba mydatabase
      

      And I get the error (impossible to load the .dba file), in my error.log:

      [ Oct 13 2011 12:38:36 ] [] eZMySQLDB:
      Query error: Invalid default value for 'prefix_id'. Query: CREATE TABLE mytable (
        prefix_id tinyint(3) NOT NULL DEFAULT '',
        xx_id int(10) NOT NULL DEFAULT '0',
        UNIQUE KEY country ( prefix_id, xx_id )
      )
      [ Oct 13 2011 12:38:36 ] [] :
      Failed inserting the SQL:
      CREATE TABLE mytable (
        prefix_id tinyint(3) NOT NULL DEFAULT '',
        xx_id int(10) NOT NULL DEFAULT '0',
        UNIQUE KEY country ( prefix_id, xx_id )
      )
      

      Attachments

        1. db_schema.dba
          0.7 kB
        2. mytable.sql
          2 kB
        3. pma.png
          pma.png
          33 kB

        Activity

          People

            unknown unknown
            enzo enzo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: