diff --git a/src/Sushi.php b/src/Sushi.php index 6c7fc95..fb3abcb 100644 --- a/src/Sushi.php +++ b/src/Sushi.php @@ -159,6 +159,10 @@ public function createTable(string $tableName, $firstRow) $type = $schema[$column] ?? $type; $table->{$type}($column)->nullable(); + + if ($column === $this->primaryKey) { + $table->primary($this->primaryKey); + } } if ($this->usesTimestamps() && (! in_array('updated_at', array_keys($firstRow)) || ! in_array('created_at', array_keys($firstRow)))) {