sharix_open_local_schema.sql 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. --
  2. -- PostgreSQL database dump
  3. --
  4. -- Dumped from database version 12.7
  5. -- Dumped by pg_dump version 12.7
  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: resourse_log; Type: TABLE; Schema: public; Owner: postgres
  20. --
  21. CREATE TABLE public.resourse_log (
  22. id integer NOT NULL,
  23. resource_id integer NOT NULL,
  24. time_log_created timestamp with time zone NOT NULL,
  25. operation character(1) NOT NULL,
  26. user_id integer NOT NULL
  27. );
  28. ALTER TABLE public.resourse_log OWNER TO postgres;
  29. --
  30. -- Name: resourse_log_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
  31. --
  32. CREATE SEQUENCE public.resourse_log_id_seq
  33. AS integer
  34. START WITH 1
  35. INCREMENT BY 1
  36. NO MINVALUE
  37. NO MAXVALUE
  38. CACHE 1;
  39. ALTER TABLE public.resourse_log_id_seq OWNER TO postgres;
  40. --
  41. -- Name: resourse_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
  42. --
  43. ALTER SEQUENCE public.resourse_log_id_seq OWNED BY public.resourse_log.id;
  44. --
  45. -- Name: current_resourse; Type: TABLE; Schema: public; Owner: postgres
  46. --
  47. CREATE TABLE public.current_resourse (
  48. id integer NOT NULL,
  49. resource_id integer NOT NULL,
  50. user_id integer NOT NULL,
  51. order_status character(1),
  52. order_id character(1),
  53. current_token name NOT NULL,
  54. doors_output character(1) NOT NULL,
  55. engine_input character(1) NOT NULL,
  56. central_lock_input character(1) NOT NULL,
  57. ignition_input character(1) NOT NULL,
  58. doors_input character(1) NOT NULL,
  59. input4 name,
  60. controller_status character(1) NOT NULL,
  61. signal_gsm integer NOT NULL,
  62. operator_gsm name NOT NULL,
  63. signal_gps integer NOT NULL,
  64. location character varying(30),
  65. speed real NOT NULL,
  66. direction character(1) NOT NULL,
  67. address name NOT NULL,
  68. battery_level integer NOT NULL,
  69. board_voltage numeric(3,1) NOT NULL
  70. );
  71. ALTER TABLE public.current_resourse OWNER TO postgres;
  72. --
  73. -- Name: current_resourse_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
  74. --
  75. CREATE SEQUENCE public.current_resourse_id_seq
  76. AS integer
  77. START WITH 1
  78. INCREMENT BY 1
  79. NO MINVALUE
  80. NO MAXVALUE
  81. CACHE 1;
  82. ALTER TABLE public.current_resourse_id_seq OWNER TO postgres;
  83. --
  84. -- Name: current_resourse_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
  85. --
  86. ALTER SEQUENCE public.current_resourse_id_seq OWNED BY public.current_resourse.id;
  87. --
  88. -- Name: current_timetable; Type: TABLE; Schema: public; Owner: postgres
  89. --
  90. CREATE TABLE public.current_timetable (
  91. id integer NOT NULL,
  92. order_id integer NOT NULL,
  93. service_type_id integer NOT NULL,
  94. privider_id integer NOT NULL,
  95. resource_id integer NOT NULL,
  96. time_start_predicted timestamp with time zone,
  97. time_finished_predicted timestamp with time zone,
  98. gap integer
  99. );
  100. ALTER TABLE public.current_timetable OWNER TO postgres;
  101. --
  102. -- Name: current_timetable_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
  103. --
  104. CREATE SEQUENCE public.current_timetable_id_seq
  105. AS integer
  106. START WITH 1
  107. INCREMENT BY 1
  108. NO MINVALUE
  109. NO MAXVALUE
  110. CACHE 1;
  111. ALTER TABLE public.current_timetable_id_seq OWNER TO postgres;
  112. --
  113. -- Name: current_timetable_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
  114. --
  115. ALTER SEQUENCE public.current_timetable_id_seq OWNED BY public.current_timetable.id;
  116. --
  117. -- Name: order_list_log; Type: TABLE; Schema: public; Owner: postgres
  118. --
  119. CREATE TABLE public.order_list_log (
  120. id integer NOT NULL,
  121. payment_transaction_id integer NOT NULL,
  122. service_id integer NOT NULL,
  123. service_type_id integer NOT NULL,
  124. time_placed timestamp with time zone NOT NULL,
  125. time_start timestamp with time zone NOT NULL,
  126. time_finish_predicted timestamp with time zone,
  127. time_finish_real timestamp with time zone NOT NULL,
  128. order_place_start character varying(255) NOT NULL,
  129. order_place_predicted character varying(255) NOT NULL,
  130. order_place_real character varying(255) NOT NULL,
  131. price money NOT NULL,
  132. provider integer NOT NULL,
  133. receiver integer NOT NULL,
  134. client integer NOT NULL
  135. );
  136. ALTER TABLE public.order_list_log OWNER TO postgres;
  137. --
  138. -- Name: order_list_log_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
  139. --
  140. CREATE SEQUENCE public.order_list_log_id_seq
  141. AS integer
  142. START WITH 1
  143. INCREMENT BY 1
  144. NO MINVALUE
  145. NO MAXVALUE
  146. CACHE 1;
  147. ALTER TABLE public.order_list_log_id_seq OWNER TO postgres;
  148. --
  149. -- Name: order_list_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
  150. --
  151. ALTER SEQUENCE public.order_list_log_id_seq OWNED BY public.order_list_log.id;
  152. --
  153. -- Name: tickets; Type: TABLE; Schema: public; Owner: postgres
  154. --
  155. CREATE TABLE public.tickets (
  156. id integer NOT NULL,
  157. type character(1) NOT NULL,
  158. id_reporter integer NOT NULL,
  159. id_asignee integer,
  160. time_created timestamp with time zone NOT NULL,
  161. time_assigned timestamp with time zone,
  162. time_changed timestamp with time zone,
  163. time_closed timestamp with time zone,
  164. status character(1) NOT NULL,
  165. description text
  166. );
  167. ALTER TABLE public.tickets OWNER TO postgres;
  168. --
  169. -- Name: tickets_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
  170. --
  171. CREATE SEQUENCE public.tickets_id_seq
  172. AS integer
  173. START WITH 1
  174. INCREMENT BY 1
  175. NO MINVALUE
  176. NO MAXVALUE
  177. CACHE 1;
  178. ALTER TABLE public.tickets_id_seq OWNER TO postgres;
  179. --
  180. -- Name: tickets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
  181. --
  182. ALTER SEQUENCE public.tickets_id_seq OWNED BY public.tickets.id;
  183. --
  184. -- Name: resourse_log id; Type: DEFAULT; Schema: public; Owner: postgres
  185. --
  186. ALTER TABLE ONLY public.resourse_log ALTER COLUMN id SET DEFAULT nextval('public.resourse_log_id_seq'::regclass);
  187. --
  188. -- Name: current_resourse id; Type: DEFAULT; Schema: public; Owner: postgres
  189. --
  190. ALTER TABLE ONLY public.current_resourse ALTER COLUMN id SET DEFAULT nextval('public.current_resourse_id_seq'::regclass);
  191. --
  192. -- Name: current_timetable id; Type: DEFAULT; Schema: public; Owner: postgres
  193. --
  194. ALTER TABLE ONLY public.current_timetable ALTER COLUMN id SET DEFAULT nextval('public.current_timetable_id_seq'::regclass);
  195. --
  196. -- Name: order_list_log id; Type: DEFAULT; Schema: public; Owner: postgres
  197. --
  198. ALTER TABLE ONLY public.order_list_log ALTER COLUMN id SET DEFAULT nextval('public.order_list_log_id_seq'::regclass);
  199. --
  200. -- Name: tickets id; Type: DEFAULT; Schema: public; Owner: postgres
  201. --
  202. ALTER TABLE ONLY public.tickets ALTER COLUMN id SET DEFAULT nextval('public.tickets_id_seq'::regclass);
  203. --
  204. -- Name: resourse_log resourse_log_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
  205. --
  206. ALTER TABLE ONLY public.resourse_log
  207. ADD CONSTRAINT resourse_log_pkey PRIMARY KEY (id);
  208. --
  209. -- Name: current_resourse current_resourse_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
  210. --
  211. ALTER TABLE ONLY public.current_resourse
  212. ADD CONSTRAINT current_resourse_pkey PRIMARY KEY (id);
  213. --
  214. -- Name: current_timetable current_timetable_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
  215. --
  216. ALTER TABLE ONLY public.current_timetable
  217. ADD CONSTRAINT current_timetable_pkey PRIMARY KEY (id);
  218. --
  219. -- Name: order_list_log order_list_log_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
  220. --
  221. ALTER TABLE ONLY public.order_list_log
  222. ADD CONSTRAINT order_list_log_pkey PRIMARY KEY (id);
  223. --
  224. -- Name: tickets tickets_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
  225. --
  226. ALTER TABLE ONLY public.tickets
  227. ADD CONSTRAINT tickets_pkey PRIMARY KEY (id);
  228. --
  229. -- PostgreSQL database dump complete
  230. --