Hello, I have thousands of nodes of a content type, I need to change the field type from integer to decimal. I did this
Opened the sql console and wrote this sql lines:
Use the MySQL alter statment to alter the field's datatype:
ALTER TABLE field_data_field_myfield MODIFY field_myfield_value decimal(10,2) ;
Change the field definitions in Drupal:
UPDATE field_config SET type = 'number_decimal' WHERE field_name = 'field_myfield';
Then Im getting these php notices everywhere:
Notice: Undefined index: precision in number_field_schema() (line 35 of /home/servilla/public_html/servillantasgiraldo.com.co/modules/field/modules/number/number.install).
Notice: Undefined index: scale in number_field_schema() (line 36 of /home/servilla/public_html/servillantasgiraldo.com.co/modules/field/modules/number/number.install).
What did I do wrong?
Comments
Look, I revert changes, then
Look, I revert changes, then I tried to update the field through a custom module like this.
But I see the same notices...
Found the solution
This is the final solution. Put this code in a custom module