Execute FK queries at the end#59
Conversation
This change will execute FK's queries outside all creation queries and at end of everything
This change will delete the creation of FK inside the Creation Table's queries and will move all outside at the end of all diff.
357r4bd
left a comment
There was a problem hiding this comment.
Thank you for the PR, please do the following to proceed:
- squash both commits
- create a more informative commit message
- utlize the "Resolves issue xxx" phrasing GH can use to link to the issue describing what this fixes
- address comments in the code
Thank you, looking forward to your changes.
| my @_lines = @{$self->{lines}}; | ||
|
|
||
| for my $i (0 .. @_lines) { | ||
| my $lchar = unpack('A1', $_lines[$i]); |
There was a problem hiding this comment.
Please comment what unpack is being used for
| unless defined $self->{options}; | ||
|
|
||
| @lines = grep ! m{^/\*!40\d{3} .*? \*/;}, @lines; | ||
| @lines = grep ! m{^/\*!40\d{3} .*? \*/;}, @lines; |
There was a problem hiding this comment.
you added training whitespace, please remove
|
|
||
| =head1 COPYRIGHT AND LICENSE | ||
|
|
||
|
|
There was a problem hiding this comment.
you added 2 empty lines, please remove
| croak "couldn't figure out table name"; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
pls remove added white space
I merged the PRs aspiers#59 and aspiers#65 of the main branch while also cleaning them up a bit and double checking the code. It is still untested tho.
|
Hey @WilliamFalci , and it is generating a SQL not completely sorted ("CONSTRAINT films_selected_trailer_pack_dcfafea4_fk_trailer_packs_id" should be after "CREATE TABLE trailer_packs", there is a cyclic dependency, the table trailer_packs references the table films and the table films references the table trailer_packs): The SQL above creates the error: |
|
@diegobill Hello! Sincerally I stopped to write in PHP many years ago and my current stack is node/typescript (primary), I remember I ended to make this: https://github.com/WilliamFalci/_mysqlDiff and when I did was working pretty good. If you not find a solution I will try to help you to figure out the solution, but I have no effort to develop more in PHP. |
Those changes move the FK's queries outside the creation queries and go to execute all them at the end of all other queries