Make WordPress Core

Opened 6 years ago

Closed 5 years ago

#44856 closed enhancement (invalid)

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

Reported by: hamedmoodi's profile hamedmoodi Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Database Keywords:
Focuses: Cc:

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
6 years 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
6 years 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
6 years 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
6 years ago

  • Focuses performance removed

#5 @SergeyBiryukov
6 years ago

  • Component changed from Users to Database

#6 @pento
5 years 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.