Advertisement:

Author Topic: Package manager updates do not update SMF version in database?  (Read 3841 times)

Offline phantomm

  • Sophist Member
  • *****
  • Posts: 1,064
  • Gender: Male
    • pages/smfpl/171860759503032 on Facebook
    • Polish ElkArte community
Package manager updates do not update SMF version in database?
« on: February 25, 2013, 12:39:52 PM »
Why updates installed using package manager do not update SMF version in database?

I'm just curious ::)
Polskie wsparcie SMF na simplemachines.org

My mods

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,430
    • StoryBB/StoryBB on GitHub
Re: Package manager updates do not update SMF version in database?
« Reply #1 on: February 25, 2013, 12:43:25 PM »
Because there's no code in them to do so, simple as that.

The updates in the package manager are literally the same as mods. They are built using the same facilities as mods.

They would need to add a couple of lines to the installer to also update the DB, which is difficult to do in a mod package, though the <code> tag run inline would certainly do the trick (except for manual installation users)
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

MrPhil

  • Guest
Re: Package manager updates do not update SMF version in database?
« Reply #2 on: February 25, 2013, 02:21:27 PM »
If we keep the current numbering system, the SMF version certainly should be updated as part of any upgrade, regardless of whether the database is changed or not. (I assume you're talking about the smfVersion entry in the settings.) It's very frequent that someone posts that they have an out of date database (because some error message told them so), when actually the database is fine (yes, the smfVersion is back level, but the database schema itself hasn't changed in eons). Nevertheless, that ominous error message scares a lot of people and should not show up unless the database schema is really not matching the file code.

It would not be difficult to have some place in the files that states the specific database version needed (and smfVersion could then even be decoupled from the SMF version, if desired). Say, $requiredSmfDatabase = '2.0.0'; and smfVersion is left at 2.0.0 until some new SMF version that requires a DB change. During an error message, if smfVersion != $requiredSmfDatabase, you get the scary "database may need an upgrade". Otherwise, that part of the error message is omitted. People are no longer unnecessarily upset and concerned that they may need to update their database. Much wasted energy and commotion is avoided.

I'm not holding my breath.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,430
    • StoryBB/StoryBB on GitHub
Re: Package manager updates do not update SMF version in database?
« Reply #3 on: February 25, 2013, 02:26:38 PM »
Quote
I assume you're talking about the smfVersion entry in the settings

Yes.

Quote
yes, the smfVersion is back level, but the database schema itself hasn't changed in eons

Not quite.

SMF 1.1.x had a schema change in 1.1.9 (2009), SMF 2.0 had a schema change in 2.0 RC4 (2010).

The patch upgrade for 1.1.9 did actually contain code to update the relevant variable. Not sure about the main upgrader code.

Quote
People are no longer unnecessarily upset and concerned that they may need to update their database

You could actually just drop that check entirely and it would improve things immensely (since the error itself should indicate if a schema change was actually needed)
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.