# HG changeset patch # User HIROSE Yuuji # Date 1470115106 -32399 # Node ID 7d7b81cfd3a043df4bb052ae1777c7db959ee6d1 # Parent 2f1607d8b56b88b1778c1e26c1869f5c4878df99 Remove debug comment diff -r 2f1607d8b56b -r 7d7b81cfd3a0 s4-init.sh --- a/s4-init.sh Tue Aug 02 13:25:47 2016 +0859 +++ b/s4-init.sh Tue Aug 02 14:18:25 2016 +0859 @@ -71,9 +71,10 @@ create table par '(sessid text, var text, type text, val text, primary key(sessid, var, val) foreign key(sessid) references session(id) on update cascade on delete cascade);' create table session '(id text primary key, expire text);' create table cookie '(sessid text, var text, type text, val text, primary key(sessid, var) foreign key(sessid) references session(id) on update cascade on delete cascade);' + +# For compatibility tblacc=`query "select name from sqlite_master where name='tblaccesses';"` acc=`query "select name from sqlite_master where name='acclog';"` -echo tblacc="[$tblacc]" acc="[$acc]" create table tblaccesses "(user, tbl, tblrowid, time, \ unique(user, tbl, tblrowid, time), \ foreign key(user) references user(name))" @@ -82,6 +83,7 @@ query "INSERT INTO tblaccesses SELECT * FROM acclog; DROP TABLE acclog;" fi +# Ver.2 of acclog create view acclog "AS SELECT user, tbl, tblrowid, max(time) time FROM tblaccesses GROUP by user, tbl, tblrowid;"