schema.sql 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. CREATE 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. );
  6. CREATE 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. );
  12. CREATE 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. );
  19. CREATE 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. );
  27. CREATE TABLE "scores" (
  28. "user_id" bigint(20) NOT NULL default '0',
  29. "dt" bigint(20) NOT NULL default '0'
  30. );
  31. CREATE 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);
  39. CREATE TABLE "winners" (
  40. user_id bigint(20) not null default '0',
  41. dt bigint(2) not null default '0',
  42. score int not null default '0'
  43. );