Make WordPress Core

Opened 12 years ago

Closed 11 years ago

#21500 closed defect (bug) (wontfix)

clarify what wp_db_version increments to

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

Description

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.

http://core.trac.wordpress.org/changeset?reponame=&new=20596%40trunk&old=20595%40trunk

Attachments (1)

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

Download all attachments as: .zip

Change History (9)

#1 @eternalsword
12 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
12 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:
http://core.trac.wordpress.org/browser/tags/3.4.1/wp-admin/admin.php#L32

#3 @eternalsword
12 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
12 years ago

  • Keywords has-patch added

Would "increases" be better?

There's also some clarification in Codex:
http://codex.wordpress.org/Glossary#Database_version

#5 @eternalsword
12 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
12 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
12 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
11 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.