WordPress.org

Make WordPress Core

Opened 16 months ago

Closed 5 months ago

#44856 closed enhancement (invalid)

does remove database column(field) in each update core?

Reported by: hamedmoodi Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Database Keywords:
Focuses: Cc:
PR Number:

Description

Hi
My data in user table in database is huge and i want to add some column to wp_users table for light query such as birthday, sex and so on.
Is posible in wordpress update remove this fields and data in future?
Sorry, i do not know where i should this type of quetions and set category to "enhancement"
Thanks

Change History (6)

#1 @mukesh27
16 months ago

  • Component changed from General to Users
  • Focuses performance added
  • Keywords close added

You can please use user meta to store user meta data and WordPress upgrade does not change any meta data values when we update it's latest version.

#2 @hamedmoodi
16 months ago

Ok thanks
You said does not remove user "meta".
I want to know does it remove Extra field for users table or post table in database?
Thanks again

#3 @mukesh27
16 months ago

Adding a column to wp_posts and wp_users will probably not cause a problem for small upgrades but may cause problems for the WP upgrade with DB upgrade but probably would remove your column! I believe it would remove the additional column from tables.

#4 @mukesh27
16 months ago

  • Focuses performance removed

#5 @SergeyBiryukov
15 months ago

  • Component changed from Users to Database

#6 @pento
5 months ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

You can certainly add custom columns to your table: WordPress won't remove columns when upgrading. It'd be a good idea to prefix your column names with something unique (eg, myplugin_birthday, rather than just birthday), so that it doesn't clash with WordPress Core in the future.

Note: See TracTickets for help on using tickets.