Add trigger to update CURRENT_TIMESTAMP to local time upon insert to Attendance table

This commit is contained in:
kougyokugentou 2021-02-04 22:11:03 -08:00
parent 6f2a63af4f
commit 2cce2560a6
2 changed files with 7 additions and 0 deletions

Binary file not shown.

View File

@ -36,3 +36,10 @@ CREATE TABLE "Authorized_Guardians" (
FOREIGN KEY("child_id") REFERENCES "Children"("id"),
FOREIGN KEY("guardian_id") REFERENCES "Guardians"("id")
);
CREATE TRIGGER trgUpdateTimestampToLocal AFTER INSERT ON Attendence
BEGIN
UPDATE Attendence
SET timestamp = datetime(timestamp, 'localtime')
WHERE id = new.id;
END;