Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

Modify Existing Database Table or Create New Table?

Aloittaja wixi, marraskuu 17, 2013, 01:44:39 IP

« edellinen - seuraava »

wixi

When making mods that change the behaviour of some core part of the forum, wherein changes to database table related to that feature is necessary for the mod, is it better to create a new table rather than modifying the existing one? The database changes may include adding / removing new fields and or modifying the data type or size of existing fields etc.

(This for SMF 2+ on MySQL 5+).

Arantor

Depends what you're doing, really.

More information about what you're doing will help us suggest what is probably best ;) Sometimes it will be better to modify columns, sometimes it won't, but it's hard to say without context.
Holder of controversial views, all of which my own.


wixi

Let me rephrase it this way since I can't give details - how do you ensure that your database change doesn't break another mod?

Arantor

Simple answer is that you actually can't. Not even by using separate tables can you be *sure*.

I also fail to see why you can't provide further details.
Holder of controversial views, all of which my own.


wixi

I'll play it "safer" and go with a new table.  On the no details part - didn't mean to be an ass, but my client doesn't want me to post ANY details of the mod project online in case someone "steals the idea". Makes my job that much harder ... Appreciate your inputs. Thanks.

Advertisement: