bot_repeater.sql 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. --
  2. -- PostgreSQL database dump
  3. --
  4. -- Dumped from database version 12.4
  5. -- Dumped by pg_dump version 12.4
  6. SET statement_timeout = 0;
  7. SET lock_timeout = 0;
  8. SET idle_in_transaction_session_timeout = 0;
  9. SET client_encoding = 'UTF8';
  10. SET standard_conforming_strings = on;
  11. SELECT pg_catalog.set_config('search_path', '', false);
  12. SET check_function_bodies = false;
  13. SET xmloption = content;
  14. SET client_min_messages = warning;
  15. SET row_security = off;
  16. SET default_tablespace = '';
  17. SET default_table_access_method = heap;
  18. --
  19. -- Name: answer_history; Type: TABLE; Schema: public; Owner: postgres
  20. --
  21. CREATE TABLE public.answer_history (
  22. id integer NOT NULL,
  23. user_id integer NOT NULL,
  24. body text NOT NULL,
  25. "timestamp" timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
  26. );
  27. ALTER TABLE public.answer_history OWNER TO postgres;
  28. --
  29. -- Name: answer_history_aid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
  30. --
  31. CREATE SEQUENCE public.answer_history_aid_seq
  32. AS integer
  33. START WITH 1
  34. INCREMENT BY 1
  35. NO MINVALUE
  36. NO MAXVALUE
  37. CACHE 1;
  38. ALTER TABLE public.answer_history_aid_seq OWNER TO postgres;
  39. --
  40. -- Name: answer_history_aid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
  41. --
  42. ALTER SEQUENCE public.answer_history_aid_seq OWNED BY public.answer_history.id;
  43. --
  44. -- Name: auth_user; Type: TABLE; Schema: public; Owner: postgres
  45. --
  46. CREATE TABLE public.auth_user (
  47. uid bigint NOT NULL,
  48. authorized boolean DEFAULT false NOT NULL,
  49. muted boolean DEFAULT false NOT NULL,
  50. whitelist boolean DEFAULT false NOT NULL
  51. );
  52. ALTER TABLE public.auth_user OWNER TO postgres;
  53. --
  54. -- Name: banlist; Type: TABLE; Schema: public; Owner: postgres
  55. --
  56. CREATE TABLE public.banlist (
  57. id bigint NOT NULL
  58. );
  59. ALTER TABLE public.banlist OWNER TO postgres;
  60. --
  61. -- Name: exam_user_session; Type: TABLE; Schema: public; Owner: postgres
  62. --
  63. CREATE TABLE public.exam_user_session (
  64. user_id bigint NOT NULL,
  65. problem_version integer NOT NULL,
  66. problem_id integer,
  67. "timestamp" timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
  68. baned boolean DEFAULT false NOT NULL,
  69. bypass boolean DEFAULT false NOT NULL,
  70. passed boolean DEFAULT false NOT NULL,
  71. unlimited boolean DEFAULT false NOT NULL,
  72. retries integer DEFAULT 0 NOT NULL
  73. );
  74. ALTER TABLE public.exam_user_session OWNER TO postgres;
  75. --
  76. -- Name: msg_id; Type: TABLE; Schema: public; Owner: postgres
  77. --
  78. CREATE TABLE public.msg_id (
  79. msg_id integer NOT NULL,
  80. target_id integer DEFAULT 0 NOT NULL,
  81. "timestamp" timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
  82. user_id bigint
  83. );
  84. ALTER TABLE public.msg_id OWNER TO postgres;
  85. --
  86. -- Name: reasons; Type: TABLE; Schema: public; Owner: postgres
  87. --
  88. CREATE TABLE public.reasons (
  89. id integer NOT NULL,
  90. user_id bigint,
  91. "timestamp" timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
  92. text text NOT NULL,
  93. msg_id integer
  94. );
  95. ALTER TABLE public.reasons OWNER TO postgres;
  96. --
  97. -- Name: reasons_rid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
  98. --
  99. CREATE SEQUENCE public.reasons_rid_seq
  100. AS integer
  101. START WITH 1
  102. INCREMENT BY 1
  103. NO MINVALUE
  104. NO MAXVALUE
  105. CACHE 1;
  106. ALTER TABLE public.reasons_rid_seq OWNER TO postgres;
  107. --
  108. -- Name: reasons_rid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
  109. --
  110. ALTER SEQUENCE public.reasons_rid_seq OWNED BY public.reasons.id;
  111. --
  112. -- Name: tickets; Type: TABLE; Schema: public; Owner: postgres
  113. --
  114. CREATE TABLE public.tickets (
  115. id integer NOT NULL,
  116. user_id bigint DEFAULT 0 NOT NULL,
  117. "timestamp" timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
  118. hash character varying(32) NOT NULL,
  119. origin_msg text,
  120. section character varying(20),
  121. status character varying(10)
  122. );
  123. ALTER TABLE public.tickets OWNER TO postgres;
  124. --
  125. -- Name: tickets_tid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
  126. --
  127. CREATE SEQUENCE public.tickets_tid_seq
  128. AS integer
  129. START WITH 1
  130. INCREMENT BY 1
  131. NO MINVALUE
  132. NO MAXVALUE
  133. CACHE 1;
  134. ALTER TABLE public.tickets_tid_seq OWNER TO postgres;
  135. --
  136. -- Name: tickets_tid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
  137. --
  138. ALTER SEQUENCE public.tickets_tid_seq OWNED BY public.tickets.id;
  139. --
  140. -- Name: tickets_user; Type: TABLE; Schema: public; Owner: postgres
  141. --
  142. CREATE TABLE public.tickets_user (
  143. user_id integer NOT NULL,
  144. create_time timestamp without time zone,
  145. last_time timestamp without time zone,
  146. banned boolean DEFAULT false NOT NULL,
  147. last_msg_sent timestamp without time zone,
  148. step smallint DEFAULT 0 NOT NULL,
  149. section character varying(20)
  150. );
  151. ALTER TABLE public.tickets_user OWNER TO postgres;
  152. --
  153. -- Name: username; Type: TABLE; Schema: public; Owner: postgres
  154. --
  155. CREATE TABLE public.username (
  156. user_id bigint NOT NULL,
  157. hash character varying(64) DEFAULT NULL::character varying,
  158. channel_msg_id integer NOT NULL
  159. );
  160. ALTER TABLE public.username OWNER TO postgres;
  161. --
  162. -- Name: answer_history id; Type: DEFAULT; Schema: public; Owner: postgres
  163. --
  164. ALTER TABLE ONLY public.answer_history ALTER COLUMN id SET DEFAULT nextval('public.answer_history_aid_seq'::regclass);
  165. --
  166. -- Name: reasons id; Type: DEFAULT; Schema: public; Owner: postgres
  167. --
  168. ALTER TABLE ONLY public.reasons ALTER COLUMN id SET DEFAULT nextval('public.reasons_rid_seq'::regclass);
  169. --
  170. -- Name: tickets id; Type: DEFAULT; Schema: public; Owner: postgres
  171. --
  172. ALTER TABLE ONLY public.tickets ALTER COLUMN id SET DEFAULT nextval('public.tickets_tid_seq'::regclass);
  173. --
  174. -- Name: answer_history answer_history_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
  175. --
  176. ALTER TABLE ONLY public.answer_history
  177. ADD CONSTRAINT answer_history_pk PRIMARY KEY (id);
  178. --
  179. -- Name: auth_user auth_user_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
  180. --
  181. ALTER TABLE ONLY public.auth_user
  182. ADD CONSTRAINT auth_user_pk PRIMARY KEY (uid);
  183. --
  184. -- Name: banlist banlist_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
  185. --
  186. ALTER TABLE ONLY public.banlist
  187. ADD CONSTRAINT banlist_pk PRIMARY KEY (id);
  188. --
  189. -- Name: exam_user_session exam_user_session_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
  190. --
  191. ALTER TABLE ONLY public.exam_user_session
  192. ADD CONSTRAINT exam_user_session_pk PRIMARY KEY (user_id);
  193. --
  194. -- Name: msg_id msg_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
  195. --
  196. ALTER TABLE ONLY public.msg_id
  197. ADD CONSTRAINT msg_id_pk PRIMARY KEY (msg_id);
  198. --
  199. -- Name: reasons reasons_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
  200. --
  201. ALTER TABLE ONLY public.reasons
  202. ADD CONSTRAINT reasons_pk PRIMARY KEY (id);
  203. --
  204. -- Name: tickets tickets_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
  205. --
  206. ALTER TABLE ONLY public.tickets
  207. ADD CONSTRAINT tickets_pk PRIMARY KEY (id);
  208. --
  209. -- Name: tickets_user tickets_user_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
  210. --
  211. ALTER TABLE ONLY public.tickets_user
  212. ADD CONSTRAINT tickets_user_pk PRIMARY KEY (user_id);
  213. --
  214. -- Name: username username_pk; Type: CONSTRAINT; Schema: public; Owner: postgres
  215. --
  216. ALTER TABLE ONLY public.username
  217. ADD CONSTRAINT username_pk PRIMARY KEY (user_id);
  218. --
  219. -- Name: tickets_hash_uindex; Type: INDEX; Schema: public; Owner: postgres
  220. --
  221. CREATE UNIQUE INDEX tickets_hash_uindex ON public.tickets USING btree (hash);
  222. --
  223. -- PostgreSQL database dump complete
  224. --