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

xf_ table prefix

R

ragtek

Guest
#1
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
PHP:
    public function isApplicationTable($table)
    {
        return (substr($table, 0, 3) == '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?:)
 
F

Floris

Guest
#2
I think all ragtek addons should just create rag_ or alike prefixes ^_^ easier to remain unique.
 
R

ragtek

Guest
#3
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
 

James

Well-known member
#4
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.
 

Mike

XenForo developer
Staff member
#5
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.
 
R

ragtek

Guest
#6
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.
ok

thx for confirming:)