Problem foreign key with table name without prefix
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 4.5k
- Forks
- 884
- PR merge metrics
- No merged PRs in 30d
Description
Hi
I want to connect the foreign key to another table that is not related to the project. What should I do, for example:
phinx config:
table_prefix = 'ac_'
table1 : ac_user
table2 : core_user
ALTER TABLE `ac_user`
ADD CONSTRAINT `ac_user_user_id` FOREIGN KEY (`user_id`)
REFERENCES `core_user` (`user_id`)
ON DELETE CASCADE ON UPDATE CASCADE
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 Phinx configuration and the table_prefix behavior, then trace how a foreign-key migration generates the shown ALTER TABLE statement for ac_user and core_user. Confirm whether references to a table outside the configured prefix are supported; done means the generated SQL can target core_user without incorrectly applying ac_.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100