We have something like:
CREATE TABLE IF NOT EXISTS files
(encoded_url varchar(65) UNIQUE NOT NULL primary key, modified DATETIME NOT NULL);
We want each time a new record is created to fill its modified field with now time automatically. Can we tall SQLite that it has to do such thing when we create a table or we should always insert nowwhen we fill in a row?
You can use
default CURRENT_TIMESTAMPin the column specification:There are other date/time options, documented in the column definition part of the
create tablesyntax docs.