Xethron / migrations-generator

Laravel Migrations Generator: Automatically generate your migrations from an existing database schema.
MIT License
3.32k stars 588 forks source link

Add more flexibility with the package #148

Closed rjacobsen2012 closed 3 months ago

rjacobsen2012 commented 6 years ago

I have added the following features to your package, and do hope you approve.

  1. Make the date used for the migrations to always be sequential so the migrations are done in order
  2. Added the ability to dynamically check for table dependencies via the foreign keys, and ask the user if they want to use that feature a. This allows the tables needed by other tables to be loaded first so the foreign keys do not cause issues on up/down
  3. Added the ability to combine the foreign keys creation into the create migrations, and ask the user if they want to use that feature
  4. Added the ability to clear all existing migrations, and ask the user if they want all the existing migrations cleared
arall commented 6 years ago
[ErrorException]                         
Invalid argument supplied for foreach()  

Exception trace:
 () at <redacted>/migrations-generator/src/Xethron/MigrationsGenerator/MigrateGenerateCommand.php:343
rjacobsen2012 commented 6 years ago

@arall I just pushed a fix for the error. Should be working fine now.

arall commented 6 years ago

Thanks @rjacobsen2012 , issue fixed. However, I can see some foreign relations of tables that doesn't exist yet.

rjacobsen2012 commented 6 years ago

@arall What foreign relations? Please provide some detail.

tomzx commented 6 years ago

@rjacobsen2012 If you create the table and the foreign keys at the same time, you will have some issues where the tables your foreign keys refer to do not exist yet. That is currently why the foreign keys are created as a second step.