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

Foreign keys in the same migration as tables #7

Closed
mruz opened this issue Jan 31, 2020 · 2 comments
Closed

Foreign keys in the same migration as tables #7

mruz opened this issue Jan 31, 2020 · 2 comments

Comments

@mruz
Copy link

mruz commented Jan 31, 2020

Could we change this?

Laravel Migrations Generator will first generate all the tables, columns and indexes, and afterwards setup all the foreign key constraints

In the drop() we could drop the foreign keys first and then drop table.

@Putr
Copy link

Putr commented Aug 18, 2020

This can be a problem if your tables are not generated in the correct order (i.e. you're trying to create a constraint for a table that has not been created yet). This would force the generator to "figure out" the correct order which just complicates everything.

Best just to do it after.

@oscarafdev
Copy link
Owner

This can be a problem if your tables are not generated in the correct order (i.e. you're trying to create a constraint for a table that has not been created yet). This would force the generator to "figure out" the correct order which just complicates everything.

Best just to do it after.

I share your opinion, anyway I will think of a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants