Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom foreign key names (continued work of #1311) #1726

Merged
merged 6 commits into from Feb 16, 2017

Conversation

@vellotis
Copy link
Contributor

@vellotis vellotis commented Oct 7, 2016

This PR has missing unit tests for PR #1311.

This PR enables declaring custom foreign key name.

t.integer('key_name_id')
  .references('target_table_id')
  .inTable('target_table_name')
  .withKeyName('foreign_key_name')

https://github.com/tgriesser/knex/compare/master...vellotis:feature/support-custom-foreign-key-names?expand=1#diff-b91681a6009d38db70d89305944b4318R166

t.foeign('key_name_id', 'foreign_key_name')
  .references('target_table_id')
  .inTable('target_table')

https://github.com/tgriesser/knex/compare/master...vellotis:feature/support-custom-foreign-key-names?expand=1#diff-b91681a6009d38db70d89305944b4318R173

Closes #1311
Closes #415

@elhigu
Copy link
Member

@elhigu elhigu commented Feb 16, 2017

Thanks! Feature look good 👍 Documentation is needed for this, but I'll include this to next release anyways. knex/documentation#21

Actually trying to trigger travis to run tests with latest travis configuration... (maybe it just doesn't run tests against merged branch..)
@elhigu elhigu merged commit fe4ec15 into knex:master Feb 16, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants