123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681 |
- --
- -- PostgreSQL database dump
- --
- -- Dumped from database version 12.7
- -- Dumped by pg_dump version 12.7
- 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;
- SET default_tablespace = '';
- SET default_table_access_method = heap;
- --
- -- Name: client; Type: TABLE; Schema: public; Owner: postgres
- --
- CREATE TABLE public.client (
- id integer NOT NULL,
- user_id integer NOT NULL,
- requirements name NOT NULL,
- status character(1) DEFAULT 'A'::bpchar,
- ticket_status integer,
- id_metaservice integer NOT NULL,
- is_global character(1) NOT NULL,
- is_visible character(1) NOT NULL
- );
- ALTER TABLE public.client OWNER TO postgres;
- --
- -- Name: client_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
- --
- CREATE SEQUENCE public.client_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
- ALTER TABLE public.client_id_seq OWNER TO postgres;
- --
- -- Name: client_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
- --
- ALTER SEQUENCE public.client_id_seq OWNED BY public.client.id;
- --
- -- Name: company; Type: TABLE; Schema: public; Owner: postgres
- --
- CREATE TABLE public.company (
- id integer NOT NULL,
- legal_name character varying(255) NOT NULL,
- repr_id integer NOT NULL,
- kpp character varying(9) NOT NULL,
- ogrn character varying(13) NOT NULL,
- bank_name character varying(255) NOT NULL,
- bik character varying(9) NOT NULL,
- ks integer NOT NULL,
- rs integer NOT NULL,
- address character varying(255) NOT NULL,
- id_metaservice integer,
- is_global character(1) NOT NULL,
- is_visible character(1) NOT NULL,
- requirements name,
- status character(1) DEFAULT 'A'::bpchar,
- ticket_status integer
- );
- ALTER TABLE public.company OWNER TO postgres;
- --
- -- Name: company_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
- --
- CREATE SEQUENCE public.company_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
- ALTER TABLE public.company_id_seq OWNER TO postgres;
- --
- -- Name: company_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
- --
- ALTER SEQUENCE public.company_id_seq OWNED BY public.company.id;
- --
- -- Name: current_orders; Type: TABLE; Schema: public; Owner: postgres
- --
- CREATE TABLE public.current_orders (
- id integer NOT NULL,
- service_id integer NOT NULL,
- service_type_id integer NOT NULL,
- state integer NOT NULL,
- id_metaservice integer NOT NULL,
- time_created timestamp with time zone NOT NULL,
- time_placed timestamp with time zone NOT NULL,
- time_start timestamp with time zone NOT NULL,
- time_finish_predicted timestamp with time zone NOT NULL,
- time_finish_real timestamp with time zone NOT NULL,
- provider_id integer NOT NULL,
- receiver_id integer NOT NULL,
- client_id integer NOT NULL,
- predicted_price money NOT NULL,
- real_price money NOT NULL,
- is_global character(1) NOT NULL,
- is_visible character(1) NOT NULL
- );
- ALTER TABLE public.current_orders OWNER TO postgres;
- --
- -- Name: current_orders_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
- --
- CREATE SEQUENCE public.current_orders_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
- ALTER TABLE public.current_orders_id_seq OWNER TO postgres;
- --
- -- Name: current_orders_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
- --
- ALTER SEQUENCE public.current_orders_id_seq OWNED BY public.current_orders.id;
- --
- -- Name: documents; Type: TABLE; Schema: public; Owner: postgres
- --
- CREATE TABLE public.documents (
- id integer NOT NULL,
- id_metaservice integer NOT NULL,
- doctype character varying(2) NOT NULL,
- expire_date date NOT NULL,
- datalink name,
- user_id integer NOT NULL,
- company_id integer,
- is_global character(1) NOT NULL,
- is_visible character(1) NOT NULL,
- check_level character(1),
- check_by integer,
- check_date timestamp with time zone,
- status character(1),
- ticket_status integer
- );
- ALTER TABLE public.documents OWNER TO postgres;
- --
- -- Name: documents_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
- --
- CREATE SEQUENCE public.documents_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
- ALTER TABLE public.documents_id_seq OWNER TO postgres;
- --
- -- Name: documents_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
- --
- ALTER SEQUENCE public.documents_id_seq OWNED BY public.documents.id;
- --
- -- Name: permissions; Type: TABLE; Schema: public; Owner: postgres
- --
- CREATE TABLE public.permissions (
- id integer NOT NULL,
- id_metaservice integer NOT NULL,
- id_permission integer NOT NULL,
- user_id integer NOT NULL,
- is_global character(1) NOT NULL,
- is_visible character(1) NOT NULL,
- check_level character(1),
- check_by integer,
- check_date timestamp with time zone NOT NULL,
- status character(1),
- ticket_status integer
- );
- ALTER TABLE public.permissions OWNER TO postgres;
- --
- -- Name: permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
- --
- CREATE SEQUENCE public.permissions_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
- ALTER TABLE public.permissions_id_seq OWNER TO postgres;
- --
- -- Name: permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
- --
- ALTER SEQUENCE public.permissions_id_seq OWNED BY public.permissions.id;
- --
- -- Name: provider; Type: TABLE; Schema: public; Owner: postgres
- --
- CREATE TABLE public.provider (
- id integer NOT NULL,
- type integer NOT NULL,
- id_company integer NOT NULL,
- user_id integer NOT NULL,
- requirements name NOT NULL,
- status character(1) DEFAULT 'A'::bpchar,
- ticket_status integer,
- id_metaservice integer NOT NULL,
- is_global character(1) NOT NULL,
- is_visible character(1) NOT NULL,
- location_type name NOT NULL,
- default_location name NOT NULL
- );
- ALTER TABLE public.provider OWNER TO postgres;
- --
- -- Name: provider_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
- --
- CREATE SEQUENCE public.provider_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
- ALTER TABLE public.provider_id_seq OWNER TO postgres;
- --
- -- Name: provider_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
- --
- ALTER SEQUENCE public.provider_id_seq OWNED BY public.provider.id;
- --
- -- Name: relationship; Type: TABLE; Schema: public; Owner: postgres
- --
- CREATE TABLE public.relationship (
- id integer NOT NULL,
- user_id_who integer NOT NULL,
- user_id_whom integer NOT NULL,
- neg_type character(1) NOT NULL,
- id_metaservice integer,
- is_global character(1) NOT NULL,
- is_visible character(1) NOT NULL,
- requirements name,
- status character(1) DEFAULT 'A'::bpchar,
- ticket_status integer
- );
- ALTER TABLE public.relationship OWNER TO postgres;
- --
- -- Name: relationship_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
- --
- CREATE SEQUENCE public.relationship_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
- ALTER TABLE public.relationship_id_seq OWNER TO postgres;
- --
- -- Name: relationship_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
- --
- ALTER SEQUENCE public.relationship_id_seq OWNED BY public.relationship.id;
- --
- -- Name: resource; Type: TABLE; Schema: public; Owner: postgres
- --
- CREATE TABLE public.resource (
- id integer NOT NULL,
- type_id integer NOT NULL,
- user_id integer NOT NULL,
- requirements name NOT NULL,
- status character(1) DEFAULT 'A'::bpchar,
- ticket_status integer,
- id_metaservice integer NOT NULL,
- is_global character(1) NOT NULL,
- is_visible character(1) NOT NULL
- );
- ALTER TABLE public.resource OWNER TO postgres;
- --
- -- Name: resource_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
- --
- CREATE SEQUENCE public.resource_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
- ALTER TABLE public.resource_id_seq OWNER TO postgres;
- --
- -- Name: resource_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
- --
- ALTER SEQUENCE public.resource_id_seq OWNED BY public.resource.id;
- --
- -- Name: service; Type: TABLE; Schema: public; Owner: postgres
- --
- CREATE TABLE public.service (
- id integer NOT NULL,
- servicetype_id integer NOT NULL,
- id_provider integer NOT NULL,
- resourse_id integer NOT NULL,
- price_alg character varying(255) NOT NULL,
- price_km money NOT NULL,
- price_min money NOT NULL,
- price_amount money NOT NULL,
- id_metaservice integer,
- is_global character(1) NOT NULL,
- is_visible character(1) NOT NULL,
- requirements name,
- status character(1) DEFAULT 'A'::bpchar,
- ticket_status integer
- );
- ALTER TABLE public.service OWNER TO postgres;
- --
- -- Name: service_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
- --
- CREATE SEQUENCE public.service_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
- ALTER TABLE public.service_id_seq OWNER TO postgres;
- --
- -- Name: service_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
- --
- ALTER SEQUENCE public.service_id_seq OWNED BY public.service.id;
- --
- -- Name: servicetype; Type: TABLE; Schema: public; Owner: postgres
- --
- CREATE TABLE public.servicetype (
- id integer NOT NULL,
- caption character varying(255) NOT NULL,
- description text NOT NULL,
- pricetype integer NOT NULL,
- id_metaservice integer,
- is_global character(1) NOT NULL,
- is_visible character(1) NOT NULL,
- requirements name,
- status character(1) DEFAULT 'A'::bpchar,
- ticket_status integer
- );
- ALTER TABLE public.servicetype OWNER TO postgres;
- --
- -- Name: servicetype_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
- --
- CREATE SEQUENCE public.servicetype_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
- ALTER TABLE public.servicetype_id_seq OWNER TO postgres;
- --
- -- Name: servicetype_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
- --
- ALTER SEQUENCE public.servicetype_id_seq OWNED BY public.servicetype.id;
- --
- -- Name: client id; Type: DEFAULT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.client ALTER COLUMN id SET DEFAULT nextval('public.client_id_seq'::regclass);
- --
- -- Name: company id; Type: DEFAULT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.company ALTER COLUMN id SET DEFAULT nextval('public.company_id_seq'::regclass);
- --
- -- Name: current_orders id; Type: DEFAULT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.current_orders ALTER COLUMN id SET DEFAULT nextval('public.current_orders_id_seq'::regclass);
- --
- -- Name: documents id; Type: DEFAULT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.documents ALTER COLUMN id SET DEFAULT nextval('public.documents_id_seq'::regclass);
- --
- -- Name: permissions id; Type: DEFAULT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.permissions ALTER COLUMN id SET DEFAULT nextval('public.permissions_id_seq'::regclass);
- --
- -- Name: provider id; Type: DEFAULT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.provider ALTER COLUMN id SET DEFAULT nextval('public.provider_id_seq'::regclass);
- --
- -- Name: relationship id; Type: DEFAULT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.relationship ALTER COLUMN id SET DEFAULT nextval('public.relationship_id_seq'::regclass);
- --
- -- Name: resource id; Type: DEFAULT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.resource ALTER COLUMN id SET DEFAULT nextval('public.resource_id_seq'::regclass);
- --
- -- Name: service id; Type: DEFAULT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.service ALTER COLUMN id SET DEFAULT nextval('public.service_id_seq'::regclass);
- --
- -- Name: servicetype id; Type: DEFAULT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.servicetype ALTER COLUMN id SET DEFAULT nextval('public.servicetype_id_seq'::regclass);
- --
- -- Name: client client_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.client
- ADD CONSTRAINT client_pkey PRIMARY KEY (id);
- --
- -- Name: company company_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.company
- ADD CONSTRAINT company_pkey PRIMARY KEY (id);
- --
- -- Name: current_orders current_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.current_orders
- ADD CONSTRAINT current_orders_pkey PRIMARY KEY (id);
- --
- -- Name: documents documents_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.documents
- ADD CONSTRAINT documents_pkey PRIMARY KEY (id);
- --
- -- Name: permissions permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.permissions
- ADD CONSTRAINT permissions_pkey PRIMARY KEY (id);
- --
- -- Name: provider provider_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.provider
- ADD CONSTRAINT provider_pkey PRIMARY KEY (id);
- --
- -- Name: relationship relationship_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.relationship
- ADD CONSTRAINT relationship_pkey PRIMARY KEY (id);
- --
- -- Name: resource resource_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.resource
- ADD CONSTRAINT resource_pkey PRIMARY KEY (id);
- --
- -- Name: service service_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.service
- ADD CONSTRAINT service_pkey PRIMARY KEY (id);
- --
- -- Name: servicetype servicetype_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.servicetype
- ADD CONSTRAINT servicetype_pkey PRIMARY KEY (id);
- --
- -- Name: current_orders current_orders_client_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.current_orders
- ADD CONSTRAINT current_orders_client_id_fkey FOREIGN KEY (client_id) REFERENCES public.client(id);
- --
- -- Name: current_orders current_orders_provider_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.current_orders
- ADD CONSTRAINT current_orders_provider_id_fkey FOREIGN KEY (provider_id) REFERENCES public.provider(id);
- --
- -- Name: current_orders current_orders_service_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.current_orders
- ADD CONSTRAINT current_orders_service_id_fkey FOREIGN KEY (service_id) REFERENCES public.service(id);
- --
- -- Name: current_orders current_orders_service_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.current_orders
- ADD CONSTRAINT current_orders_service_type_id_fkey FOREIGN KEY (service_type_id) REFERENCES public.servicetype(id);
- --
- -- Name: documents documents_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.documents
- ADD CONSTRAINT documents_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.company(id);
- --
- -- Name: service service_id_provider_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.service
- ADD CONSTRAINT service_id_provider_fkey FOREIGN KEY (id_provider) REFERENCES public.provider(id);
- --
- -- Name: service service_resourse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.service
- ADD CONSTRAINT service_resourse_id_fkey FOREIGN KEY (resourse_id) REFERENCES public.resource(id);
- --
- -- Name: service service_servicetype_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
- --
- ALTER TABLE ONLY public.service
- ADD CONSTRAINT service_servicetype_id_fkey FOREIGN KEY (servicetype_id) REFERENCES public.servicetype(id);
- --
- -- PostgreSQL database dump complete
- --
|