cakephp / cakephp/phinx

Need ability to get all foreign keys

Open
#1,980 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Is there a way to get foreign keys from the table or adapter?

This method is currently protected and lives within the adapters and used to be public but it got removed by this PR which it is not clear to me why it got removed.

Is there architecturally a reason to keep this method protected, would you consider changing this behavior? Please let me know as I am happy in assisting with this feature request.

Thanks!

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

Start with src/Phinx/Db/Adapter/MysqlAdapter.php around line 813 and review the removal in pull request #1339. Compare the adapter interfaces and supported implementations to determine the appropriate public access point; the work is done when callers can retrieve a table's foreign keys through the supported API without violating the adapter design.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
database
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.