test trigger for created date
To use for each date
This commit is contained in:
@@ -38,6 +38,7 @@ CREATE TABLE note (
|
|||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE action (
|
CREATE TABLE action (
|
||||||
|
id integer primary key,
|
||||||
project_id integer, -- Project id (always set).
|
project_id integer, -- Project id (always set).
|
||||||
task_id integer, -- Task id (set for task or note related actions).
|
task_id integer, -- Task id (set for task or note related actions).
|
||||||
note_id integer, -- Note id (set for note related actions only).
|
note_id integer, -- Note id (set for note related actions only).
|
||||||
@@ -46,9 +47,7 @@ CREATE TABLE action (
|
|||||||
created_at date -- When log message was added?
|
created_at date -- When log message was added?
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CREATE TRIGGER action_insert_created_at AFTER INSERT ON action
|
||||||
-- TO STUDY
|
BEGIN
|
||||||
-- CREATE TRIGGER update_created_date BEFORE update ON note
|
UPDATE action SET created_at = strftime('%Y-%m-%d %H:%M:%S.%s', 'now', 'localtime') WHERE id = new.id;
|
||||||
-- begin
|
END
|
||||||
-- update note set created_at = strftime('%Y-%m-%d %H:%M:%S:%s', 'now', 'localtime') where action_id = old.action_id
|
|
||||||
--end
|
|
||||||
Reference in New Issue
Block a user