sharix_open_local_schema.sql 6.5 KB

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