I had earlier added a new field to the civicrm_event table called "enable_tracking". I achieved this by adding a new field to the xml/schema/Event/Event.xml file. After this I ran the regen.sh script. Everything worked fine.

Now I wanted to remove this field from the civicrm_event table, so I removed the field from the Event.xml file and ran regen.sh again. However I am getting an error when running this script.

+ echo 'Populating database with dataset - civicrm_generated.mysql'
Populating database with dataset - civicrm_generated.mysql
+ mysql -udrupalclea_vpj3r -XXXXXXXXXXXXX -h -P 3306 drupalclea_vpj3r
ERROR 1054 (42S22) at line 462: Unknown column 'enable_tracking' in 'field list'

One hack would be to manually edit the civicrm_generated.mysql file. Is there any other way?

  • To clarify, you are working on a patch for CiviCRM core, and not an extension or customization?
    – Coleman
    Jun 8 '15 at 21:36
  • Because if you are working on an extension or customization, adding columns to a civicm core table is not recommended practice :-) Jun 9 '15 at 7:31
  • @Coleman I am working on an extension. Since it is in an initial phase I am currently making changes directly to core, later I will write code for it as an extension. Jun 9 '15 at 15:51
  • @ErikH I was just experimenting, I have removed the column which I had added. Jun 9 '15 at 15:52

I think the civi process works great for adding columns. Dropping columns is not done too often and hence the above error.

I suspect the easiest work-around might be to empty out the civicrm_generated file:

echo '' > civicrm_generated.mysql

and then run regen.sh (this basically makes setup.sh load an empty file, and hence avoid the error). Maybe this should be part of the regen.sh script

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.