Skip to content

Migration 1.9.991 finishes with errors: unknown column post_id  #334

@jmslbam

Description

@jmslbam

Just a FYI:

include('/plugins/koko-analytics/migrations/1.9.991-prepare-post-stats-table.php')
[06-Jan-2026 10:23:15 UTC] WordPress database error Unknown column 'post_id' in 'SELECT' for query SELECT COUNT(DISTINCT(post_id)) FROM wp_koko_analytics_post_stats WHERE post_id IS NOT NULL AND path_id IS NULL made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('/www/xyz/public/web/wp-config.php'), require_once('wp-settings.php'), do_action('wp_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, KokoAnalytics\{closure}, KokoAnalytics\Migrations->maybe_run, KokoAnalytics\Migrations->run, KokoAnalytics\Migrations->handle_file, include('/plugins/koko-analytics/migrations/1.9.991-prepare-post-stats-table.php')

So I deployed an project via composer and it threw this "error".
So I disabled and enabled the koko plugin to trigger the migration check, which solved it.

Xoxo

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions