Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By kk-mini-pw on
Hi All,
I have drupal 6 working for a long time already. Database filled with hundreds of records. I use CCK fields for custom content. Now I've got a problem. I realized that I need to change type of one of the fields from integer to float. However I cannot do this via normal content type interface. Is there any way to do this?
I am already convinced to play with the drupal content database... but any clues where to start, what to do and if it is possible would be very helpful.
Thanks in advance for any ideas,
Krzysztof
Comments
I changed my filed record in
I changed my filed record in content_node_field table, changed column type in content_type_mynodetype, resaved filed settings and it works for me
I did just that but when
I did just that but when crating new node i get
Fatal error: Class 'views_handler_filter_float' not found in C:\wamp\www\oglasnik\sites\all\modules\cck\includes\views\handlers\content_handler_filter_float.inc on line 9
array(4) { ["type"]=> int(1) ["message"]=> string(44) "Class 'views_handler_filter_float' not found" ["file"]=> string(99) "C:\wamp\www\oglasnik\sites\all\modules\cck\includes\views\handlers\content_handler_filter_float.inc" ["line"]=> int(9) } n/a
any ideas why? What else needs to be changeD?
Adriadrop Drupal development
Did you get it to
Did you get it to functioning? I'm going to change from text to integer and want to know if this is the way to do it please?
No had problems with that as
No had problems with that as my drupal installation is very complex, fortunately client gave up on this so i didnt have to do it afterall.
Adriadrop Drupal development
I found this explanation
I found this explanation http://drupal.org/node/643646 which maybe can help someone. Haven't tried it myself. :-)
You also need to change the
You also need to change the column 'type' in the 'content_node_field' table to 'number_float'
José Fernandes
Bloomidea
For future reference and
For future reference and maybe to help out someone else here's how I converted an integer field to a float field:
UPDATE content_type_<your content type> SET field_<new fieldname>_value = field_<old fieldname>_value
I think better way to do
I think better way to do this
* First create another field with your content type
* Copy all the data of first field to newly created field as
update content_type_ SET new_Field = old_Field
* This will copy all the data to new field and now delete the old_field form content type.
* Again create the field in your content_type with new data type and use the above query again but revert the field name.
Just for reference... the sql
Just for reference... the sql should be something like:
update content_type_contenttypehere SET new_Field_value = old_Field_value
Note: you need the _value after the field names.
Thanks
It has worked for me, thanks :)