浏览代码

rename columns

danila.staroverov 2 年之前
父节点
当前提交
e83d1d6edf
共有 2 个文件被更改,包括 153 次插入0 次删除
  1. 121 0
      sharix_open_schema.sql
  2. 32 0
      sharix_open_testdata.sql

+ 121 - 0
sharix_open_schema.sql

@@ -20,6 +20,43 @@ SET default_tablespace = '';
 
 SET default_table_access_method = heap;
 
+--
+-- Name: cars_log; Type: TABLE; Schema: public; Owner: postgres
+--
+
+CREATE TABLE public.cars_log (
+    id integer NOT NULL,
+    resource_id integer NOT NULL,
+    time_log_created timestamp with time zone NOT NULL,
+    operation character(1) NOT NULL,
+    user_id integer NOT NULL
+);
+
+
+ALTER TABLE public.cars_log OWNER TO postgres;
+
+--
+-- Name: cars_log_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
+--
+
+CREATE SEQUENCE public.cars_log_id_seq
+    AS integer
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.cars_log_id_seq OWNER TO postgres;
+
+--
+-- Name: cars_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
+--
+
+ALTER SEQUENCE public.cars_log_id_seq OWNED BY public.cars_log.id;
+
+
 --
 -- Name: client; Type: TABLE; Schema: public; Owner: postgres
 --
@@ -86,6 +123,60 @@ CREATE TABLE public.company (
 
 ALTER TABLE public.company OWNER TO postgres;
 
+--
+-- Name: current_cars; Type: TABLE; Schema: public; Owner: postgres
+--
+
+CREATE TABLE public.current_cars (
+    id integer NOT NULL,
+    resource_id integer NOT NULL,
+    user_id integer NOT NULL,
+    order_status character(1),
+    order_id character(1),
+    current_token name NOT NULL,
+    doors_output character(1) NOT NULL,
+    engine_input character(1) NOT NULL,
+    central_lock_input character(1) NOT NULL,
+    ignition_input character(1) NOT NULL,
+    doors_input character(1) NOT NULL,
+    input4 name,
+    controller_status character(1) NOT NULL,
+    signal_gsm integer NOT NULL,
+    operator_gsm name NOT NULL,
+    signal_gps integer NOT NULL,
+    location character varying(30),
+    speed real NOT NULL,
+    direction character(1) NOT NULL,
+    address name NOT NULL,
+    battery_level integer NOT NULL,
+    board_voltage numeric(3,1) NOT NULL
+);
+
+
+ALTER TABLE public.current_cars OWNER TO postgres;
+
+--
+-- Name: current_cars_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
+--
+
+CREATE SEQUENCE public.current_cars_id_seq
+    AS integer
+    START WITH 1
+    INCREMENT BY 1
+    NO MINVALUE
+    NO MAXVALUE
+    CACHE 1;
+
+
+ALTER TABLE public.current_cars_id_seq OWNER TO postgres;
+
+--
+-- Name: current_cars_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
+--
+
+ALTER SEQUENCE public.current_cars_id_seq OWNED BY public.current_cars.id;
+
+
 --
 -- Name: current_orders; Type: TABLE; Schema: public; Owner: postgres
 --
@@ -630,6 +721,13 @@ CREATE TABLE public.users (
 
 ALTER TABLE public.users OWNER TO drive;
 
+--
+-- Name: cars_log id; Type: DEFAULT; Schema: public; Owner: postgres
+--
+
+ALTER TABLE ONLY public.cars_log ALTER COLUMN id SET DEFAULT nextval('public.cars_log_id_seq'::regclass);
+
+
 --
 -- Name: client id; Type: DEFAULT; Schema: public; Owner: postgres
 --
@@ -637,6 +735,13 @@ ALTER TABLE public.users OWNER TO drive;
 ALTER TABLE ONLY public.client ALTER COLUMN id SET DEFAULT nextval('public.client_id_seq'::regclass);
 
 
+--
+-- Name: current_cars id; Type: DEFAULT; Schema: public; Owner: postgres
+--
+
+ALTER TABLE ONLY public.current_cars ALTER COLUMN id SET DEFAULT nextval('public.current_cars_id_seq'::regclass);
+
+
 --
 -- Name: current_orders id; Type: DEFAULT; Schema: public; Owner: postgres
 --
@@ -721,6 +826,14 @@ ALTER TABLE ONLY public.servicetype ALTER COLUMN id SET DEFAULT nextval('public.
 ALTER TABLE ONLY public.tickets ALTER COLUMN id SET DEFAULT nextval('public.tickets_id_seq'::regclass);
 
 
+--
+-- Name: cars_log cars_log_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
+--
+
+ALTER TABLE ONLY public.cars_log
+    ADD CONSTRAINT cars_log_pkey PRIMARY KEY (id);
+
+
 --
 -- Name: client client_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
 --
@@ -737,6 +850,14 @@ ALTER TABLE ONLY public.company
     ADD CONSTRAINT company_pkey PRIMARY KEY (id);
 
 
+--
+-- Name: current_cars current_cars_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
+--
+
+ALTER TABLE ONLY public.current_cars
+    ADD CONSTRAINT current_cars_pkey PRIMARY KEY (id);
+
+
 --
 -- Name: current_orders current_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
 --

+ 32 - 0
sharix_open_testdata.sql

@@ -16,6 +16,15 @@ SET xmloption = content;
 SET client_min_messages = warning;
 SET row_security = off;
 
+--
+-- Data for Name: cars_log; Type: TABLE DATA; Schema: public; Owner: postgres
+--
+
+COPY public.cars_log (id, resource_id, time_log_created, operation, user_id) FROM stdin;
+1	1	2022-04-17 22:59:55+03	O	23
+\.
+
+
 --
 -- Data for Name: client; Type: TABLE DATA; Schema: public; Owner: postgres
 --
@@ -34,6 +43,15 @@ COPY public.company (id, legal_name, provider_id, kpp, ogrn, bank_name, bik, ks,
 \.
 
 
+--
+-- Data for Name: current_cars; Type: TABLE DATA; Schema: public; Owner: postgres
+--
+
+COPY public.current_cars (id, resource_id, user_id, order_status, order_id, current_token, doors_output, engine_input, central_lock_input, ignition_input, doors_input, input4, controller_status, signal_gsm, operator_gsm, signal_gps, location, speed, direction, address, battery_level, board_voltage) FROM stdin;
+1	1	1	\N	\N	ghjkdgfshkl	C	O	C	O	C	\N	n	100	Мегафон	123	-22.951916, -43.2104872	90	N	Тверская область, город Щёлково, ш	45	12.6
+\.
+
+
 --
 -- Data for Name: current_orders; Type: TABLE DATA; Schema: public; Owner: postgres
 --
@@ -146,6 +164,13 @@ COPY public.users (id, name, access, login, password) FROM stdin;
 \.
 
 
+--
+-- Name: cars_log_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
+--
+
+SELECT pg_catalog.setval('public.cars_log_id_seq', 1, true);
+
+
 --
 -- Name: client_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
 --
@@ -153,6 +178,13 @@ COPY public.users (id, name, access, login, password) FROM stdin;
 SELECT pg_catalog.setval('public.client_id_seq', 1, true);
 
 
+--
+-- Name: current_cars_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
+--
+
+SELECT pg_catalog.setval('public.current_cars_id_seq', 1, true);
+
+
 --
 -- Name: current_orders_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
 --