• Resolved reinispro

    (@reinispro)


    Hello again Antoine,

    I wanted to make matches for the upcoming games and when I went to teams menu it was empty. Did not think much of it as there are not a lot of teams, so I wanted to create them from a scrach. When I tried, I could not as after saving nothing showed in the table.

    I turned on de-bugging and got this error:

    WordPress database error: [Unknown column ‘t.is_favorite’ in ‘field list’]
    SELECT t.id, t.name, t.photo, t.flag, t.link, g.id AS group_id, g.name as group_name, t.is_real, t.is_active, t.is_favorite, t.group_order, t.comments FROM pool_wp_teams t LEFT OUTER JOIN pool_wp_groups g ON t.group_id = g.id ORDER BY t.name ASC

    I suspect there might be some problem that after upgrading to newest version plugin did not create the necessary field. As my current table in DB looks like this:

    https://ibb.co/z8M58QN

    Is it possible to just add the necessary field without braking the DB or it has to be made from scratch?

    EDIT#1 DB table indeed have all the team data, it just cannot display in site because of this error.

    • This topic was modified 1 year, 12 months ago by reinispro.
    • This topic was modified 1 year, 12 months ago by reinispro.
    • This topic was modified 1 year, 12 months ago by reinispro.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author AntoineH

    (@antoineh)

    You can run the DB update script for v2.11.0 again to fix this problem:

    CREATE TABLE IF NOT EXISTS pool_wp_predictions_audit_log (
      log_date DATETIME NOT NULL ,
      user_id INT UNSIGNED NOT NULL ,
      type TINYINT UNSIGNED NOT NULL ,
      source_id INT UNSIGNED NOT NULL ,
      result_code TINYINT UNSIGNED NOT NULL ,
      log_value VARCHAR(200) NOT NULL ,
      INDEX ix_log_date (log_date),
      INDEX ix_user_id (user_id),
      INDEX ix_source_id (source_id)
    ) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
    
    ALTER TABLE pool_wp_teams ADD is_favorite TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER is_active;
    
    Thread Starter reinispro

    (@reinispro)

    Thank you, it worked!

    How/where do you run the database script?

    Plugin Author AntoineH

    (@antoineh)

    @robb1e you can run the script in a database tool. A lot of hosters provide you with a phpMyAdmin interface, but it can also be something else.

    I just got paste in the SQL bit and ‘run’ it?

    Plugin Author AntoineH

    (@antoineh)

    Yes, but first please check if your table names for the plugin start with the “pool_wp_” prefix. If not, then you’ll need to change the script by replacing the prefix with your own.

    And please create a database backup if you’re doing changes to your database! Better safe than sorry. If you don’t know how, then ask your hoster for help.

    thanks for the info. I’ll give it a go. The fact I currently run a live sports website with live results, leagues and fixtures mid season is making me sweat lol.

    Antoine I did what was required but i now get this warning:

    WordPress database error: [Unknown column ‘question_order’ in ‘order clause’]
    SELECT id, match_id FROM pool_wp_bonusquestions WHERE match_id > 0 ORDER BY match_id ASC, question_order ASC, answer_before_date ASC

    Plugin Author AntoineH

    (@antoineh)

    Seems like your upgrade path was a bit ‘longer’ and you’re not only missing the version 2.11 database upgrades. Because the question_order column was introduced in version 2.9.0.

    I suggest you also run the following scripts:

    v2.9.0
    v2.9.3
    v2.10.0 *)

    And perhaps even the v2.8.0 one**):

    v2.8.0

    *) After running all database scripts, you’ll have to start a calculation to create a ranking.

    **) Please note that some of the statements may result in a warning because it tries to remove an index that does not exist or to add one that already exists. You can ignore those warnings. They are in those cases an indication that this particular update was already succesfull

    i haven’t even had the chance to use it yet as my install was directly from my wordpress add new plugin section. Downloaded 1 or 2 days ago to try.

    does every new user have to go through this to get it to work?

    Plugin Author AntoineH

    (@antoineh)

    No, this is highly unusual. But probably you’ve tried the plugin before in the past (some years ago) that left the tables behind in the database. Because the plugin will not install with only one column missing. That is impossible.

    It is a lot easier (and safer) to just deactivate the plugin (make sure you first uncheck the option on the plugin options page that says to “keep data on uninstall”). That will remove all custom tables for my plugin from your database. And then activate the plugin again to start with a 100% clean install.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Database problems’ is closed to new replies.