Answers.Body: <p>I think the civi process works great for adding columns. Dropping columns is not done too often and hence the above error.</p>
  
  <p>I suspect the easiest work-around might be to empty out the civicrm_generated file:</p>
  
  <pre><code>echo '' &gt; civicrm_generated.mysql
  </code></pre>
  
  <p>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</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-09T02:50:11.017Z
Answers.LastActivityDate: 2015-06-09T02:50:11.017Z
Answers.UserDisplayName: Donald Lobo
Body: <p>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.</p>
  
  <p>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.</p>
  
  <pre><code>+ echo 'Populating database with dataset - civicrm_generated.mysql'
  Populating database with dataset - civicrm_generated.mysql
  + mysql -udrupalclea_vpj3r -XXXXXXXXXXXXX -h 127.0.0.1 -P 3306 drupalclea_vpj3r
  ERROR 1054 (42S22) at line 462: Unknown column 'enable_tracking' in 'field list'
  </code></pre>
  
  <p>One hack would be to manually edit the civicrm_generated.mysql file. Is there any other way? </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-08T21:36:01.430Z
Comments.Text: To clarify, you are working on a patch for CiviCRM core, and not an extension or customization?
Comments.UserDisplayName: Coleman
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-09T07:31:00.720Z
Comments.Text: Because if you are working on an extension or customization, adding columns to a civicm core table is not recommended practice :-)
Comments.UserDisplayName: ErikH - CiviCooP
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-09T15:51:09.550Z
Comments.Text: @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.
Comments.UserDisplayName: Vishal Agarwal
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-09T15:52:11.520Z
Comments.Text: @ErikH I was just experimenting, I have removed the column which I had added.
Comments.UserDisplayName: Vishal Agarwal
Tags: <civievent><database>
Title: Adding And Removing Fields To CiviCRM Tables
ThreadText: # Adding And Removing Fields To CiviCRM Tables
  
  (Asked by: username_0 on 2015-06-08)
  
  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 127.0.0.1 -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?
  
  **Tags:** civievent, database
  
  > **Comments:**
  > **username_1**: To clarify, you are working on a patch for CiviCRM core, and not an extension or customization?  
  > **username_2**: Because if you are working on an extension or customization, adding columns to a civicm core table is not recommended practice :-)  
  > **username_0**: @username_1 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.  
  > **username_0**: @ErikH I was just experimenting, I have removed the column which I had added.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2015-06-09. Score: 3 | Accepted answer
  
  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
  
  
  ---
  
  