Skip to content

Conversation

AngelFQC
Copy link
Member

@AngelFQC AngelFQC commented Oct 3, 2025

No description provided.

@AngelFQC AngelFQC marked this pull request as ready for review October 3, 2025 21:56
@AngelFQC AngelFQC merged commit 1417f09 into chamilo:master Oct 3, 2025
1 of 7 checks passed
@AngelFQC AngelFQC deleted the lti branch October 3, 2025 23:26
@ywarnier
Copy link
Member

ywarnier commented Oct 4, 2025

When I execute the 3 migrations (Version2025100211000[0,1,2] on my system with Chamilo master installed in dev mode before those new migrations, I get errors only for [...0]):

[notice] Executing Chamilo\CoreBundle\Migrations\Schema\V200\Version20251002110001 up
^[[A[error] Migration Chamilo\CoreBundle\Migrations\Schema\V200\Version20251002110001 failed during Execution. Error: "An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1553 Cannot drop index 'IDX_5C76B75D8F7B22CC': needed in a foreign key constraint"                                                                                                                                                                  

In ExceptionConverter.php line 118:
                                                                                                                                                                    
  An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1553 Cannot drop index 'IDX_5C76B75D8F7B22CC': needed in a foreign key constraint  
                                                                                                                                                                    

In Exception.php line 24:
                                                                                                                     
  SQLSTATE[HY000]: General error: 1553 Cannot drop index 'IDX_5C76B75D8F7B22CC': needed in a foreign key constraint  
                                                                                                                     

In Connection.php line 71:
                                                                                                                     
  SQLSTATE[HY000]: General error: 1553 Cannot drop index 'IDX_5C76B75D8F7B22CC': needed in a foreign key constraint  

So it seems IDX_5C76B75D8F7B22CC is still used somewhere when you're trying to drop it.
I would imagine this is not super problematic, but then I'm not sure if it executes the rest of the migration. At least in my case it didn't drop lti_lineitem.tool_id.

I get this error on several fields: If I try to fix the first one, I get a message reminding us that the 'public_key' index already exists, etc. Something seems wrong.

There are also a number of queries like "ALTER TABLE DROP COLUMN [...]" (!!) where the name of the table is not stated (my IDE flags them as erroneous queries, with reason).

There's no "down()" method in this migration either, so it's a bit tricky to turn back once you ran the script and some of it worked.

On line ~262 of Version20251002110001.php, I find the use of $token->hasColumn('public_key') while the object it is executed on should really be $platform.

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