s4

diff s4-init.sh @ 490:e4b929e40fa8

Add feature of limiting date range of POST count
author HIROSE Yuuji <yuuji@gentei.org>
date Fri, 08 Jun 2018 09:36:21 +0900
parents 2f1607d8b56b
children ce6d0f04f520
line diff
     1.1 --- a/s4-init.sh	Tue Aug 02 13:25:47 2016 +0859
     1.2 +++ b/s4-init.sh	Fri Jun 08 09:36:21 2018 +0900
     1.3 @@ -71,9 +71,10 @@
     1.4  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);'
     1.5  create table session '(id text primary key, expire text);'
     1.6  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);'
     1.7 +
     1.8 +# For compatibility
     1.9  tblacc=`query "select name from sqlite_master where name='tblaccesses';"`
    1.10  acc=`query "select name from sqlite_master where name='acclog';"`
    1.11 -echo tblacc="[$tblacc]" acc="[$acc]"
    1.12  create table tblaccesses "(user, tbl, tblrowid, time, \
    1.13  	unique(user, tbl, tblrowid, time), \
    1.14  	foreign key(user) references user(name))"
    1.15 @@ -82,6 +83,7 @@
    1.16    query "INSERT INTO tblaccesses SELECT * FROM acclog;
    1.17  DROP TABLE acclog;"
    1.18  fi
    1.19 +# Ver.2 of acclog
    1.20  create view acclog "AS
    1.21  SELECT user, tbl, tblrowid, max(time) time FROM tblaccesses
    1.22  GROUP by user, tbl, tblrowid;"