Update from 2.4.8 to 2.5 gets SQL Error


  • Default avatar
    neil81    
     7 years ago
    0

    Trying to update AwoCoupon from v2.4.8 to v2.5, and a SQL error is thrown:

    "Duplicate key name 'coupon_code' SQL=ALTER TABLE #__awocoupon ADD INDEX coupon_code (coupon_code)"

    There is a data item 'coupon_code' in the table

    If I try to update using the full installation file, the same error is thrown.

    J!: 3.6.2
    Hikashop Business
    PHP: 5.6.23
    MySql: 5.5.49

    Thanks ..
  • Your avatar
    seyi    
     7 years ago
    0

    Hello,

    The database is out of sync with the version. You would have to update manually:

    https://awodev.com/forum/awocoupon/help-section/duplicate-column-name-voucherfilenamelangid-sql-alter-table-when-upgrad#comment-9102
  • Default avatar
    neil81    
     7 years ago
    0

    OK .. finally got back to check the forum, and even when updating manually, got the same type of error.

    So, I decided to uninstall and reinstall, and now this SQL error pops up on the reinstall:

    Specified key was too long; max key length is 1000 bytes SQL=CREATE TABLE IF NOT EXISTS #__awocoupon_config ( `id` int(16) NOT NULL auto_increment, `name` VARCHAR(255) NOT NULL, `is_json` TINYINT(1), `value` TEXT, PRIMARY KEY (`id`), UNIQUE (`name`) );

    I'm stumped as the __awocoupon table has the same size and type of index.
  • Your avatar
    seyi    
     7 years ago
    0

    Hello,

    Looks like it is a mysql engine issue:

    Is your default engine myisam or innodb?
  • Default avatar
    neil81    
     7 years ago
    0

    Yeah, that was my thought too. The default is MyISAM, not InnoDB. I'm surprised this hasn't happened more often. The funny thing is, when I first installed Awocoupon about a year or so ago, there wasn't an issue :(
  • Your avatar
    seyi    
     7 years ago
    0

    Yes, I dont think I have ever seen that error, so really not sure why you are seeing it.

    Can you update the default engine? Or if you prefer, you can alter the installation sql script which would force innodb.
  • Default avatar
    neil81    
     7 years ago  last edited 7 years ago
    0

    I'll probably unzip the installation archive, modify the SQL, then rezip and try again.

    Thans

    After having a long email discussion, taking over a month, the hosting company I use will not change the MySQL environment to allow large indexes.    The max is 736 (or something like that) for the default system.  All they need to do is change a MySQL environment variable which will not affect anyone really, but they are hesitant.


    Do you have an earlier version of the program that does not use "int(16)" for the index ??  Or, will my modifying the SQL to reduce the size of the Integer cause any issues with the rest of the program??

    THanks

  • Your avatar
    seyi    
     7 years ago
    0

    Hello,

    Modify the size of integer, it will not cause any problems.
  • Default avatar
    neil81    
     7 years ago
    0

    Thanks ...
  • Default avatar
    joomsiter    
     4 years ago
    0

    Hello, please tell how Modify the size of integer? It looks like I have a similar problem
  • Your avatar
    seyi    
     4 years ago
    0

    Hello,

    I believe your specific error was 'Specified key was too long, max key length 1000 bytes' which you have currently solved.
  • Default avatar
    ialearn    
     a year ago
    0

    Hi
    I know this is an old post, but I was getting the same "Specified key was too long; max key length is 1000 bytes" error when trying to install Awo Coupons. I eventually managed to get it working so I thought I would just post what the solution for me was so that if anyone else has this issue it is something they can try.

    My Database collation was set to utf8mb4_general_ci simply changing it from this to utf8_general_ci fixed the issue for me an I was able to install the component.