CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • what does it take to change the column/table names in the db for custom fields
Pages: [1]

Author Topic: what does it take to change the column/table names in the db for custom fields  (Read 539 times)

questions

  • I post occasionally
  • **
  • Posts: 79
  • Karma: 2
  • CiviCRM version: 4.4.6
  • CMS version: Durpal, 7
  • MySQL version: 5.1
  • PHP version: 5.3
what does it take to change the column/table names in the db for custom fields
September 28, 2012, 06:55:48 pm
When you create a custom field, the field label you use ends up being the column name (well plus some, to me, pointless number) in the table in the db.   I stupidly didn't realize this until I had created a bunch of ones with really long labels that ended up being really long column names - a real pain if one is writing sql directly against the db.

If you go back and change the field label after you have created it doesn't alter the column name.  Question, what does it take to change the column name?  If I change the column name in the database custom table and then change it in the civicrm_custom_fields is that all I need to do.

Similarly, if I want to change the custom table name, do I just need to change the table name in the db and the name in civicrm_custom_group?

Thanks

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: what does it take to change the column/table names in the db for custom fields
September 29, 2012, 07:22:39 am

also truncate your civicrm cache

would be good to allow the user ability to set a different name instead of civi generating one. Drupal does this in a fairly nice manner. Would help if you can take a look and add the functionality to the civi code base

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: what does it take to change the column/table names in the db for custom fields
September 29, 2012, 06:11:42 pm
Quote from: questions on September 28, 2012, 06:55:48 pm
Similarly, if I want to change the custom table name, do I just need to change the table name in the db and the name in civicrm_custom_group?

Yes, that should work.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • what does it take to change the column/table names in the db for custom fields

This forum was archived on 2017-11-26.