Skip to content

Stream DB tables cannot be trusted to exist #128

Closed
@kadamwhite

Description

@kadamwhite

The Stream plugin only creates its tables on activation, and the way it is used in this project, that step will never necessarily be hit. This means that (especially in local environments) you can end up in a situation where you have no DB tables for stream, and your errors are littered with warnings about it.

Steps to reproduce:

  1. composer server cli -- db clean and reinstall your local install, or import a database
  2. Observe that you begin to see errors like this in your logs:
WordPress database error Table 'wordpress.wp_stream' doesn't exist

I would expect to see no errors of this type, because I would expect the Altis Security module to orchestrate ensuring the tables are present if they did not previously exist.

As a stopgap for now, you can manually recreate these tables by invoking the stream plugin activation directly:

wp_stream_get_instance()->install->check();

Acceptance criteria:

  • Stream tables are created if not present, especially in local environments, with no interaction from the developer

Shout-out to @tomjn for figuring this one out, this issue documents discussion we just had in Slack. Tom has opened a related issue on the upstream Stream repo (two of them, actually), but this is something we could fix at this level, too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugExisting functionality isn't behaving as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions