Skip to content

fix(dynamic): widen metacore_addon_migrations.version to varchar(40) -> varchar(100) - #282

Merged
akromicc merged 1 commit into
mainfrom
fix/migration-version-column-width
Aug 19, 2026
Merged

fix(dynamic): widen metacore_addon_migrations.version to varchar(40) -> varchar(100)#282
akromicc merged 1 commit into
mainfrom
fix/migration-version-column-width

Conversation

@akromicc

Copy link
Copy Markdown
Contributor

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 con SQLSTATE 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.Version pasa de size:40 a size:100 (igual que AddonKey). db.AutoMigrate(&Migration{}) corre en cada Apply, así que el ALTER COLUMN para ensanchar se aplica solo en instalaciones existentes — no hace falta ninguna migración manual ni bump de versión de esquema.

Test plan

  • AutoMigrate sobre una tabla metacore_addon_migrations existente (con filas) ensancha la columna sin error
  • Insertar una version de 50-90 caracteres funciona
  • Instalación fresca: la tabla se crea directo en varchar(100)

🤖 Generated with Claude Code

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>
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 73c5014a-6d96-4cdd-9ed8-e64a7fdbf74f


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@akromicc
akromicc merged commit b295764 into main Aug 19, 2026
2 checks passed
@akromicc
akromicc deleted the fix/migration-version-column-width branch August 19, 2026 12:18
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.

1 participant