source: TriviaEngine/schema.sql @ 36

Revision 36, 1.5 KB checked in by cow, 5 years ago (diff)

add sqlite schema

Line 
1CREATE TABLE "categories" (
2  "cat_id" INTEGER NOT NULL primary key autoincrement,
3  "cat_name" varchar(255) NOT NULL default '',
4  "cat_enabled" tinyint(4) NOT NULL default '0'
5);
6CREATE TABLE "games" (
7  "game_id" integer NOT NULL primary key,
8  "game_start" bigint(20) NOT NULL default '0',
9  "game_end" bigint(20) NOT NULL default '0',
10  "game_winner" bigint(20) NOT NULL default '0'
11);
12CREATE TABLE "questions" (
13  "question_id" integer NOT NULL primary key autoincrement,
14  "cat_id" bigint(20) NOT NULL default '0',
15  "question" varchar(255) NOT NULL default '',
16  "answer" varchar(255) NOT NULL default '',
17  "count" bigint(20) NOT NULL default '0'
18);
19CREATE TABLE "reports" (
20  "report_id" integer NOT NULL primary key autoincrement,
21  "when" bigint(20) NOT NULL default '0',
22  "who" varchar(15) NOT NULL default '',
23  "question_id" bigint(20) NOT NULL default '0',
24  "message" varchar(200) NOT NULL default '',
25  "resolved" char(1) NOT NULL default 'N'
26);
27CREATE TABLE "scores" (
28  "user_id" bigint(20) NOT NULL default '0',
29  "dt" bigint(20) NOT NULL default '0'
30);
31CREATE TABLE "users" (
32  "user_id" integer NOT NULL primary key autoincrement,
33  "user_name" varchar(20) NOT NULL default '',
34  "user_pass" varchar(255) NOT NULL default '',
35  "user_score" bigint(20) NOT NULL default '0',
36  "user_reg" bigint(20) default NULL,
37  "user_last" bigint(20) default NULL
38, user_points bigint not null default 0);
39CREATE TABLE "winners" (
40user_id bigint(20) not null default '0',
41dt bigint(2) not null default '0',
42score int not null default '0'
43);
44
Note: See TracBrowser for help on using the repository browser.