|
@@ -102,9 +102,9 @@ ALTER SEQUENCE public.client_id_seq OWNED BY public.client.id;
|
|
|
--
|
|
|
|
|
|
CREATE TABLE public.company (
|
|
|
- id character varying(10) NOT NULL,
|
|
|
+ id integer NOT NULL,
|
|
|
legal_name character varying(255) NOT NULL,
|
|
|
- provider_id integer 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,
|
|
@@ -123,6 +123,28 @@ CREATE TABLE public.company (
|
|
|
|
|
|
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_cars; Type: TABLE; Schema: public; Owner: postgres
|
|
|
--
|
|
@@ -195,8 +217,8 @@ CREATE TABLE public.current_orders (
|
|
|
provider_id integer NOT NULL,
|
|
|
receiver_id integer NOT NULL,
|
|
|
client_id integer NOT NULL,
|
|
|
- predicted_price numeric(10,2) NOT NULL,
|
|
|
- real_price numeric(10,2) NOT NULL,
|
|
|
+ predicted_price money NOT NULL,
|
|
|
+ real_price money NOT NULL,
|
|
|
is_global character(1) NOT NULL,
|
|
|
is_visible character(1) NOT NULL
|
|
|
);
|
|
@@ -226,6 +248,44 @@ ALTER TABLE public.current_orders_id_seq OWNER TO postgres;
|
|
|
ALTER SEQUENCE public.current_orders_id_seq OWNED BY public.current_orders.id;
|
|
|
|
|
|
|
|
|
+--
|
|
|
+-- Name: current_resources; Type: TABLE; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+CREATE TABLE public.current_resources (
|
|
|
+ id integer NOT NULL,
|
|
|
+ resource_id integer NOT NULL,
|
|
|
+ operation text NOT NULL,
|
|
|
+ user_id integer NOT NULL,
|
|
|
+ current_token text NOT NULL,
|
|
|
+ state integer NOT NULL
|
|
|
+);
|
|
|
+
|
|
|
+
|
|
|
+ALTER TABLE public.current_resources OWNER TO postgres;
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: current_resources_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+CREATE SEQUENCE public.current_resources_id_seq
|
|
|
+ AS integer
|
|
|
+ START WITH 1
|
|
|
+ INCREMENT BY 1
|
|
|
+ NO MINVALUE
|
|
|
+ NO MAXVALUE
|
|
|
+ CACHE 1;
|
|
|
+
|
|
|
+
|
|
|
+ALTER TABLE public.current_resources_id_seq OWNER TO postgres;
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: current_resources_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER SEQUENCE public.current_resources_id_seq OWNED BY public.current_resources.id;
|
|
|
+
|
|
|
+
|
|
|
--
|
|
|
-- Name: current_timetable; Type: TABLE; Schema: public; Owner: postgres
|
|
|
--
|
|
@@ -235,7 +295,7 @@ CREATE TABLE public.current_timetable (
|
|
|
order_id integer NOT NULL,
|
|
|
service_type_id integer NOT NULL,
|
|
|
provider_id integer NOT NULL,
|
|
|
- resource_id integer,
|
|
|
+ resource_id integer NOT NULL,
|
|
|
time_start_predicted timestamp with time zone,
|
|
|
time_finished_predicted timestamp with time zone,
|
|
|
gap integer
|
|
@@ -267,10 +327,10 @@ ALTER SEQUENCE public.current_timetable_id_seq OWNED BY public.current_timetable
|
|
|
|
|
|
|
|
|
--
|
|
|
--- Name: documents; Type: TABLE; Schema: public; Owner: postgres
|
|
|
+-- Name: document; Type: TABLE; Schema: public; Owner: postgres
|
|
|
--
|
|
|
|
|
|
-CREATE TABLE public.documents (
|
|
|
+CREATE TABLE public.document (
|
|
|
id integer NOT NULL,
|
|
|
id_metaservice integer NOT NULL,
|
|
|
doctype character varying(2) NOT NULL,
|
|
@@ -288,13 +348,87 @@ CREATE TABLE public.documents (
|
|
|
);
|
|
|
|
|
|
|
|
|
-ALTER TABLE public.documents OWNER TO postgres;
|
|
|
+ALTER TABLE public.document OWNER TO postgres;
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: document_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+CREATE SEQUENCE public.document_id_seq
|
|
|
+ AS integer
|
|
|
+ START WITH 1
|
|
|
+ INCREMENT BY 1
|
|
|
+ NO MINVALUE
|
|
|
+ NO MAXVALUE
|
|
|
+ CACHE 1;
|
|
|
+
|
|
|
+
|
|
|
+ALTER TABLE public.document_id_seq OWNER TO postgres;
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: document_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER SEQUENCE public.document_id_seq OWNED BY public.document.id;
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: metaservice; Type: TABLE; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+CREATE TABLE public.metaservice (
|
|
|
+ id integer NOT NULL,
|
|
|
+ metaservicename text NOT NULL,
|
|
|
+ legalname text NOT NULL,
|
|
|
+ representative integer NOT NULL
|
|
|
+);
|
|
|
+
|
|
|
+
|
|
|
+ALTER TABLE public.metaservice OWNER TO postgres;
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: metaservice_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+CREATE SEQUENCE public.metaservice_id_seq
|
|
|
+ AS integer
|
|
|
+ START WITH 1
|
|
|
+ INCREMENT BY 1
|
|
|
+ NO MINVALUE
|
|
|
+ NO MAXVALUE
|
|
|
+ CACHE 1;
|
|
|
+
|
|
|
+
|
|
|
+ALTER TABLE public.metaservice_id_seq OWNER TO postgres;
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: metaservice_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER SEQUENCE public.metaservice_id_seq OWNED BY public.metaservice.id;
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: metauser; Type: TABLE; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+CREATE TABLE public.metauser (
|
|
|
+ id integer NOT NULL,
|
|
|
+ email text NOT NULL,
|
|
|
+ name text NOT NULL,
|
|
|
+ surname text NOT NULL,
|
|
|
+ phone text NOT NULL,
|
|
|
+ password text NOT NULL
|
|
|
+);
|
|
|
+
|
|
|
+
|
|
|
+ALTER TABLE public.metauser OWNER TO postgres;
|
|
|
|
|
|
--
|
|
|
--- Name: documents_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
|
|
|
+-- Name: metauser_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
|
|
|
--
|
|
|
|
|
|
-CREATE SEQUENCE public.documents_id_seq
|
|
|
+CREATE SEQUENCE public.metauser_id_seq
|
|
|
AS integer
|
|
|
START WITH 1
|
|
|
INCREMENT BY 1
|
|
@@ -303,41 +437,42 @@ CREATE SEQUENCE public.documents_id_seq
|
|
|
CACHE 1;
|
|
|
|
|
|
|
|
|
-ALTER TABLE public.documents_id_seq OWNER TO postgres;
|
|
|
+ALTER TABLE public.metauser_id_seq OWNER TO postgres;
|
|
|
|
|
|
--
|
|
|
--- Name: documents_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
|
|
|
+-- Name: metauser_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
|
|
|
--
|
|
|
|
|
|
-ALTER SEQUENCE public.documents_id_seq OWNED BY public.documents.id;
|
|
|
+ALTER SEQUENCE public.metauser_id_seq OWNED BY public.metauser.id;
|
|
|
|
|
|
|
|
|
--
|
|
|
--- Name: order_list_log; Type: TABLE; Schema: public; Owner: sharix
|
|
|
+-- Name: order_list_log; Type: TABLE; Schema: public; Owner: postgres
|
|
|
--
|
|
|
|
|
|
CREATE TABLE public.order_list_log (
|
|
|
id integer NOT NULL,
|
|
|
- payment_transaction_id integer,
|
|
|
- service_id integer,
|
|
|
- time_placed timestamp with time zone,
|
|
|
- time_start timestamp with time zone,
|
|
|
+ payment_transaction_id integer NOT NULL,
|
|
|
+ service_id integer NOT NULL,
|
|
|
+ service_type_id integer 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,
|
|
|
- time_finish_real timestamp with time zone,
|
|
|
- order_place_start name,
|
|
|
- order_place_predicted name,
|
|
|
- order_place_real name,
|
|
|
- price integer,
|
|
|
- provider integer,
|
|
|
- receiver integer,
|
|
|
- client integer
|
|
|
+ time_finish_real timestamp with time zone NOT NULL,
|
|
|
+ order_place_start character varying(255) NOT NULL,
|
|
|
+ order_place_predicted character varying(255) NOT NULL,
|
|
|
+ order_place_real character varying(255) NOT NULL,
|
|
|
+ price money NOT NULL,
|
|
|
+ provider integer NOT NULL,
|
|
|
+ receiver integer NOT NULL,
|
|
|
+ client integer NOT NULL
|
|
|
);
|
|
|
|
|
|
|
|
|
-ALTER TABLE public.order_list_log OWNER TO sharix;
|
|
|
+ALTER TABLE public.order_list_log OWNER TO postgres;
|
|
|
|
|
|
--
|
|
|
--- Name: order_list_log_id_seq; Type: SEQUENCE; Schema: public; Owner: sharix
|
|
|
+-- Name: order_list_log_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
|
|
|
--
|
|
|
|
|
|
CREATE SEQUENCE public.order_list_log_id_seq
|
|
@@ -349,10 +484,10 @@ CREATE SEQUENCE public.order_list_log_id_seq
|
|
|
CACHE 1;
|
|
|
|
|
|
|
|
|
-ALTER TABLE public.order_list_log_id_seq OWNER TO sharix;
|
|
|
+ALTER TABLE public.order_list_log_id_seq OWNER TO postgres;
|
|
|
|
|
|
--
|
|
|
--- Name: order_list_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: sharix
|
|
|
+-- Name: order_list_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
|
|
|
--
|
|
|
|
|
|
ALTER SEQUENCE public.order_list_log_id_seq OWNED BY public.order_list_log.id;
|
|
@@ -500,9 +635,9 @@ ALTER SEQUENCE public.provider_id_seq OWNED BY public.provider.id;
|
|
|
|
|
|
CREATE TABLE public.relationship (
|
|
|
id integer NOT NULL,
|
|
|
- user_id_who integer,
|
|
|
- user_id_whom integer,
|
|
|
- neg_type character(1),
|
|
|
+ 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,
|
|
@@ -577,6 +712,42 @@ ALTER TABLE public.resource_id_seq OWNER TO postgres;
|
|
|
ALTER SEQUENCE public.resource_id_seq OWNED BY public.resource.id;
|
|
|
|
|
|
|
|
|
+--
|
|
|
+-- Name: resource_log; Type: TABLE; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+CREATE TABLE public.resource_log (
|
|
|
+ id integer NOT NULL,
|
|
|
+ resource_id integer NOT NULL,
|
|
|
+ operation text,
|
|
|
+ user_id integer
|
|
|
+);
|
|
|
+
|
|
|
+
|
|
|
+ALTER TABLE public.resource_log OWNER TO postgres;
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: resource_log_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+CREATE SEQUENCE public.resource_log_id_seq
|
|
|
+ AS integer
|
|
|
+ START WITH 1
|
|
|
+ INCREMENT BY 1
|
|
|
+ NO MINVALUE
|
|
|
+ NO MAXVALUE
|
|
|
+ CACHE 1;
|
|
|
+
|
|
|
+
|
|
|
+ALTER TABLE public.resource_log_id_seq OWNER TO postgres;
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: resource_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER SEQUENCE public.resource_log_id_seq OWNED BY public.resource_log.id;
|
|
|
+
|
|
|
+
|
|
|
--
|
|
|
-- Name: service; Type: TABLE; Schema: public; Owner: postgres
|
|
|
--
|
|
@@ -587,9 +758,9 @@ CREATE TABLE public.service (
|
|
|
id_provider integer NOT NULL,
|
|
|
resourse_id integer NOT NULL,
|
|
|
price_alg character varying(255) NOT NULL,
|
|
|
- price_km integer NOT NULL,
|
|
|
- price_min integer NOT NULL,
|
|
|
- price_amount integer 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,
|
|
@@ -666,26 +837,26 @@ ALTER SEQUENCE public.servicetype_id_seq OWNED BY public.servicetype.id;
|
|
|
|
|
|
|
|
|
--
|
|
|
--- Name: tickets; Type: TABLE; Schema: public; Owner: sharix
|
|
|
+-- Name: tickets; Type: TABLE; Schema: public; Owner: postgres
|
|
|
--
|
|
|
|
|
|
CREATE TABLE public.tickets (
|
|
|
id integer NOT NULL,
|
|
|
- id_reporter integer,
|
|
|
+ id_reporter integer NOT NULL,
|
|
|
id_asignee integer,
|
|
|
- time_created timestamp with time zone,
|
|
|
+ time_created timestamp with time zone NOT NULL,
|
|
|
time_assigned timestamp with time zone,
|
|
|
time_changed timestamp with time zone,
|
|
|
time_closed timestamp with time zone,
|
|
|
- status integer,
|
|
|
+ status character(1) NOT NULL,
|
|
|
description text
|
|
|
);
|
|
|
|
|
|
|
|
|
-ALTER TABLE public.tickets OWNER TO sharix;
|
|
|
+ALTER TABLE public.tickets OWNER TO postgres;
|
|
|
|
|
|
--
|
|
|
--- Name: tickets_id_seq; Type: SEQUENCE; Schema: public; Owner: sharix
|
|
|
+-- Name: tickets_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
|
|
|
--
|
|
|
|
|
|
CREATE SEQUENCE public.tickets_id_seq
|
|
@@ -697,29 +868,51 @@ CREATE SEQUENCE public.tickets_id_seq
|
|
|
CACHE 1;
|
|
|
|
|
|
|
|
|
-ALTER TABLE public.tickets_id_seq OWNER TO sharix;
|
|
|
+ALTER TABLE public.tickets_id_seq OWNER TO postgres;
|
|
|
|
|
|
--
|
|
|
--- Name: tickets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: sharix
|
|
|
+-- Name: tickets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
|
|
|
--
|
|
|
|
|
|
ALTER SEQUENCE public.tickets_id_seq OWNED BY public.tickets.id;
|
|
|
|
|
|
|
|
|
--
|
|
|
--- Name: users; Type: TABLE; Schema: public; Owner: drive
|
|
|
+-- Name: user_to_metaservice; Type: TABLE; Schema: public; Owner: postgres
|
|
|
--
|
|
|
|
|
|
-CREATE TABLE public.users (
|
|
|
- id integer DEFAULT 0 NOT NULL,
|
|
|
- name text,
|
|
|
- access text,
|
|
|
- login text,
|
|
|
- password text
|
|
|
+CREATE TABLE public.user_to_metaservice (
|
|
|
+ id integer NOT NULL,
|
|
|
+ user_id integer NOT NULL,
|
|
|
+ id_metaservice integer NOT NULL,
|
|
|
+ is_active character(1) NOT NULL,
|
|
|
+ status character(1) NOT NULL
|
|
|
);
|
|
|
|
|
|
|
|
|
-ALTER TABLE public.users OWNER TO drive;
|
|
|
+ALTER TABLE public.user_to_metaservice OWNER TO postgres;
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: user_to_metaservice_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+CREATE SEQUENCE public.user_to_metaservice_id_seq
|
|
|
+ AS integer
|
|
|
+ START WITH 1
|
|
|
+ INCREMENT BY 1
|
|
|
+ NO MINVALUE
|
|
|
+ NO MAXVALUE
|
|
|
+ CACHE 1;
|
|
|
+
|
|
|
+
|
|
|
+ALTER TABLE public.user_to_metaservice_id_seq OWNER TO postgres;
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: user_to_metaservice_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER SEQUENCE public.user_to_metaservice_id_seq OWNED BY public.user_to_metaservice.id;
|
|
|
+
|
|
|
|
|
|
--
|
|
|
-- Name: cars_log id; Type: DEFAULT; Schema: public; Owner: postgres
|
|
@@ -735,6 +928,13 @@ ALTER TABLE ONLY public.cars_log ALTER COLUMN id SET DEFAULT nextval('public.car
|
|
|
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_cars id; Type: DEFAULT; Schema: public; Owner: postgres
|
|
|
--
|
|
@@ -749,6 +949,13 @@ ALTER TABLE ONLY public.current_cars ALTER COLUMN id SET DEFAULT nextval('public
|
|
|
ALTER TABLE ONLY public.current_orders ALTER COLUMN id SET DEFAULT nextval('public.current_orders_id_seq'::regclass);
|
|
|
|
|
|
|
|
|
+--
|
|
|
+-- Name: current_resources id; Type: DEFAULT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.current_resources ALTER COLUMN id SET DEFAULT nextval('public.current_resources_id_seq'::regclass);
|
|
|
+
|
|
|
+
|
|
|
--
|
|
|
-- Name: current_timetable id; Type: DEFAULT; Schema: public; Owner: postgres
|
|
|
--
|
|
@@ -757,14 +964,28 @@ ALTER TABLE ONLY public.current_timetable ALTER COLUMN id SET DEFAULT nextval('p
|
|
|
|
|
|
|
|
|
--
|
|
|
--- Name: documents id; Type: DEFAULT; Schema: public; Owner: postgres
|
|
|
+-- Name: document id; Type: DEFAULT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.document ALTER COLUMN id SET DEFAULT nextval('public.document_id_seq'::regclass);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: metaservice id; Type: DEFAULT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.metaservice ALTER COLUMN id SET DEFAULT nextval('public.metaservice_id_seq'::regclass);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: metauser id; Type: DEFAULT; Schema: public; Owner: postgres
|
|
|
--
|
|
|
|
|
|
-ALTER TABLE ONLY public.documents ALTER COLUMN id SET DEFAULT nextval('public.documents_id_seq'::regclass);
|
|
|
+ALTER TABLE ONLY public.metauser ALTER COLUMN id SET DEFAULT nextval('public.metauser_id_seq'::regclass);
|
|
|
|
|
|
|
|
|
--
|
|
|
--- Name: order_list_log id; Type: DEFAULT; Schema: public; Owner: sharix
|
|
|
+-- Name: order_list_log id; Type: DEFAULT; Schema: public; Owner: postgres
|
|
|
--
|
|
|
|
|
|
ALTER TABLE ONLY public.order_list_log ALTER COLUMN id SET DEFAULT nextval('public.order_list_log_id_seq'::regclass);
|
|
@@ -805,6 +1026,13 @@ ALTER TABLE ONLY public.relationship ALTER COLUMN id SET DEFAULT nextval('public
|
|
|
ALTER TABLE ONLY public.resource ALTER COLUMN id SET DEFAULT nextval('public.resource_id_seq'::regclass);
|
|
|
|
|
|
|
|
|
+--
|
|
|
+-- Name: resource_log id; Type: DEFAULT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.resource_log ALTER COLUMN id SET DEFAULT nextval('public.resource_log_id_seq'::regclass);
|
|
|
+
|
|
|
+
|
|
|
--
|
|
|
-- Name: service id; Type: DEFAULT; Schema: public; Owner: postgres
|
|
|
--
|
|
@@ -820,12 +1048,19 @@ ALTER TABLE ONLY public.servicetype ALTER COLUMN id SET DEFAULT nextval('public.
|
|
|
|
|
|
|
|
|
--
|
|
|
--- Name: tickets id; Type: DEFAULT; Schema: public; Owner: sharix
|
|
|
+-- Name: tickets id; Type: DEFAULT; Schema: public; Owner: postgres
|
|
|
--
|
|
|
|
|
|
ALTER TABLE ONLY public.tickets ALTER COLUMN id SET DEFAULT nextval('public.tickets_id_seq'::regclass);
|
|
|
|
|
|
|
|
|
+--
|
|
|
+-- Name: user_to_metaservice id; Type: DEFAULT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.user_to_metaservice ALTER COLUMN id SET DEFAULT nextval('public.user_to_metaservice_id_seq'::regclass);
|
|
|
+
|
|
|
+
|
|
|
--
|
|
|
-- Name: cars_log cars_log_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
|
|
|
--
|
|
@@ -866,6 +1101,14 @@ ALTER TABLE ONLY public.current_orders
|
|
|
ADD CONSTRAINT current_orders_pkey PRIMARY KEY (id);
|
|
|
|
|
|
|
|
|
+--
|
|
|
+-- Name: current_resources current_resources_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.current_resources
|
|
|
+ ADD CONSTRAINT current_resources_pkey PRIMARY KEY (id);
|
|
|
+
|
|
|
+
|
|
|
--
|
|
|
-- Name: current_timetable current_timetable_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
|
|
|
--
|
|
@@ -875,15 +1118,39 @@ ALTER TABLE ONLY public.current_timetable
|
|
|
|
|
|
|
|
|
--
|
|
|
--- Name: documents documents_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+-- Name: document document_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.document
|
|
|
+ ADD CONSTRAINT document_pkey PRIMARY KEY (id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: metaservice metaservice_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.metaservice
|
|
|
+ ADD CONSTRAINT metaservice_pkey PRIMARY KEY (id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: metauser metauser_email_key; Type: CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.metauser
|
|
|
+ ADD CONSTRAINT metauser_email_key UNIQUE (email);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: metauser metauser_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
|
|
|
--
|
|
|
|
|
|
-ALTER TABLE ONLY public.documents
|
|
|
- ADD CONSTRAINT documents_pkey PRIMARY KEY (id);
|
|
|
+ALTER TABLE ONLY public.metauser
|
|
|
+ ADD CONSTRAINT metauser_pkey PRIMARY KEY (id);
|
|
|
|
|
|
|
|
|
--
|
|
|
--- Name: order_list_log order_list_log_pkey; Type: CONSTRAINT; Schema: public; Owner: sharix
|
|
|
+-- Name: order_list_log order_list_log_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
|
|
|
--
|
|
|
|
|
|
ALTER TABLE ONLY public.order_list_log
|
|
@@ -922,6 +1189,14 @@ ALTER TABLE ONLY public.relationship
|
|
|
ADD CONSTRAINT relationship_pkey PRIMARY KEY (id);
|
|
|
|
|
|
|
|
|
+--
|
|
|
+-- Name: resource_log resource_log_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.resource_log
|
|
|
+ ADD CONSTRAINT resource_log_pkey PRIMARY KEY (id);
|
|
|
+
|
|
|
+
|
|
|
--
|
|
|
-- Name: resource resource_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
|
|
|
--
|
|
@@ -947,13 +1222,469 @@ ALTER TABLE ONLY public.servicetype
|
|
|
|
|
|
|
|
|
--
|
|
|
--- Name: tickets tickets_pkey; Type: CONSTRAINT; Schema: public; Owner: sharix
|
|
|
+-- Name: tickets tickets_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
|
|
|
--
|
|
|
|
|
|
ALTER TABLE ONLY public.tickets
|
|
|
ADD CONSTRAINT tickets_pkey PRIMARY KEY (id);
|
|
|
|
|
|
|
|
|
+--
|
|
|
+-- Name: user_to_metaservice user_to_metaservice_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.user_to_metaservice
|
|
|
+ ADD CONSTRAINT user_to_metaservice_pkey PRIMARY KEY (id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: client client_id_metaservice_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.client
|
|
|
+ ADD CONSTRAINT client_id_metaservice_fkey FOREIGN KEY (id_metaservice) REFERENCES public.metaservice(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: client client_ticket_status_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.client
|
|
|
+ ADD CONSTRAINT client_ticket_status_fkey FOREIGN KEY (ticket_status) REFERENCES public.tickets(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: client client_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.client
|
|
|
+ ADD CONSTRAINT client_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.metauser(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: company company_id_metaservice_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.company
|
|
|
+ ADD CONSTRAINT company_id_metaservice_fkey FOREIGN KEY (id_metaservice) REFERENCES public.metaservice(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: company company_repr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.company
|
|
|
+ ADD CONSTRAINT company_repr_id_fkey FOREIGN KEY (repr_id) REFERENCES public.metauser(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: company company_ticket_status_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.company
|
|
|
+ ADD CONSTRAINT company_ticket_status_fkey FOREIGN KEY (ticket_status) REFERENCES public.tickets(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_id_metaservice_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.current_orders
|
|
|
+ ADD CONSTRAINT current_orders_id_metaservice_fkey FOREIGN KEY (id_metaservice) REFERENCES public.metaservice(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_receiver_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.current_orders
|
|
|
+ ADD CONSTRAINT current_orders_receiver_id_fkey FOREIGN KEY (receiver_id) REFERENCES public.metauser(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: current_resources current_resources_resource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.current_resources
|
|
|
+ ADD CONSTRAINT current_resources_resource_id_fkey FOREIGN KEY (resource_id) REFERENCES public.resource(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: current_resources current_resources_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.current_resources
|
|
|
+ ADD CONSTRAINT current_resources_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.metauser(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: current_timetable current_timetable_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.current_timetable
|
|
|
+ ADD CONSTRAINT current_timetable_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.current_orders(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: current_timetable current_timetable_provider_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.current_timetable
|
|
|
+ ADD CONSTRAINT current_timetable_provider_id_fkey FOREIGN KEY (provider_id) REFERENCES public.provider(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: current_timetable current_timetable_resource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.current_timetable
|
|
|
+ ADD CONSTRAINT current_timetable_resource_id_fkey FOREIGN KEY (resource_id) REFERENCES public.resource(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: current_timetable current_timetable_service_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.current_timetable
|
|
|
+ ADD CONSTRAINT current_timetable_service_type_id_fkey FOREIGN KEY (service_type_id) REFERENCES public.servicetype(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: document document_check_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.document
|
|
|
+ ADD CONSTRAINT document_check_by_fkey FOREIGN KEY (check_by) REFERENCES public.metauser(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: document document_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.document
|
|
|
+ ADD CONSTRAINT document_company_id_fkey FOREIGN KEY (company_id) REFERENCES public.company(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: document document_id_metaservice_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.document
|
|
|
+ ADD CONSTRAINT document_id_metaservice_fkey FOREIGN KEY (id_metaservice) REFERENCES public.metaservice(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: document document_ticket_status_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.document
|
|
|
+ ADD CONSTRAINT document_ticket_status_fkey FOREIGN KEY (ticket_status) REFERENCES public.tickets(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: document document_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.document
|
|
|
+ ADD CONSTRAINT document_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.metauser(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: metaservice metaservice_representative_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.metaservice
|
|
|
+ ADD CONSTRAINT metaservice_representative_fkey FOREIGN KEY (representative) REFERENCES public.metauser(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: order_list_log order_list_log_client_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.order_list_log
|
|
|
+ ADD CONSTRAINT order_list_log_client_fkey FOREIGN KEY (client) REFERENCES public.client(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: order_list_log order_list_log_provider_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.order_list_log
|
|
|
+ ADD CONSTRAINT order_list_log_provider_fkey FOREIGN KEY (provider) REFERENCES public.provider(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: order_list_log order_list_log_receiver_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.order_list_log
|
|
|
+ ADD CONSTRAINT order_list_log_receiver_fkey FOREIGN KEY (receiver) REFERENCES public.metauser(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: order_list_log order_list_log_service_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.order_list_log
|
|
|
+ ADD CONSTRAINT order_list_log_service_id_fkey FOREIGN KEY (service_id) REFERENCES public.service(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: order_list_log order_list_log_service_type_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.order_list_log
|
|
|
+ ADD CONSTRAINT order_list_log_service_type_id_fkey FOREIGN KEY (service_type_id) REFERENCES public.servicetype(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: permissions permissions_check_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.permissions
|
|
|
+ ADD CONSTRAINT permissions_check_by_fkey FOREIGN KEY (check_by) REFERENCES public.metauser(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: permissions permissions_id_metaservice_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.permissions
|
|
|
+ ADD CONSTRAINT permissions_id_metaservice_fkey FOREIGN KEY (id_metaservice) REFERENCES public.metaservice(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: permissions permissions_ticket_status_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.permissions
|
|
|
+ ADD CONSTRAINT permissions_ticket_status_fkey FOREIGN KEY (ticket_status) REFERENCES public.tickets(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: permissions permissions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.permissions
|
|
|
+ ADD CONSTRAINT permissions_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.metauser(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: provider provider_id_company_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.provider
|
|
|
+ ADD CONSTRAINT provider_id_company_fkey FOREIGN KEY (id_company) REFERENCES public.company(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: provider provider_id_metaservice_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.provider
|
|
|
+ ADD CONSTRAINT provider_id_metaservice_fkey FOREIGN KEY (id_metaservice) REFERENCES public.metaservice(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: provider provider_ticket_status_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.provider
|
|
|
+ ADD CONSTRAINT provider_ticket_status_fkey FOREIGN KEY (ticket_status) REFERENCES public.tickets(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: provider provider_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.provider
|
|
|
+ ADD CONSTRAINT provider_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.metauser(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: relationship relationship_id_metaservice_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.relationship
|
|
|
+ ADD CONSTRAINT relationship_id_metaservice_fkey FOREIGN KEY (id_metaservice) REFERENCES public.metaservice(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: relationship relationship_user_id_who_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.relationship
|
|
|
+ ADD CONSTRAINT relationship_user_id_who_fkey FOREIGN KEY (user_id_who) REFERENCES public.metauser(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: relationship relationship_user_id_whom_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.relationship
|
|
|
+ ADD CONSTRAINT relationship_user_id_whom_fkey FOREIGN KEY (user_id_whom) REFERENCES public.metauser(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: resource resource_id_metaservice_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.resource
|
|
|
+ ADD CONSTRAINT resource_id_metaservice_fkey FOREIGN KEY (id_metaservice) REFERENCES public.metaservice(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: resource_log resource_log_resource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.resource_log
|
|
|
+ ADD CONSTRAINT resource_log_resource_id_fkey FOREIGN KEY (resource_id) REFERENCES public.resource(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: resource_log resource_log_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.resource_log
|
|
|
+ ADD CONSTRAINT resource_log_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.metauser(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: resource resource_ticket_status_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.resource
|
|
|
+ ADD CONSTRAINT resource_ticket_status_fkey FOREIGN KEY (ticket_status) REFERENCES public.tickets(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: resource resource_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.resource
|
|
|
+ ADD CONSTRAINT resource_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.metauser(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: service service_id_metaservice_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.service
|
|
|
+ ADD CONSTRAINT service_id_metaservice_fkey FOREIGN KEY (id_metaservice) REFERENCES public.metaservice(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);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: service service_ticket_status_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.service
|
|
|
+ ADD CONSTRAINT service_ticket_status_fkey FOREIGN KEY (ticket_status) REFERENCES public.tickets(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: servicetype servicetype_id_metaservice_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.servicetype
|
|
|
+ ADD CONSTRAINT servicetype_id_metaservice_fkey FOREIGN KEY (id_metaservice) REFERENCES public.metaservice(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: servicetype servicetype_ticket_status_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.servicetype
|
|
|
+ ADD CONSTRAINT servicetype_ticket_status_fkey FOREIGN KEY (ticket_status) REFERENCES public.tickets(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: tickets tickets_id_asignee_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.tickets
|
|
|
+ ADD CONSTRAINT tickets_id_asignee_fkey FOREIGN KEY (id_asignee) REFERENCES public.metauser(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: tickets tickets_id_reporter_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.tickets
|
|
|
+ ADD CONSTRAINT tickets_id_reporter_fkey FOREIGN KEY (id_reporter) REFERENCES public.metauser(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: user_to_metaservice user_to_metaservice_id_metaservice_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.user_to_metaservice
|
|
|
+ ADD CONSTRAINT user_to_metaservice_id_metaservice_fkey FOREIGN KEY (id_metaservice) REFERENCES public.metaservice(id);
|
|
|
+
|
|
|
+
|
|
|
+--
|
|
|
+-- Name: user_to_metaservice user_to_metaservice_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
|
+--
|
|
|
+
|
|
|
+ALTER TABLE ONLY public.user_to_metaservice
|
|
|
+ ADD CONSTRAINT user_to_metaservice_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.metauser(id);
|
|
|
+
|
|
|
+
|
|
|
--
|
|
|
-- PostgreSQL database dump complete
|
|
|
--
|