WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#29364 closed feature request (wontfix)

More logical table names for networks

Reported by: igmoweb Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.9.2
Component: Database Keywords:
Focuses: multisite Cc:

Description

I don't know if this will get something here or if I'm asking too much but I believe that for the sake of logic, main WP tables should be called wp_1_*. It doesn't make sense that network tables have the same prefix than the site with ID = 1.

There are several plugins around that tries to clone or copy subsites. Their main problem is that if they copy the site ID = 1, they will copy all network tables. That can produce a huge amount of data.

But apart from those specifical problems, at least for me, the problem is the logic.

Let's see another approach. Would it be crazy to rename tables in a single install to be wp_1_*? I know it's a little weird but the network installation would not need to rename them and you still can return to single site without any problems.

Anyone want to discuss? Anyone want to close this?

Thanks.

Change History (3)

#1 @SergeyBiryukov
6 years ago

  • Summary changed from Tables more logicall names for networks to More logical table names for networks

#2 @pento
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

We can't do this for a few reasons:

  • The vast majority of WordPress sites are single site installs, so we'd be increasing the complexity of the table names for most sites, without any real benefit for them.
  • There are many plugins that assume the table prefix is wp_. While this is incorrect of them, we don't want to push out an update that will intentionally break them, if we don't need to.
  • Instead of trying to figure out the table prefix, plugins can use wpdb::get_blog_prefix(), so they don't need to figure out what the correct prefix is.

You mentioned some plugins that copied all network tables when cloning site ID = 1, do you have an example of that? It may be that the plugins can be optimised to skip the network tables, which are defined in wpdb::$ms_global_tables.

Thanks for taking the time to make this suggestion, we're always happy to discuss ideas, even if they're not necessarily something we're able to do! :-)

#3 @igmoweb
6 years ago

Thanks for the quick answer.

I understand, just let me explain something.

  • The variable wpdb::$ms_global_tables only includes those tables that are native in WP (most usually). I haven't seen any plugin that includes their network tables in that variable. I think it would be a good idea to make developers to include their network tables in that variable. Maybe a mention here http://codex.wordpress.org/Creating_Tables_with_Plugins would be good to start.

Thanks!

Note: See TracTickets for help on using tickets.