See if this helps:
https://github.com/splittingred/VisionCart/blob/master/_build/resolvers/postactions.dbchanges.php
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html
[ed. note: opengeek last edited this post 13 years, 11 months ago.]
-
☆ A M B ☆
- 160 Posts
Which parts Bob? because as far as I can tell from the code I am doing the exact same thing.
That's what it looked like to me, but I know that code works. The only difference I can see is the empty string ('') at the end and the attempt to add the id field.
Are you sure the table doesn't already have an id field?
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html
-
☆ A M B ☆
- 160 Posts
I checked in PHPMyAdmin and it definitely doesn't already have that field. If I run that query directly in PHPMyAdmin it executes without any issues.
-
☆ A M B ☆
- 3,141 Posts
Few small things come to mind that may help..
- use $modx->query instead of $modx->exec (they're mostly similar, but ya never know)
- use this:
$manager->addField('fmzFormsValidation','id');
$manager->addIndex('fmzFormsValidation','id');
as per
https://github.com/splittingred/Quip/blob/develop/_build/resolvers/dbchanges.resolver.php#L43
Honestly I'm not seeing anything that should prevent what you're doing from working.
When you run the installer, is it giving any error messages or notices? (perhaps lower the log level with setLogLevel)
I had same issue, code don't execute when install package.
Try replace $object->xpdo to $transport->xpdo. It's help for me.
-
☆ A M B ☆
- 160 Posts
Thanks evd, I have gone with Mark's suggestion and it seems to be working now. I changed exec to query.