alexfuser's avatar

"Error updating file, error code: SQLSTATE [22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type smallint"

Could you help me with this error

In my locahost it works perfectly. It is on my server that it throws the error.

"Error al actualizar el expediente, codigo de error:SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type smallint: "" (SQL: insert into "files_internal_control_2" ("capture_agency_number_id", "ic2_accumulated", "crime_final_classification_id", "status_file_id", "justification_of_low_status", "date_of_low_file", "localized_victim_option", "localized_condition_id", "localized_condition_details_id", "localized_victim_date", "localized_place_option", "…_observations", "localized_locality_or_colony", "localized_street", "localized_exterior_number", "localized_interior_number", "localized_coordinated_lat", "localized_coordinated_long", "file_observations", "status_folder", "closing_date_folder", "justification_folder_status", "specify_justification_folder_status", "file_id", "updated_at", "created_at") values (, , , , , , , , , , , , , , , , , , , , , , , , , , , , 1, 2020-08-05 00:50:07, 2020-08-05 00:50:07) returning "id")"

0 likes
8 replies
Sinnbeck's avatar

Any chance that you are using mysql locally and Postgres on production?

Also consider posting your code

siangboon's avatar

double check the input value for that field with SMALLINT type

alexfuser's avatar

In localhost and production I use postgres

I posted my code :)

siangboon's avatar
Level 54

i believe the system wont lie..

try access the db and check the table schema instead of migration file... and try also copy the entire insert statement and run it on your database...

Sofia_Carter's avatar

Hi. I can help you. please reach me Skype.

Skype : live:sofia_6831

alexfuser's avatar

Thank you all

I have fixed the bug. The problem was in the migrations.

Please or to participate in this conversation.