Hello everybody.
Question. The inserts to the database are executed automatically, right?
I ask because when it makes an insert it does not take into account the first field of the base which is an id.
Thanks
sqlalchemy.exc.IntegrityError: (MySQLdb._exceptions.IntegrityError) (1364, "Field 'state_id' doesn't have a default value")
[SQL: INSERT INTO states (domain, entity_id, state, attributes, event_id, last_changed, last_updated, created, old_state_id) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)]
[parameters: ('person', 'person.pablo', 'home', '{"editable": false, "id": "pablo", "latitude": -34.6233206, "longitude": -58.4354447, "gps_accuracy": 18, "source": "person.pablo", "user_id": "89e2395f8c884aed8ffc76dffd3993cb", "friendly_name": "Pablo", "entity_picture": "/api/image/serve/c8ccf52da296b68a51ba64c697b754f5/512x512"}', 610243, datetime.datetime(2021, 6, 19, 0, 2, 28, 876290, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 6, 19, 0, 2, 28, 876290, tzinfo=datetime.timezone.utc), datetime.datetime(2021, 6, 19, 0, 2, 28, 876290, tzinfo=datetime.timezone.utc), None)]
(Background on this error at: http://sqlalche.me/e/14/gkpj)