SQLite Forum

Can DEFAULT be the only possible value?
Login
You would be better served by having the creation_date default to NULL and using before insert and before update triggers to prevent it from being updated and an after insert trigger to set the creation_date.  ie,

```
create table t(..., creation_date text default NULL, modification_date text as (datetime()) stored);

create trigger t_bi_creation_date before insert of creation_date on t
begin
 select raise(ABORT, 'Cannot set creation_date');
end;

create trigger t_bu_creation_date before update of creation_date on t when old.creation_date is not null
begin
 select raise(ABORT, 'Cannot update creation_date');
end;

create trigger t_ai_creation_date after insert on t
begin
  update t
     set creation_date = datetime()
    where rowid = new.rowid;
end;
```

Then the creation_date and modification_date fields will be entirely self maintaining and unfiddlable (save dropping the triggers first).