Installation


Upgrades


DTC-Xen Installation


DTC-Xen / Dom0 Howtos

DTC-Xen / DomU Howtos

FAQ


DTC Howtos


Manuals


Features


Roadmap


Devel docs


Wiki - i18n


Wiki - Meta


Dev /

Adding a field to a SQL table

It's often needed to add a field, so DTC comes with a tool to do SQL upgrades from past versions at each upgrade.

At setup or upgrade, DTC will maintain your database, and you wont have to care much about it. If you need to add a field in an already existing table, you just need to add it in admin/dtc_db.php so the installer can do SQL upgrades on each installation (upgrades from previous version of the panel). admin/dtc_db.php is used by the installer to check for each field presence of it's content against the already installed database. If fields are not in the database, then the fields will be added to the tables using an ALTER TABLE sql statement generated automatically.

If you want, you can change a field type as well, and DTC will make the necessary ALTER statements as well if needed. Make sure that you respect the syntax of dtc_db.php up to the spaces, because otherwise, restore_db.php will see it as different and will try to do an ALTER. In general, just do install twice DTC to make sure that you don't see some ALTER statements printed when you run the install script.

Page last modified on March 08, 2011, at 02:25 PM EST