Postgresql database dump Dumped from database version 5. Dumped by pg dump version 15. Set statement timeout = 0; set lock timeout = 0; set idle in transaction session timeout = 0
Download 14.75 Kb.
|
gm factory
-- -- PostgreSQL database dump -- -- Dumped from database version 15.0 -- Dumped by pg_dump version 15.0 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; -- -- Name: trigger_gm_factory(); Type: FUNCTION; Schema: public; Owner: postgres -- CREATE FUNCTION public.trigger_gm_factory() RETURNS trigger LANGUAGE plpgsql AS $$ begin if TG_OP='INSERT' or TG_OP='UPDATE' then insert into login_GM_factory (tab_name,operation,operation_date,change_data) values(TG_TABLE_NAME,TG_OP,now(),new); else insert into login_GM_factory(tab_name,operation,oper_time,change_data) values(TG_TABLE_NAME,TG_OP,now(),old); end if; return new; end; $$; ALTER FUNCTION public.trigger_gm_factory() OWNER TO postgres; SET default_tablespace = ''; SET default_table_access_method = heap; -- -- Name: employees; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.employees ( id integer NOT NULL, first_name character varying(255) NOT NULL, last_name character varying(255) NOT NULL, "position" character varying(255) NOT NULL, hire_date date NOT NULL ); ALTER TABLE public.employees OWNER TO postgres; -- -- Name: employees_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.employees_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.employees_id_seq OWNER TO postgres; -- -- Name: employees_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.employees_id_seq OWNED BY public.employees.id; -- -- Name: finance; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.finance ( id integer NOT NULL, transaction_date date NOT NULL, description character varying(255) NOT NULL, amount numeric(10,2) NOT NULL, category character varying(255) NOT NULL ); ALTER TABLE public.finance OWNER TO postgres; -- -- Name: finance_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.finance_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.finance_id_seq OWNER TO postgres; -- -- Name: finance_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.finance_id_seq OWNED BY public.finance.id; -- -- Name: login_gm_factory; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.login_gm_factory ( id integer NOT NULL, tab_name text, operation text, operation_date date, transaction_date date NOT NULL, change_date text ); ALTER TABLE public.login_gm_factory OWNER TO postgres; -- -- Name: login_gm_factory_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.login_gm_factory_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.login_gm_factory_id_seq OWNER TO postgres; -- -- Name: login_gm_factory_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.login_gm_factory_id_seq OWNED BY public.login_gm_factory.id; -- -- Name: production_lines; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.production_lines ( id integer NOT NULL, name character varying(255) NOT NULL, vehicle_type character varying(255) NOT NULL ); ALTER TABLE public.production_lines OWNER TO postgres; -- -- Name: production_lines_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.production_lines_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.production_lines_id_seq OWNER TO postgres; -- -- Name: production_lines_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.production_lines_id_seq OWNED BY public.production_lines.id; -- -- Name: production_stats; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.production_stats ( vehicle_make text, vehicle_model text, production_date date, production_count integer, production_line_id integer ); ALTER TABLE public.production_stats OWNER TO postgres; -- -- Name: sales; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.sales ( id integer NOT NULL, vehicle_id integer, employee_id integer, sale_date date NOT NULL, price numeric(10,2) NOT NULL ); ALTER TABLE public.sales OWNER TO postgres; -- -- Name: sales_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.sales_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.sales_id_seq OWNER TO postgres; -- -- Name: sales_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.sales_id_seq OWNED BY public.sales.id; -- -- Name: vehicles; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.vehicles ( id integer NOT NULL, make character varying(255) NOT NULL, model character varying(255) NOT NULL, year integer NOT NULL, color character varying(255) NOT NULL ); ALTER TABLE public.vehicles OWNER TO postgres; -- -- Name: vehicles_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres -- CREATE SEQUENCE public.vehicles_id_seq AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE public.vehicles_id_seq OWNER TO postgres; -- -- Name: vehicles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres -- ALTER SEQUENCE public.vehicles_id_seq OWNED BY public.vehicles.id; -- -- Name: employees id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.employees ALTER COLUMN id SET DEFAULT nextval('public.employees_id_seq'::regclass); -- -- Name: finance id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.finance ALTER COLUMN id SET DEFAULT nextval('public.finance_id_seq'::regclass); -- -- Name: login_gm_factory id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.login_gm_factory ALTER COLUMN id SET DEFAULT nextval('public.login_gm_factory_id_seq'::regclass); -- -- Name: production_lines id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.production_lines ALTER COLUMN id SET DEFAULT nextval('public.production_lines_id_seq'::regclass); -- -- Name: sales id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.sales ALTER COLUMN id SET DEFAULT nextval('public.sales_id_seq'::regclass); -- -- Name: vehicles id; Type: DEFAULT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.vehicles ALTER COLUMN id SET DEFAULT nextval('public.vehicles_id_seq'::regclass); -- -- Data for Name: employees; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public.employees (id, first_name, last_name, "position", hire_date) FROM stdin; 1 John Doe Manager 2022-01-01 2 Jane Smith Assistant Manager 2022-02-01 3 Mike Johnson Salesperson 2022-03-01 4 Samantha Williams Technician 2022-04-01 5 David Jones Office Staff 2022-05-01 6 Emily Brown Manager 2022-06-01 7 Jacob Miller Assistant Manager 2022-07-01 8 Michael Moore Salesperson 2022-08-01 9 Jessica Taylor Technician 2022-09-01 10 Matthew Anderson Office Staff 2022-10-01 11 Joshua Thomas Manager 2022-11-01 12 Daniel Harrison Assistant Manager 2022-12-01 13 Nicholas Garcia Salesperson 2023-01-01 14 Sarah Martinez Technician 2023-02-01 15 Brian Robinson Office Staff 2023-03-01 16 Ashley Clark Manager 2023-04-01 17 Justin Rodriguez Assistant Manager 2023-05-01 18 Amanda Lewis Salesperson 2023-06-01 19 Brandon Walker Technician 2023-07-01 20 Emily Hall Office Staff 2023-08-01 21 Rachel Young Manager 2023-09-01 22 Kevin Allen Assistant Manager 2023-10-01 \. -- -- Data for Name: finance; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public.finance (id, transaction_date, description, amount, category) FROM stdin; \. -- -- Data for Name: login_gm_factory; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public.login_gm_factory (id, tab_name, operation, operation_date, transaction_date, change_date) FROM stdin; \. -- -- Data for Name: production_lines; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public.production_lines (id, name, vehicle_type) FROM stdin; 1 Chevrolet Camaro 2 Dodge Challenger 3 Tesla Model S 4 BMW M3 5 Chevrolet Corvette 6 Ford F-150 7 Dodge Charger 8 Tesla Model 3 \. -- -- Data for Name: production_stats; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public.production_stats (vehicle_make, vehicle_model, production_date, production_count, production_line_id) FROM stdin; Chevrolet Camaro 2022-01-01 100 1 Ford Mustang 2022-01-02 120 2 Dodge Challenger 2022-01-03 90 3 Tesla Model S 2022-01-04 80 4 BMW M3 2022-01-05 110 5 Chevrolet Corvette 2022-01-06 130 1 Ford F-150 2022-01-07 150 2 Dodge Charger 2022-01-08 200 3 Tesla Model 3 2022-01-09 150 4 BMW M5 2022-01-10 180 5 Chevrolet Silverado 2022-01-11 140 1 Ford Mustang GT 2022-01-12 160 2 Dodge Durango 2022-01-13 200 3 Tesla Model Y 2022-01-14 180 4 Chevrolet Equinox 2022-01-15 100 1 Ford Explorer 2022-01-16 120 2 Dodge Journey 2022-01-17 90 3 Tesla Model X 2022-01-18 80 4 BMW X3 2022-01-19 110 5 Chevrolet Malibu 2022-01-20 130 1 Ford Focus 2022-01-21 150 2 \. -- -- Data for Name: sales; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public.sales (id, vehicle_id, employee_id, sale_date, price) FROM stdin; \. -- -- Data for Name: vehicles; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public.vehicles (id, make, model, year, color) FROM stdin; 1 Chevrolet Camaro 2020 Red 2 Ford Mustang 2021 Blue 3 Dodge Challenger 2022 Yellow 4 Tesla Model S 2021 White 5 BMW M3 2020 Black 6 Chevrolet Corvette 2020 Red 7 Ford F-150 2021 Blue 8 Dodge Charger 2022 Yellow 9 Tesla Model 3 2021 White 10 BMW M5 2020 Black 11 Chevrolet Silverado 2020 Red 12 Ford Mustang GT 2021 Blue 13 Dodge Durango 2022 Yellow 14 Tesla Model Y 2021 White 15 BMW X5 2020 Black 16 Chevrolet Tahoe 2020 Red 17 Ford Escape 2021 Blue 18 Dodge Journey 2022 Yellow 19 Tesla Roadster 2021 White 20 BMW X7 2020 Black 21 Chevrolet Traverse 2020 Red 22 Ford Edge 2021 Blue 23 Dodge Grand Caravan 2022 Yellow 24 Tesla Semi 2021 White 25 BMW X3 2020 Black 26 Chevrolet Equinox 2020 Red \. -- -- Name: employees_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public.employees_id_seq', 22, true); -- -- Name: finance_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public.finance_id_seq', 1, false); -- -- Name: login_gm_factory_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public.login_gm_factory_id_seq', 1, false); -- -- Name: production_lines_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public.production_lines_id_seq', 8, true); -- -- Name: sales_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public.sales_id_seq', 1, false); -- -- Name: vehicles_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres -- SELECT pg_catalog.setval('public.vehicles_id_seq', 26, true); -- -- Name: employees employees_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.employees ADD CONSTRAINT employees_pkey PRIMARY KEY (id); -- -- Name: finance finance_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.finance ADD CONSTRAINT finance_pkey PRIMARY KEY (id); -- -- Name: login_gm_factory login_gm_factory_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.login_gm_factory ADD CONSTRAINT login_gm_factory_pkey PRIMARY KEY (id); -- -- Name: production_lines production_lines_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.production_lines ADD CONSTRAINT production_lines_pkey PRIMARY KEY (id); -- -- Name: sales sales_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.sales ADD CONSTRAINT sales_pkey PRIMARY KEY (id); -- -- Name: vehicles vehicles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.vehicles ADD CONSTRAINT vehicles_pkey PRIMARY KEY (id); -- -- Name: employees log_employees; Type: TRIGGER; Schema: public; Owner: postgres -- CREATE TRIGGER log_employees BEFORE INSERT OR DELETE OR UPDATE ON public.employees FOR EACH ROW EXECUTE FUNCTION public.trigger_gm_factory(); -- -- Name: finance log_finance; Type: TRIGGER; Schema: public; Owner: postgres -- CREATE TRIGGER log_finance BEFORE INSERT OR DELETE OR UPDATE ON public.finance FOR EACH ROW EXECUTE FUNCTION public.trigger_gm_factory(); -- -- Name: sales log_sales; Type: TRIGGER; Schema: public; Owner: postgres -- CREATE TRIGGER log_sales BEFORE INSERT OR DELETE OR UPDATE ON public.sales FOR EACH ROW EXECUTE FUNCTION public.trigger_gm_factory(); -- -- Name: vehicles log_vehicles; Type: TRIGGER; Schema: public; Owner: postgres -- CREATE TRIGGER log_vehicles BEFORE INSERT OR DELETE OR UPDATE ON public.vehicles FOR EACH ROW EXECUTE FUNCTION public.trigger_gm_factory(); -- -- Name: production_stats production_stats_production_line_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.production_stats ADD CONSTRAINT production_stats_production_line_id_fkey FOREIGN KEY (production_line_id) REFERENCES public.production_lines(id); -- -- Name: sales sales_employee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.sales ADD CONSTRAINT sales_employee_id_fkey FOREIGN KEY (employee_id) REFERENCES public.employees(id); -- -- Name: sales sales_vehicle_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.sales ADD CONSTRAINT sales_vehicle_id_fkey FOREIGN KEY (vehicle_id) REFERENCES public.vehicles(id); -- -- PostgreSQL database dump complete -- Download 14.75 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling