Make WordPress Core

Opened 6 years ago

Closed 5 years ago

#21500 closed defect (bug) (wontfix)

clarify what wp_db_version increments to

Reported by: eternalsword Owned by:
Milestone: Priority: normal
Severity: trivial Version:
Component: Database Keywords: has-patch
Focuses: Cc:


I think this was meant to be wp_version that changed not wp_db_version. Either that or the description comment needs to be changed because this changeset didn't affect the schema.


Attachments (1)

21500.patch (484 bytes) - added by SergeyBiryukov 6 years ago.

Download all attachments as: .zip

Change History (9)

#1 @eternalsword
6 years ago

Or perhaps it does affect the schema, but why the big jump instead of incrementing? Perhaps comment should instead say that the wp_db_version is equal to the revision at which the schema changes.

The reason I bring this up is because I'm writing a patch and am not finding documentation on schema changes.

#2 @SergeyBiryukov
6 years ago

In [20596], wp-register.php was added to rewrite rules so that a canonical redirect could be performed.

$wp_db_version was bumped to flush rewrite rules:

#3 @eternalsword
6 years ago

  • Summary changed from inadvertent wp_db_version bump? to clarify what wp_db_version increments to

Okay, was still unclear from the comment in the code what $wp_db_version should be incremented to. By default, I think of increment to be plus one unless otherwise specified. Changing the summary to match.

#4 @SergeyBiryukov
6 years ago

  • Keywords has-patch added

Would "increases" be better?

There's also some clarification in Codex:

#5 @eternalsword
6 years ago

Increases is slightly better than increments, but even from the codex, it is still unclear what the new value should be set to when it needs changed. If I'm reading the changeset mentioned correctly, the new value should be set to the revision number of the change. In other words the current svn revision of trunk plus one. I believe the comment should note this. That would additionally make it clear if version control systems change that wp_db_version is something that will need to be addressed.

#6 @nacin
6 years ago

"Increment" does not necessarily mean by one.

Not sure if there is a need for the comments to reflect this. The core handbook includes a whole section on this: http://make.wordpress.org/core/handbook/the-wordpress-codebase/#database-upgrades. And we can add an entry to the glossary there as well.

#7 @eternalsword
6 years ago

Thank you nacin, that was what I was looking for. I just didn't know where to find it. I completely missed that section in the side of the handbook. Definitely clearer than what's in the codex.

I see the Submitting a Patch is listed as one of the pages that needs work. I believe there should be an additional section under "requirements for patches" that details what's needed for database changes.

And I do realize that increment does not necessarily mean by one, but without knowing by what means to increment, the tendency is to increment by one. At least I think that way. Probably due to the increment operator ++.

#8 @SergeyBiryukov
5 years ago

  • Component changed from General to Database
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.