Large IDs cause SQL errors

Created on 27 January 2023, over 2 years ago

Problem/Motivation

When using the gh_jobs_migrate sub-module, I get errors like this:

[error]  Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'field_gh_id_value' at row 1: INSERT INTO "taxonomy_term__field_gh_id" ("entity_id", "revision_id", "bundle", "delta", "langcode", "field_gh_id_value") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array
(
    [:db_insert_placeholder_0] => 25
    [:db_insert_placeholder_1] => 25
    [:db_insert_placeholder_2] => gh_offices
    [:db_insert_placeholder_3] => 0
    [:db_insert_placeholder_4] => en
    [:db_insert_placeholder_5] => 4011286002
)
 in Drupal\Core\Entity\Sql\SqlContentEntityStorage->saveToDedicatedTables() (line 1393 of /var/www/html/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php). 

It looks as though the IDs used by Greenhouse are now too big for an integer field in the database.

Steps to reproduce

Install the sub-module and run cron jobs. Or drush mim gh_jobs_nodes.

Proposed resolution

Use a plain text field instead of an int field to store the IDs.

Remaining tasks

User interface changes

API changes

Data model changes

The map tables created by the Migrate API will be incompatible before and after this change.

Any nodes or taxonomy terms imported using the previous version of the module will have to update to use text fields instead of integer fields.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024