cakephp / cakephp/phinx

Show query on error

Open
#1,338 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
PHP
Stars
4.5k
Forks
884
PR merge metrics
No merged PRs in 30d

Description

I'm use up() / down() methods and couple execute() in one migration. On error phinx print nice message like SQLSTATE[HY000]: General error: 1359 Trigger already exists or SQLSTATE[42S22]: Column not found: 1054 Unknown column 'title_id' in 'NEW' but if I add over 50 triggers...

(only way is make database dump and find error place)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with a migration using up()/down() and multiple execute() calls, including more than 50 triggers. Trace how Phinx reports the SQLSTATE error and identify where the executed query is available. Done means the failing query is included in the error output so the problematic trigger can be found without a database dump.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.