2021-01-01 18:29:44 +00:00
|
|
|
create table persons (
|
|
|
|
id integer primary key autoincrement,
|
|
|
|
firstName text not null,
|
|
|
|
lastName text not null,
|
|
|
|
email varchar(256) not null,
|
2022-02-09 20:30:35 +00:00
|
|
|
status integer default 0,
|
|
|
|
created_at date not null default current_timestamp,
|
|
|
|
updated_at date not null default current_timestamp
|
2021-01-01 18:29:44 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
create trigger update_at_persons
|
|
|
|
after update on persons
|
|
|
|
begin
|
|
|
|
update persons
|
|
|
|
set updated_at = datetime('now', 'localtime')
|
|
|
|
where id = old.id;
|
|
|
|
end;
|