Skip to content

Fix negative default value on models entities_id column - #645

Open
Herafia wants to merge 3 commits into
mainfrom
fix/entities-id-negative-default
Open

Fix negative default value on models entities_id column#645
Herafia wants to merge 3 commits into
mainfrom
fix/entities-id-negative-default

Conversation

@Herafia

@Herafia Herafia commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

  • It fixes !45445
  • Databases upgraded from old datainjection schemas kept a -1 default on
    glpi_plugin_datainjection_models.entities_id, which blocked GLPI 11's
    migration:unsigned_keys. Adds a migration resetting the column default to 0
    (and fixing any remaining -1 rows).

@Herafia Herafia self-assigned this Jul 27, 2026
@Herafia
Herafia requested a review from Rom1-B July 27, 2026 09:36
Comment thread hook.php Outdated
Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com>
@Herafia
Herafia requested a review from Rom1-B July 28, 2026 07:37
Comment thread hook.php
$migration->executeMigration();
}

function plugin_datainjection_migration_2158_2159(Migration $migration)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The redundant migrationOneTable() call was removed (per the requested suggestion), but the core fix was not applied: the legacy-data cleanup is still queued with addPostQuery() instead of addPreQuery(). Migration::executeMigration() still processes the changeField()-registered ALTER TABLE before running POST_QUERY entries, so the UPDATE clearing -1 rows still runs after the column is converted to unsigned, and the ordering bug the finding described remains unresolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants