Error updating VM3 to VM4 and Awocoupon3 to Awocoupon4: Unknown column 'session_id' in where clause'


  • Default avatar
    begoña    
     5 months ago
    0

    I am testing the update from VM3/J3 to VM4/J4. Currently, I have AwoCoupon 3.6.1 installed.

    After some testing, what seems to be working, but not entirely, is:
    - Dump all tables of Awocoupon3
    - Update to VM4/J4
    - Install and visit the control panel of AwoCoupon
    - Restore Awocoupon3 tables
    - Reinstall Awocoupon4
    - Visit the control panel of AwoCoupon

    But it doesn't work well due to the following:
    If I install the latest version of AwoCoupon (awocoupon-4.0.1.1), the installation fails when updating the database with the following message: Unknown column 'session_id' in 'where clause'.

    If I install any of the previous versions of the 4.x branch, no error occurs, but when updating to 4.0.1.1, the error message "Unknown column 'session_id' in 'where clause'" reappears.

    Investigating the problem further, I see that my __awocoupon_history table does not have the session_id field, and reviewing the update files to version 3.6.1, I see the following line in the file /admin/awocoupon/library/install/upgrade/sql/3.6.1.sql:

    ALTER TABLE #__awocoupon_history DROP COLUMN session_id;

    It seems that the session_id field is removed in version 3.6.1; in fact, it is not in the mysql.install.sql file.


    I also see that in the update scripts for version 4.0.1.1, in the file admin/awocoupon/library/install/upgrade/sql/4.0.1.1.sql, the following SQL statement appears:

    INSERT INTO #__awocoupon_history_tmp (estore, order_id, details, created_at)
      SELECT estore, order_id, details, created_at
        FROM #__awocoupon_history
       WHERE session_id IS NOT NULL AND session_id!="" AND order_id IS NOT NULL AND order_id!=0;

    But the #__awocoupon_history table does not have any session_id field.


    Is it an error in the update files for version 3.6.1?
    How important is the content of the session_id field?
    How can I solve it?

    Best regards.
  • Your avatar
    seyi    
     5 months ago
    0

    Hello,

    So the same set of sql statements exist in 3.6.1 and 4.0.1.1 because both are still maintained and have to have all the updates.  So these are the steps you should follow in upgrading from 3.6.1 to 4.0.1.1:

    - backup all tables from awocoupon 3.x
    - uninstall awocoupon 3.x
    - install awocoupon 4.x
    - delete all awocoupon table
    - import all tables from awocoupon 3.x
    - go to /administrator/components/com_awocoupon/awocoupon/library/install/upgrade/sql/4.0.1.1.sql and empty or delete the file
    - visit awocoupon control panel which should run all the upgrades