Skip to content

CrazyShop: generic table names collide with SelfMute in a shared database #63

Closed

Description

@Rushaway

Problem

CrazyShop saves credits and items in two tables with generic names, clients_data and shop_items_data (CrazyShop.sp:197-198). SelfMute also creates a clients_data table, with other columns (mute_type, mute_duration) (SelfMute.sp:1427 for MySQL, SelfMute.sp:1460 for SQLite).

When both plugins use the same database (the same MySQL database, or the same SQLite file), the plugin that starts second runs CREATE TABLE IF NOT EXISTS against the other plugin's table, so it creates nothing and reports no error. All of its queries then fail ("Unknown column 'credits'" on MySQL, "no such column: credits" on SQLite). Nothing is saved, and the only sign is an error in the logs.

#62 adds MySQL to CrazyShop, where a single database shared by several plugins is a common setup. For now its README asks for a dedicated database, which only works around the problem.

Proposal

Give the tables names that belong to the mode, for example fm_crazyshop_credits and fm_crazyshop_items. Existing SQLite data would be moved on start with ALTER TABLE ... RENAME TO, which works on both drivers. The rename should only run when the old clients_data table has a credits column, so a SelfMute table is never renamed.

@Dolly132, you wrote CrazyShop and SelfMute: are you fine with these names and this migration, or would you rather keep the current names on SQLite and prefix them only on MySQL?

Activity

  1. Dolly132 commented on Nov 4, 2026

    @Dolly132
    Contributor

    Adding mysql support is good in my opinion, and it was planned but I totally forgot about it.
    I am aware of the shared names of the tables between Selfmute and Crazyshop, therefore I am with changing the names of the tables on crazyshop mode to something else with a prefix like what you suggested for example.
    You can make a new PR for this or simply just edit the mysql PR and change the macros for the tables names

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions