PDA

View Full Version : "dont need to be removed to upgrade" flag


Dream
07-10-2005, 05:40 PM
hey

with the new database/flags thing, would be nice to have a flag that says the difficulty the mod is to install and remove, or if you need to remove it at all when upgrading vbulletin. this is a major concern for me when browsing hacks, as just the thought of upgrading ubb from 5.4 to 5.5 and reinstalling all the hacks... >.<

kall
07-10-2005, 07:19 PM
A question: The current layout of the 3.5 forums is supposedly aimed at telling people which hacks change code (which would be replaced on upgrade) but...

How are we supposed to know whether or not a plugin that modifies the database will inadvertently add a column/table that is added in a future version of vBulletin?

Colin F
07-10-2005, 07:33 PM
How are we supposed to know whether or not a plugin that modifies the database will inadvertently add a column/table that is added in a future version of vBulletin?

That's kind of hard to say in advance, isn't it? :)

kall
07-10-2005, 07:41 PM
Well yeah, given that my crystal ball refuses to even tell me the release date of the next beta... ;)

Wayne Luke
07-10-2005, 09:49 PM
How are we supposed to know whether or not a plugin that modifies the database will inadvertently add a column/table that is added in a future version of vBulletin?

A good practice would be to prefix your added fields with a unique identifier.

Say your hack or plugin is called Foxchat for instance and you need to add 3 fields to the user table for it to work... They should be called:

foxchat_field1, foxchat_field2, foxchat_field3.

This would ensure that your field doesn't interfere with future fields. If a standard vBulletin field is implemented to do what you want, it would be your determinatation to migrate to that field and provide an import sequence for it. The same practice can be followed for adding tables.

amykhar
07-10-2005, 09:52 PM
That's a good idea, Wayne.

Dream
07-10-2005, 10:36 PM
so if I had a foxchat_blah column in my user table it wouldnt affect upgrading? what if the upgrade script drops and rebuilds the user table, it would erase unknown columns (the user table isnt the best example but you know what I mean)

Paul M
07-10-2005, 11:12 PM
I doubt a vb upgrade script would ever drop a table, in fact I would be 99.9% certain of it.

Dream
07-10-2005, 11:26 PM
"rebuild styles" in "update counters" has an option to drop the template table to renumber templateids from 1

Paul M
07-10-2005, 11:40 PM
Yes it does, but it's not an upgrade script, it's built in functionality (and it ought to copy all the fields it finds in the table, but I notice it doesn't). I can't think of any reason an upgrade would need to drop a table, alter it yes, perhaps even clear it, but drop it - no - even if fields are no longer used, they can be just ignored.

Chris M
07-11-2005, 03:20 PM
Yes it does, but it's not an upgrade script, it's built in functionality (and it ought to copy all the fields it finds in the table, but I notice it doesn't). I can't think of any reason an upgrade would need to drop a table, alter it yes, perhaps even clear it, but drop it - no - even if fields are no longer used, they can be just ignored.
The only time any data in the database which is not the original vB database structure will be dropped is if you select to Empty the database, but I think you can only do this via /install/install.php ;)

Satan

The Geek
07-11-2005, 03:25 PM
I cant ever see much of a reason to append fields to a vb table anyway. In fact, it really annoys me when I see macks that do this when its not needed.

The most common table modified is the user table. Why cant people just use profile fields? Thats essentially what its designed for. That or just include your own table that you can drw information from. Nothing worse than trying to uninstall a mod that has made changes to the underlying vb table structure.

Just my 2 yen (which of course comes to very little at the current exchange rate).

Paul M
07-12-2005, 12:19 AM
The most common table modified is the user table. Why cant people just use profile fields? Because it's not very easy. First they have useless names (field6, field7, field8 etc), and secondly there is no way to know what the next one will be on any installation, it could be field6 on one, and field12 on another.

Link14716
07-12-2005, 02:16 AM
That or just include your own table that you can drw information from.
I would rather modify a table "needlessly" when it is the best option. Using a profile field means that you have to find what field it is in, which requires either a setting or a needless datastore row to keep track of. Adding a brand new table means you either add a query needlessly, or you modify queries, which mean needless file edits.

Modifying the user table is much simpler than either of the two alternate methods you mention. Either way, a hack should include an uninstall script.

Colin F
07-12-2005, 03:40 AM
I would rather modify a table "needlessly" when it is the best option. Using a profile field means that you have to find what field it is in, which requires either a setting or a needless datastore row to keep track of. Adding a brand new table means you either add a query needlessly, or you modify queries, which mean needless file edits.

Modifying the user table is much simpler than either of the two alternate methods you mention. Either way, a hack should include an uninstall script.
With an install script it should be easy to fetch the last userfield used and increment that by one??

The Geek
07-12-2005, 06:24 AM
Or simply have the field be an option in the settings. I do this for GAL and GAB.

An extra table doesnt mean always mean an extra query - all that just depends on your design and (in the end) what youre trying to do.

Although there may be times where its unavoidable, far too many take the lazy way out and simpy append fields to the user table without exploring better and cleaner ways of accomplishing the same thing.

Revan
07-12-2005, 07:48 AM
An extra table doesnt mean always mean an extra query - all that just depends on your design and (in the end) what youre trying to do.Do tell me how I can create my own table, populate it with EVERY user, then fetch this info as easily as $vbulletin->userinfo WITHOUT any extra queries and WITHOUT file edits.
If you can't do this, then you are full of it :p

The Geek
07-12-2005, 08:46 AM
Um - Do it with the freaking profile fields thats what they were designed for. Sheesh.

Things would also be made much easier if they would allow hooks into the queries as I mentioned in this post (http://www.vbulletin.com/forum/showpost.php?p=884861&postcount=6). Then you could accomplish much more (though I am sure people will still rely on appending extra fields on the end of the user table as it was the easier thing to do).

Isnt hacking the Tables about the same thing as hacking the files?

Marco van Herwaarden
07-12-2005, 08:52 AM
Isnt hacking the Tables about the same thing as hacking the files?
Even worse if you do it wrong.

Chris M
07-12-2005, 09:42 AM
Um - Do it with the freaking profile fields thats what they were designed for. Sheesh.

Things would also be made much easier if they would allow hooks into the queries as I mentioned in this post (http://www.vbulletin.com/forum/showpost.php?p=884861&postcount=6). Then you could accomplish much more (though I am sure people will still rely on appending extra fields on the end of the user table as it was the easier thing to do).

Isnt hacking the Tables about the same thing as hacking the files?
If you alter any of the existing-default-not-touched vBulletin database structure, yes - If you add to it, no :)

Satan

Link14716
07-12-2005, 01:16 PM
Um - Do it with the freaking profile fields thats what they were designed for. Sheesh.
Only if you want it to be user editable with the profile. Otherwise, the user table is the correct table to modify.

The Geek
07-12-2005, 01:46 PM
Well, we shall have to agree to disagree. The user profile fields are not just for editable fields - they are for custom user table fields. Otherwise they would just simply append the user table whenever an extra field was required.

Me? I prefer to avoid using any of vbs tables if I can help it which so far has been every time. For those options that would require an optional field, I use the profile fields for the job and it works just fine.

When I hear the purists that shout 'dont mod the file' and happily alter the tables... I have to pleasently chuckle.

Chris M
07-12-2005, 02:32 PM
Well, we shall have to agree to disagree. The user profile fields are not just for editable fields - they are for custom user table fields. Otherwise they would just simply append the user table whenever an extra field was required.

Me? I prefer to avoid using any of vbs tables if I can help it which so far has been every time. For those options that would require an optional field, I use the profile fields for the job and it works just fine.

When I hear the purists that shout 'dont mod the file' and happily alter the tables... I have to pleasently chuckle.
Remember though, that adding to the table structure does not invalidate support - Altering existing vBulletin files does ;)

In this respect, their attitude makes more sense :p

Satan

Wayne Luke
07-12-2005, 04:07 PM
An extra table doesnt mean always mean an extra query - all that just depends on your design and (in the end) what youre trying to do.

At the very least it will require one or more joins, otherwise you wouldn't be storing the data. Joins can and often are as resource intensive as additional queries, especially if the table is not fully optimized and in sync with the table you are joining it to.

Dream
07-12-2005, 04:17 PM
Yes it does, but it's not an upgrade script, it's built in functionality

it may not count for the upgrade discussion, but it counts for the database changes discussion

Remember though, that adding to the table structure does not invalidate support - Altering existing vBulletin files does ;)

it doesnt? where can I find that info

Wayne Luke
07-12-2005, 04:27 PM
it doesnt? where can I find that info

https://vborg.vbsupport.ru/showthread.php?t=91582

In particular this post by me:
https://vborg.vbsupport.ru/showpost.php?p=730419&postcount=25

and here on the vBulletin.com forum:
http://www.vbulletin.com/forum/showthread.php?t=145472

However if you alter an existing vBulletin field, or add your own field that happens to conflict with a future vBulletin field you will be told to revert your database first.

Xenon
07-12-2005, 04:27 PM
well that's not general.

if you change original tables, the supportteam will ask you to revert them, exactly as they do with templates, or when they ask you to upload an original file again..

Xenon
07-12-2005, 04:28 PM
bahh, i get too slow....

Dream
07-12-2005, 04:52 PM
In particular this post by me:
https://vborg.vbsupport.ru/showpost.php?p=730419&postcount=25
...

alright, so by "adding to the database" you mean adding tables or adding columns to a vB table?

Wayne Luke
07-12-2005, 05:33 PM
alright, so by "adding to the database" you mean adding tables or adding columns to a vB table?
Yes.