Closed nCrazed closed 7 years ago
+1
Even with the suggested fix by nCrazed, I still have same error:
[PDOException]
SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: ""
@l3xq can paste the full error with the query that triggers it?
@nCrazed Sorry it took so long to reply. Per your instructions removed 'id', and the error persists.
@l3xq I see that the id
is still present in the query which it shouldn't be. Can you post the full stack trace to make sure that the insert is not being called from somewhere else?
As far as I can tell this is the only source of INSERT
queries in the context of the currency:manage add
command and the id
is set only in that array. Without the id
key in the array it should not be present in the query, but it's hard for me to test and confirm this assertion because the package expects to be within the context of a full Laravel application so it's impossible to test in isolation. Which is probably why there are no tests.
@Torann any plans on making the package testable without the entire laravel framework?
Running
php artisan currency:manage add USD
will result in an INSERT query that attempts to insert an empty string (''
) value into the integer id column which yields the following error on PostgreSQL:and probably something similar on MySQL with relevant strict modes enabled.
This is due to this default array. Since your migration sets the
id
column toauto increment
theid
should be dropped from the default array completely.