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

Add add_foreign to the schema builder #388

Closed
josephmancuso opened this issue Feb 15, 2021 · 0 comments · Fixed by #426
Closed

Add add_foreign to the schema builder #388

josephmancuso opened this issue Feb 15, 2021 · 0 comments · Fixed by #426
Labels
enhancement A feature that exists, works as intended but needs to be improved

Comments

@josephmancuso
Copy link
Member

Describe the feature as you'd like to see it
We should have an add_foreign method on the schema builder. This should be a shortcut to the current way to add foreign keys. It should look like this:

table.add_foreign("from_column.to_column.table")

The above would be the same as this:

table.foreign("from_column").references("to_column").on("table")
@josephmancuso josephmancuso added the enhancement A feature that exists, works as intended but needs to be improved label Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature that exists, works as intended but needs to be improved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant