Fatal error when checking if log table exists, after renamed it in the configuration file
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 4.5k
- Forks
- 884
- PR merge metrics
- No merged PRs in 30d
Description
After renamed the log table name in the configuration file, I get a fatal error while applying migrations:
Fatal error: Uncaught InvalidArgumentException: There was a problem creating the schema table: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'phinxlog' already exist
I solved this issue modifying the hasTable() method in the MysqlAdapter. I attach a patch of what I have changed... The logic is different, but it is useful to workaround the bug. It would be great if you agree to apply to the main codebase.
Thank you,
Flavio
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the MysqlAdapter hasTable() method and the attached MysqlAdapter_patch.txt, then reproduce migrations after renaming the log table in the configuration. Done means the adapter checks the configured table correctly without reporting that the old phinxlog table already exists.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100