From f7867884939d87e6adb2f4bcf6a0dda47a7ee0aa Mon Sep 17 00:00:00 2001 From: Matt Gros <3311227+mpge@users.noreply.github.com> Date: Tue, 5 May 2026 21:31:15 -0400 Subject: [PATCH] fix(migration): assign explicit name to satisfaction_ratings rated_by index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The auto-generated index name `escalated_satisfaction_ratings_rated_by_type_rated_by_id_index` is 65 characters — over PostgreSQL's 63-char identifier limit (NAMEDATALEN-1). Lucid/Knex generates names the same way Laravel does, and Adonis supports both MySQL (which works at 65 chars but is at the 64 limit too) and PostgreSQL. Use an explicit short name (`satisfaction_ratings_rated_by_idx`, 33 chars) so the migration runs cleanly on both databases. Backwards compatible: the migration runs only once. Anyone for whom it already succeeded (MySQL or SQLite) has the long auto-generated name in their schema; the new short name only takes effect on fresh installs. Anyone whose migration failed (PostgreSQL with default prefix) is unblocked. --- .../migrations/0014_create_escalated_satisfaction_ratings.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/0014_create_escalated_satisfaction_ratings.ts b/database/migrations/0014_create_escalated_satisfaction_ratings.ts index 6430fe0..e9dd2ed 100644 --- a/database/migrations/0014_create_escalated_satisfaction_ratings.ts +++ b/database/migrations/0014_create_escalated_satisfaction_ratings.ts @@ -20,7 +20,7 @@ export default class CreateEscalatedSatisfactionRatings extends BaseSchema { table.integer('rated_by_id').unsigned().nullable() table.timestamp('created_at', { useTz: true }).nullable() - table.index(['rated_by_type', 'rated_by_id']) + table.index(['rated_by_type', 'rated_by_id'], 'satisfaction_ratings_rated_by_idx') }) }