Skip to content

feat: [Forge] set foreign key name manually#6370

Closed
stausif wants to merge 2 commits intocodeigniter4:developfrom
stausif:develop_addForeignKey_5075
Closed

feat: [Forge] set foreign key name manually#6370
stausif wants to merge 2 commits intocodeigniter4:developfrom
stausif:develop_addForeignKey_5075

Conversation

@stausif
Copy link
Copy Markdown

@stausif stausif commented Aug 11, 2022

Description
Ref #5075

custom name for foreign key constraint can be added.

$this->forge->addForeignKey("column_name", "table_name", "id", "onDelete", "onUpdate", ["constraint"=>"foreignkey_name"])

auto create name for foreign key is still there, a check is added to choose between two.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis
Copy link
Copy Markdown
Member

kenjis commented Aug 11, 2022

Thank you for the contribution!

But you sent this PR to the wrong branch.
The enhancement should be sent to 4.3 branch now.
See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#branching

Please fix it.
See #6329 (comment)

@kenjis kenjis added enhancement PRs that improve existing functionalities tests needed Pull requests that need tests labels Aug 11, 2022
@kenjis kenjis changed the title Develop add foreign key 5075 feat: [Forge] set foreign key name manually Aug 11, 2022
@kenjis kenjis added the database Issues or pull requests that affect the database layer label Aug 11, 2022
@kenjis
Copy link
Copy Markdown
Member

kenjis commented Aug 13, 2022

@stausif
Copy link
Copy Markdown
Author

stausif commented Aug 16, 2022

If you sent to the wrong branch https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/workflow.md#if-you-sent-to-the-wrong-branch

Thanks I'll update and resubmit it.

@kenjis
Copy link
Copy Markdown
Member

kenjis commented Sep 24, 2022

#6468 was merged into 4.3.

@kenjis kenjis closed this Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

database Issues or pull requests that affect the database layer enhancement PRs that improve existing functionalities tests needed Pull requests that need tests wrong branch PRs sent to wrong branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants