fix(dynamic): widen metacore_addon_migrations.version to varchar(40) -> varchar(100) - #282
Merged
Merged
Conversation
Was varchar(40) — tight enough that a normal descriptive migration filename (pos@017_sale_payment_organization_id_tenant_schema, 49 chars) blew past it and aborted the whole addon upgrade with SQLSTATE 22001 before running any SQL (asteby-hq/addons#930). AutoMigrate widens the column on existing installs, no manual step needed. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Por qué
varchar(40)para el nombre de una migración es poco: un filename descriptivo normal (pos@017_sale_payment_organization_id_tenant_schema, 49 chars) lo supera, y el upgrade completo del addon aborta conSQLSTATE 22001 (value too long for type character varying(40))antes de correr una sola línea de SQL. Encontrado en producción hoy (asteby-hq/addons#930) — trabajamos alrededor acortando los nombres, pero el límite en sí sigue siendo la causa raíz: cualquier fix futuro con un nombre descriptivo puede volver a pisarlo.Fix
Migration.Versionpasa desize:40asize:100(igual queAddonKey).db.AutoMigrate(&Migration{})corre en cadaApply, así que elALTER COLUMNpara ensanchar se aplica solo en instalaciones existentes — no hace falta ninguna migración manual ni bump de versión de esquema.Test plan
AutoMigratesobre una tablametacore_addon_migrationsexistente (con filas) ensancha la columna sin errorversionde 50-90 caracteres funcionavarchar(100)🤖 Generated with Claude Code