1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

xf_ table prefix

Discussion in 'XenForo Development Discussions' started by ragtek, Sep 2, 2011.

  1. ragtek

    ragtek Guest

    Is the xf_ table prefix reserved for xenforo?

    I'm working on my db generator and i've found the isApplicationTable method in the install model
        public function isApplicationTable($table)
            return (
    substr($table03) == 'xf_');
    That's only used for the table deletion while the installation, right?
    So if i have a add-on, which added a table xf_foobar, the table will be deleted too, if it's not having the xf_ prefix it won't be deleted.

    Isn't it better to use then xf_ also for add-ons to be sure that the tables will be deleted too?
    What's the official response here?:)
  2. Floris

    Floris Guest

    I think all ragtek addons should just create rag_ or alike prefixes ^_^ easier to remain unique.
  3. ragtek

    ragtek Guest

    I'm ussing ragtek_ prefix, BUT the tables won't be deleted on an xf install
    that's why i asked this:D

    So i think that i'll switch to xf_ragtek_xxxx
  4. James

    James Well-Known Member

    If they wanted to delete all tables on the installation, they'd just drop all of the tables from the database. Instead, it seems they've created a function to only drop the xf-related tables, so they mustn't want add-ons to be deleted during (re-)installation.
  5. Mike

    Mike XenForo Developer Staff Member

    xf_ is just a prefix to allow it to distinguish from other applications that might be installed in the database. I would recommend that add-ons use the xf_ prefix in addition to their own. It does make the table name a bit longer but it groups with all of the XF tables then (while still grouping the add-on tables) and, as mentioned, allows deletion on a reinstall.
    James likes this.
  6. ragtek

    ragtek Guest


    thx for confirming:)

Share This Page