Created
October 13, 2012 09:30
-
-
Save silentworks/3883950 to your computer and use it in GitHub Desktop.
Formz ALTER table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Formz | |
* | |
* Resolve changes to db model | |
* | |
* @package Formz | |
* @subpackage build | |
*/ | |
if ($object->xpdo) { | |
switch ($options[xPDOTransport::PACKAGE_ACTION]) { | |
case xPDOTransport::ACTION_INSTALL: | |
case xPDOTransport::ACTION_UPGRADE: | |
$modx =& $object->xpdo; | |
$modelPath = $modx->getOption('formz.core_path',null,$modx->getOption('core_path').'components/formz/').'model/'; | |
$modx->addPackage('formz',$modelPath); | |
$formzValidation = $modx->getTableName('fmzFormsValidation'); | |
$sql = "ALTER TABLE {$formzValidation} ADD `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`id`)"; | |
$modx->exec($sql); | |
break; | |
} | |
} | |
return true; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment