Merge pull request #150 from eithed/master

Add missing schema declaration
This commit is contained in:
feek 2021-06-14 12:15:57 -07:00 committed by GitHub
commit 57532207fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,7 +165,7 @@ class SchemaAggregator
$additional_method_calls = [];
$nullable = false;
while ($root_var instanceof PhpParser\Node\Expr\MethodCall) {
if ($root_var->name instanceof PhpParser\Node\Identifier
&& $root_var->name->name === 'nullable'
@ -325,7 +325,7 @@ class SchemaAggregator
$table->dropColumn($column_name);
break;
case 'enum':
$table->setColumn(new SchemaColumn($column_name, 'enum', $nullable, $second_arg_array));
@ -338,6 +338,14 @@ class SchemaAggregator
case 'foreign':
break;
case 'foreignid':
$table->setColumn(new SchemaColumn($column_name, 'int', $nullable));
break;
case 'foreignuuid':
$table->setColumn(new SchemaColumn($column_name, 'string', $nullable));
break;
case 'geometry':
$table->setColumn(new SchemaColumn($column_name, 'mixed', $nullable));
break;
@ -346,6 +354,10 @@ class SchemaAggregator
$table->setColumn(new SchemaColumn($column_name, 'mixed', $nullable));
break;
case 'id':
$table->setColumn(new SchemaColumn('id', 'int', $nullable));
break;
case 'increments':
$table->setColumn(new SchemaColumn($column_name, 'int', $nullable));
break;
@ -418,11 +430,21 @@ class SchemaAggregator
$table->setColumn(new SchemaColumn($column_name, 'mixed', $nullable));
break;
case 'numericmorphs':
$table->setColumn(new SchemaColumn($column_name . '_type', 'string', $nullable));
$table->setColumn(new SchemaColumn($column_name . '_id', 'int', $nullable));
break;
case 'nullablemorphs':
$table->setColumn(new SchemaColumn($column_name . '_type', 'string', true));
$table->setColumn(new SchemaColumn($column_name . '_id', 'int', true));
break;
case 'nullablenumericmorphs':
$table->setColumn(new SchemaColumn($column_name . '_type', 'string', true));
$table->setColumn(new SchemaColumn($column_name . '_id', 'int', true));
break;
case 'nullableuuidmorphs':
$table->setColumn(new SchemaColumn($column_name . '_type', 'string', true));
$table->setColumn(new SchemaColumn($column_name . '_id', 'string', true));
@ -484,6 +506,10 @@ class SchemaAggregator
$table->setColumn(new SchemaColumn($column_name, 'string', $nullable));
break;
case 'tinytext':
$table->setColumn(new SchemaColumn($column_name, 'string', $nullable));
break;
case 'time':
$table->setColumn(new SchemaColumn($column_name, 'string', $nullable));
break;