How to manage database modifications ("ALTER TABLE")

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Hirschi
New Member
New Member
Posts: 6
Joined: Tue Nov 04, 2008 6:20 pm

How to manage database modifications ("ALTER TABLE")

Post by Hirschi »

Hi all,

I am developing a module which also uses databases.

During the development of the new subrelease, I noticed, that I want to add a database field to a table. So, how can I use the update-process of a module to insert a new database field?
I know, there is the default function "Install()" which can be used for creating tables (using ADODB), but is there also an "Update()"-function where I can use "ALTER TABLE" - commands?

br and thanks in advance
Michael
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: How to manage database modifications ("ALTER TABLE")

Post by calguy1000 »

Upgrade()

You have to look at lib/classes/class.module.inc.php
and I encourage you to look at other modules for reference
like News, Search, CompanyDirectory, Questions....
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Hirschi
New Member
New Member
Posts: 6
Joined: Tue Nov 04, 2008 6:20 pm

Re: How to manage database modifications ("ALTER TABLE")

Post by Hirschi »

I see, *thx*
Post Reply

Return to “Developers Discussion”