I have table in PostgreSQL:
CREATE TABLE news(
id serial PRIMARY KEY,
user_id integer NOT NULL REFERENCES users(id),
time timestamp NOT NULL DEFAULT(CURRENT_TIMESTAMP),
title text NOT NULL,
content text NOT NULL
);
and model class generated automatically by yiic shell / model news:
class news extends CActiveRecord
{
…
}
I added beforeSave() function to fill the user_id field, but I have problem with time field.
The INSERT operations looks like:
INSERT INTO news("user_id", "time", "title", "content") VALUES(…);
How can I remove certain filed (time) from insert and update commands (or past there DEFAULT) ??
regards