1

I have a integer field in a custom content type, first we did't estimate that we have a data more than 2 147 483 647(max integer number_ , but I have some data that bigger than max integer range, we input very data to that field and it not logic that install bigint module then remove integer field and create a bigint instead of it ( all of our data will lost), I know I can change table in mysql database by myself,but maybe in future needs update drupal to newer version , what is your suggestion to me ?

3

Use the bigint module.

The default core fields do not include a bigint field. This module allows you to have a true BigInt (19) value. That means the number can contain 19 digits.

So, with this module you can define fields with the appropiate range.

Your problem now is to migrate data from your current field to a new bigint created field.

The usual steps will be:

  • Create and configure the new bigint field.
  • Edit affected nodes copying data form old int field to the new bigint field (using Batch API, for example). Or using a direct SQL commands, if your are brave enough.
  • Update related configuration to use the new field (for example, Views).
  • Delete de old field.

Depending on your usual workflow you can do this by different means:

  • Manually, closing the web during update.
  • Using Features for the configuration (fields, Views, etc).
  • Update script (for example, a hook_update_N if you are using a installation profile).

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.