I’m working with yii 1.1.13 on a project. We are having trouble getting a successful insert to a table with,
id bigserial NOT NULL,
When I check the actual sql, yii is trying to set the id field to NULL.
I’ve tried overriding the primaryKey() function,
I’ve looked through the rules.
I’ve attempted to unset() the attribute.
The next thing I was going to try was calling nextval on the sequence in the save function for the model, and stuffing the id into the ‘id’ attribute, but I keep thinking there has got to be something simple I’m missing.
Yes, there was some hack involving beforesave(?) hook, im pretty sure you can easily find it in google. Basically you just get next sequence number from php.