X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=sql%2Fsql.d%2F050-bin5.sql;fp=sql%2Fsql.d%2F050-bin5.sql;h=938d5d3e71a6945ec27944d00828a437845c01c3;hb=2054502215862619b019d6ffccb6692a9b5281ed;hp=0000000000000000000000000000000000000000;hpb=533013ed4607a9857f66c1061d8fbcec114b89be;p=brisk.git diff --git a/sql/sql.d/050-bin5.sql b/sql/sql.d/050-bin5.sql new file mode 100644 index 0000000..938d5d3 --- /dev/null +++ b/sql/sql.d/050-bin5.sql @@ -0,0 +1,25 @@ +-- +-- briskin5 (bin5) related tables +-- + +DROP TABLE #PFX#bin5_matches; +CREATE TABLE #PFX#bin5_matches ( + code SERIAL PRIMARY KEY, + ttok text UNIQUE, -- token associated to the match + tidx integer -- table index + ); + +DROP TABLE #PFX#bin5_games; +CREATE TABLE #PFX#bin5_games ( + code SERIAL PRIMARY KEY, + mcode integer REFERENCES #PFX#bin5_matches (code) ON DELETE cascade ON UPDATE cascade, + tstamp timestamp -- end game time + ); + +DROP TABLE #PFX#bin5_points; +CREATE TABLE #PFX#bin5_points ( + gcode integer REFERENCES #PFX#bin5_games (code) ON DELETE cascade ON UPDATE cascade, + ucode integer REFERENCES #PFX#users (code) ON DELETE cascade ON UPDATE cascade, + pts integer -- points + ); +