cviebrock / sequel-pro-laravel-export

A Sequel Pro / Sequel Ace bundle to generate Laravel migration files from existing tables.
MIT License
921 stars 56 forks source link

Allow autoincrement signed integer types. Add unsigned support for fl… #36

Closed nick15marketing closed 3 years ago

nick15marketing commented 3 years ago

…oating point types

This change will allow auto-increment integers that are not unsigned and also adds support for unsigned floating point types. It does this by using the base methods in Blueprint eg integer, tinyInteger etc instead of helper methods integerIncrements etc which assumes unsigned.

cviebrock commented 3 years ago

Thanks!

cviebrock commented 3 years ago

So ... I merged this and then ran it against a few tables. My opinion is that:

$table->integer('id', 1, 1);
$table->bigInteger('foo', 0, 1);

is not the way Laravel developers would naturally write their migrations, and is less intuitive than:

$table->increments('id');
$table->unsignedBigInteger('foo');

So I've kept some of the parsing code you provided, but updated the output again to use those "natural" migration methods.