744 lines
18 KiB
SQL
744 lines
18 KiB
SQL
--
|
|
-- PostgreSQL database cluster dump
|
|
--
|
|
|
|
SET default_transaction_read_only = off;
|
|
|
|
SET client_encoding = 'UTF8';
|
|
SET standard_conforming_strings = on;
|
|
|
|
--
|
|
-- Drop databases (except postgres and template1)
|
|
--
|
|
|
|
DROP DATABASE IF EXISTS swe2;
|
|
|
|
|
|
|
|
|
|
--
|
|
-- Drop roles
|
|
--
|
|
|
|
DROP ROLE IF EXISTS hm;
|
|
|
|
|
|
--
|
|
-- Roles
|
|
--
|
|
|
|
CREATE ROLE hm;
|
|
ALTER ROLE hm WITH SUPERUSER INHERIT CREATEROLE CREATEDB LOGIN REPLICATION BYPASSRLS PASSWORD 'SCRAM-SHA-256$4096:Qu2zguYpk/SVWlVo7HCsVw==$NuyEzFF5rOP7FfSiwEX7Qct2ZSiWwNjiDXBocnBcdRg=:zX9sMsngj3ubPnkaKqEmicV5BT3bYhsSMWizrsET3XA=';
|
|
|
|
--
|
|
-- User Configurations
|
|
--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
-- Databases
|
|
--
|
|
|
|
--
|
|
-- Database "template1" dump
|
|
--
|
|
|
|
--
|
|
-- PostgreSQL database dump
|
|
--
|
|
|
|
-- Dumped from database version 17.5
|
|
-- Dumped by pg_dump version 17.5
|
|
|
|
SET statement_timeout = 0;
|
|
SET lock_timeout = 0;
|
|
SET idle_in_transaction_session_timeout = 0;
|
|
SET transaction_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;
|
|
|
|
UPDATE pg_catalog.pg_database SET datistemplate = false WHERE datname = 'template1';
|
|
DROP DATABASE template1;
|
|
--
|
|
-- Name: template1; Type: DATABASE; Schema: -; Owner: hm
|
|
--
|
|
|
|
CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE_PROVIDER = libc LOCALE = 'en_US.utf8';
|
|
|
|
|
|
ALTER DATABASE template1 OWNER TO hm;
|
|
|
|
\connect template1
|
|
|
|
SET statement_timeout = 0;
|
|
SET lock_timeout = 0;
|
|
SET idle_in_transaction_session_timeout = 0;
|
|
SET transaction_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: DATABASE template1; Type: COMMENT; Schema: -; Owner: hm
|
|
--
|
|
|
|
COMMENT ON DATABASE template1 IS 'default template for new databases';
|
|
|
|
|
|
--
|
|
-- Name: template1; Type: DATABASE PROPERTIES; Schema: -; Owner: hm
|
|
--
|
|
|
|
ALTER DATABASE template1 IS_TEMPLATE = true;
|
|
|
|
|
|
\connect template1
|
|
|
|
SET statement_timeout = 0;
|
|
SET lock_timeout = 0;
|
|
SET idle_in_transaction_session_timeout = 0;
|
|
SET transaction_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: DATABASE template1; Type: ACL; Schema: -; Owner: hm
|
|
--
|
|
|
|
REVOKE CONNECT,TEMPORARY ON DATABASE template1 FROM PUBLIC;
|
|
GRANT CONNECT ON DATABASE template1 TO PUBLIC;
|
|
|
|
|
|
--
|
|
-- PostgreSQL database dump complete
|
|
--
|
|
|
|
--
|
|
-- Database "postgres" dump
|
|
--
|
|
|
|
--
|
|
-- PostgreSQL database dump
|
|
--
|
|
|
|
-- Dumped from database version 17.5
|
|
-- Dumped by pg_dump version 17.5
|
|
|
|
SET statement_timeout = 0;
|
|
SET lock_timeout = 0;
|
|
SET idle_in_transaction_session_timeout = 0;
|
|
SET transaction_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;
|
|
|
|
DROP DATABASE postgres;
|
|
--
|
|
-- Name: postgres; Type: DATABASE; Schema: -; Owner: hm
|
|
--
|
|
|
|
CREATE DATABASE postgres WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE_PROVIDER = libc LOCALE = 'en_US.utf8';
|
|
|
|
|
|
ALTER DATABASE postgres OWNER TO hm;
|
|
|
|
\connect postgres
|
|
|
|
SET statement_timeout = 0;
|
|
SET lock_timeout = 0;
|
|
SET idle_in_transaction_session_timeout = 0;
|
|
SET transaction_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: DATABASE postgres; Type: COMMENT; Schema: -; Owner: hm
|
|
--
|
|
|
|
COMMENT ON DATABASE postgres IS 'default administrative connection database';
|
|
|
|
|
|
--
|
|
-- PostgreSQL database dump complete
|
|
--
|
|
|
|
--
|
|
-- Database "swe2" dump
|
|
--
|
|
|
|
--
|
|
-- PostgreSQL database dump
|
|
--
|
|
|
|
-- Dumped from database version 17.5
|
|
-- Dumped by pg_dump version 17.5
|
|
|
|
SET statement_timeout = 0;
|
|
SET lock_timeout = 0;
|
|
SET idle_in_transaction_session_timeout = 0;
|
|
SET transaction_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: swe2; Type: DATABASE; Schema: -; Owner: hm
|
|
--
|
|
|
|
CREATE DATABASE swe2 WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE_PROVIDER = libc LOCALE = 'en_US.utf8';
|
|
|
|
|
|
ALTER DATABASE swe2 OWNER TO hm;
|
|
|
|
\connect swe2
|
|
|
|
SET statement_timeout = 0;
|
|
SET lock_timeout = 0;
|
|
SET idle_in_transaction_session_timeout = 0;
|
|
SET transaction_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: addition_booking_types; Type: TABLE; Schema: public; Owner: hm
|
|
--
|
|
|
|
CREATE TABLE public.addition_booking_types (
|
|
id uuid NOT NULL,
|
|
name character varying(255),
|
|
price real
|
|
);
|
|
|
|
|
|
ALTER TABLE public.addition_booking_types OWNER TO hm;
|
|
|
|
--
|
|
-- Name: addition_bookings; Type: TABLE; Schema: public; Owner: hm
|
|
--
|
|
|
|
CREATE TABLE public.addition_bookings (
|
|
id uuid NOT NULL,
|
|
end_date date,
|
|
start_date date,
|
|
addition_booking_type_id uuid,
|
|
room_booking_id uuid
|
|
);
|
|
|
|
|
|
ALTER TABLE public.addition_bookings OWNER TO hm;
|
|
|
|
--
|
|
-- Name: addresses; Type: TABLE; Schema: public; Owner: hm
|
|
--
|
|
|
|
CREATE TABLE public.addresses (
|
|
id uuid NOT NULL,
|
|
city character varying(255),
|
|
house_number character varying(255),
|
|
postal_code character varying(255),
|
|
street character varying(255)
|
|
);
|
|
|
|
|
|
ALTER TABLE public.addresses OWNER TO hm;
|
|
|
|
--
|
|
-- Name: room_bookings; Type: TABLE; Schema: public; Owner: hm
|
|
--
|
|
|
|
CREATE TABLE public.room_bookings (
|
|
id uuid NOT NULL,
|
|
end_date date,
|
|
start_date date,
|
|
room_id uuid,
|
|
user_id uuid
|
|
);
|
|
|
|
|
|
ALTER TABLE public.room_bookings OWNER TO hm;
|
|
|
|
--
|
|
-- Name: room_features; Type: TABLE; Schema: public; Owner: hm
|
|
--
|
|
|
|
CREATE TABLE public.room_features (
|
|
room_id uuid NOT NULL,
|
|
features character varying(255)
|
|
);
|
|
|
|
|
|
ALTER TABLE public.room_features OWNER TO hm;
|
|
|
|
--
|
|
-- Name: room_types; Type: TABLE; Schema: public; Owner: hm
|
|
--
|
|
|
|
CREATE TABLE public.room_types (
|
|
id bigint NOT NULL,
|
|
name character varying(255)
|
|
);
|
|
|
|
|
|
ALTER TABLE public.room_types OWNER TO hm;
|
|
|
|
--
|
|
-- Name: room_types_id_seq; Type: SEQUENCE; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE public.room_types ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
|
|
SEQUENCE NAME public.room_types_id_seq
|
|
START WITH 1
|
|
INCREMENT BY 1
|
|
NO MINVALUE
|
|
NO MAXVALUE
|
|
CACHE 1
|
|
);
|
|
|
|
|
|
--
|
|
-- Name: rooms; Type: TABLE; Schema: public; Owner: hm
|
|
--
|
|
|
|
CREATE TABLE public.rooms (
|
|
id uuid NOT NULL,
|
|
beds integer NOT NULL,
|
|
image_url character varying(255),
|
|
name character varying(255),
|
|
price real NOT NULL,
|
|
room_type_id bigint
|
|
);
|
|
|
|
|
|
ALTER TABLE public.rooms OWNER TO hm;
|
|
|
|
--
|
|
-- Name: user_identity; Type: TABLE; Schema: public; Owner: hm
|
|
--
|
|
|
|
CREATE TABLE public.user_identity (
|
|
identity_type character varying(31) NOT NULL,
|
|
id bigint NOT NULL,
|
|
hash character varying(255),
|
|
user_id uuid NOT NULL
|
|
);
|
|
|
|
|
|
ALTER TABLE public.user_identity OWNER TO hm;
|
|
|
|
--
|
|
-- Name: user_identity_id_seq; Type: SEQUENCE; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE public.user_identity ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
|
|
SEQUENCE NAME public.user_identity_id_seq
|
|
START WITH 1
|
|
INCREMENT BY 1
|
|
NO MINVALUE
|
|
NO MAXVALUE
|
|
CACHE 1
|
|
);
|
|
|
|
|
|
--
|
|
-- Name: user_roles; Type: TABLE; Schema: public; Owner: hm
|
|
--
|
|
|
|
CREATE TABLE public.user_roles (
|
|
user_id uuid NOT NULL,
|
|
role character varying(255),
|
|
CONSTRAINT user_roles_role_check CHECK (((role)::text = ANY ((ARRAY['CUSTOMER'::character varying, 'ADMIN'::character varying])::text[])))
|
|
);
|
|
|
|
|
|
ALTER TABLE public.user_roles OWNER TO hm;
|
|
|
|
--
|
|
-- Name: users; Type: TABLE; Schema: public; Owner: hm
|
|
--
|
|
|
|
CREATE TABLE public.users (
|
|
id uuid NOT NULL,
|
|
email character varying(255)
|
|
);
|
|
|
|
|
|
ALTER TABLE public.users OWNER TO hm;
|
|
|
|
--
|
|
-- Name: users_addresses; Type: TABLE; Schema: public; Owner: hm
|
|
--
|
|
|
|
CREATE TABLE public.users_addresses (
|
|
user_id uuid NOT NULL,
|
|
address_id uuid NOT NULL
|
|
);
|
|
|
|
|
|
ALTER TABLE public.users_addresses OWNER TO hm;
|
|
|
|
--
|
|
-- Data for Name: addition_booking_types; Type: TABLE DATA; Schema: public; Owner: hm
|
|
--
|
|
|
|
COPY public.addition_booking_types (id, name, price) FROM stdin;
|
|
574abdd4-92c2-4371-9038-f4b1f989b340 Porsche 200
|
|
a10ae929-576e-4637-aad9-71f73230d4f1 Wellness 50
|
|
\.
|
|
|
|
|
|
--
|
|
-- Data for Name: addition_bookings; Type: TABLE DATA; Schema: public; Owner: hm
|
|
--
|
|
|
|
COPY public.addition_bookings (id, end_date, start_date, addition_booking_type_id, room_booking_id) FROM stdin;
|
|
\.
|
|
|
|
|
|
--
|
|
-- Data for Name: addresses; Type: TABLE DATA; Schema: public; Owner: hm
|
|
--
|
|
|
|
COPY public.addresses (id, city, house_number, postal_code, street) FROM stdin;
|
|
\.
|
|
|
|
|
|
--
|
|
-- Data for Name: room_bookings; Type: TABLE DATA; Schema: public; Owner: hm
|
|
--
|
|
|
|
COPY public.room_bookings (id, end_date, start_date, room_id, user_id) FROM stdin;
|
|
\.
|
|
|
|
|
|
--
|
|
-- Data for Name: room_features; Type: TABLE DATA; Schema: public; Owner: hm
|
|
--
|
|
|
|
COPY public.room_features (room_id, features) FROM stdin;
|
|
24d96973-6f4f-4e15-96c8-492592a51c1d Klimaanlage
|
|
24d96973-6f4f-4e15-96c8-492592a51c1d WLAN
|
|
24d96973-6f4f-4e15-96c8-492592a51c1d Flachbild-TV
|
|
24d96973-6f4f-4e15-96c8-492592a51c1d Minibar
|
|
378fd3a5-e020-4531-9685-61169b890655 Klimaanlage
|
|
378fd3a5-e020-4531-9685-61169b890655 WLAN
|
|
378fd3a5-e020-4531-9685-61169b890655 Minibar
|
|
378fd3a5-e020-4531-9685-61169b890655 Balkon
|
|
9a85b75b-c39c-4898-b456-bf89788f2c6e Klimaanlage
|
|
9a85b75b-c39c-4898-b456-bf89788f2c6e WLAN
|
|
9a85b75b-c39c-4898-b456-bf89788f2c6e Küchenzeile
|
|
9a85b75b-c39c-4898-b456-bf89788f2c6e Sofabett
|
|
06f9159f-f5dc-47f7-a2a9-2bc4702787b1 WLAN
|
|
06f9159f-f5dc-47f7-a2a9-2bc4702787b1 Schreibtisch
|
|
0f2a3dd0-b2ab-4cd8-9cfb-d2f4c07e1d36 Klimaanlage
|
|
0f2a3dd0-b2ab-4cd8-9cfb-d2f4c07e1d36 WLAN
|
|
0f2a3dd0-b2ab-4cd8-9cfb-d2f4c07e1d36 Minibar
|
|
0f2a3dd0-b2ab-4cd8-9cfb-d2f4c07e1d36 Seeblick
|
|
0f2a3dd0-b2ab-4cd8-9cfb-d2f4c07e1d36 Whirlpool
|
|
09f453b2-7930-4f68-8d64-92f7faece4a0 Klimaanlage
|
|
09f453b2-7930-4f68-8d64-92f7faece4a0 WLAN
|
|
09f453b2-7930-4f68-8d64-92f7faece4a0 Kochnische
|
|
09f453b2-7930-4f68-8d64-92f7faece4a0 Arbeitsbereich
|
|
\.
|
|
|
|
|
|
--
|
|
-- Data for Name: room_types; Type: TABLE DATA; Schema: public; Owner: hm
|
|
--
|
|
|
|
COPY public.room_types (id, name) FROM stdin;
|
|
1 Standard-Room
|
|
\.
|
|
|
|
|
|
--
|
|
-- Data for Name: rooms; Type: TABLE DATA; Schema: public; Owner: hm
|
|
--
|
|
|
|
COPY public.rooms (id, beds, image_url, name, price, room_type_id) FROM stdin;
|
|
24d96973-6f4f-4e15-96c8-492592a51c1d 2 https://images.unsplash.com/photo-1566665797739-1674de7a421a?auto=format&fit=crop&w=800&q=60 Standard Doppelzimmer 129 1
|
|
378fd3a5-e020-4531-9685-61169b890655 2 https://images.unsplash.com/photo-1578683010236-d716f9a3f461?auto=format&fit=crop&w=800&q=60 Superior Suite 199 1
|
|
9a85b75b-c39c-4898-b456-bf89788f2c6e 4 https://images.unsplash.com/photo-1586023492125-27b2c045efd7?auto=format&fit=crop&w=800&q=60 Familienzimmer 249 1
|
|
06f9159f-f5dc-47f7-a2a9-2bc4702787b1 1 https://images.unsplash.com/photo-1595576508898-0ad5c879a061?auto=format&fit=crop&w=800&q=60 Einzelzimmer Economy 89 1
|
|
0f2a3dd0-b2ab-4cd8-9cfb-d2f4c07e1d36 2 https://images.unsplash.com/photo-1505693416388-ac5ce068fe85?auto=format&fit=crop&w=800&q=60 Deluxe Suite mit Seeblick 299 1
|
|
09f453b2-7930-4f68-8d64-92f7faece4a0 2 https://images.unsplash.com/photo-1522708323590-d24dbb6b0267?auto=format&fit=crop&w=800&q=60 Studio Apartment 179 1
|
|
\.
|
|
|
|
|
|
--
|
|
-- Data for Name: user_identity; Type: TABLE DATA; Schema: public; Owner: hm
|
|
--
|
|
|
|
COPY public.user_identity (identity_type, id, hash, user_id) FROM stdin;
|
|
\.
|
|
|
|
|
|
--
|
|
-- Data for Name: user_roles; Type: TABLE DATA; Schema: public; Owner: hm
|
|
--
|
|
|
|
COPY public.user_roles (user_id, role) FROM stdin;
|
|
\.
|
|
|
|
|
|
--
|
|
-- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: hm
|
|
--
|
|
|
|
COPY public.users (id, email) FROM stdin;
|
|
\.
|
|
|
|
|
|
--
|
|
-- Data for Name: users_addresses; Type: TABLE DATA; Schema: public; Owner: hm
|
|
--
|
|
|
|
COPY public.users_addresses (user_id, address_id) FROM stdin;
|
|
\.
|
|
|
|
|
|
--
|
|
-- Name: room_types_id_seq; Type: SEQUENCE SET; Schema: public; Owner: hm
|
|
--
|
|
|
|
SELECT pg_catalog.setval('public.room_types_id_seq', 1, false);
|
|
|
|
|
|
--
|
|
-- Name: user_identity_id_seq; Type: SEQUENCE SET; Schema: public; Owner: hm
|
|
--
|
|
|
|
SELECT pg_catalog.setval('public.user_identity_id_seq', 1, false);
|
|
|
|
|
|
--
|
|
-- Name: addition_booking_types addition_booking_types_pkey; Type: CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.addition_booking_types
|
|
ADD CONSTRAINT addition_booking_types_pkey PRIMARY KEY (id);
|
|
|
|
|
|
--
|
|
-- Name: addition_bookings addition_bookings_pkey; Type: CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.addition_bookings
|
|
ADD CONSTRAINT addition_bookings_pkey PRIMARY KEY (id);
|
|
|
|
|
|
--
|
|
-- Name: addresses addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.addresses
|
|
ADD CONSTRAINT addresses_pkey PRIMARY KEY (id);
|
|
|
|
|
|
--
|
|
-- Name: room_bookings room_bookings_pkey; Type: CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.room_bookings
|
|
ADD CONSTRAINT room_bookings_pkey PRIMARY KEY (id);
|
|
|
|
|
|
--
|
|
-- Name: room_types room_types_pkey; Type: CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.room_types
|
|
ADD CONSTRAINT room_types_pkey PRIMARY KEY (id);
|
|
|
|
|
|
--
|
|
-- Name: rooms rooms_pkey; Type: CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.rooms
|
|
ADD CONSTRAINT rooms_pkey PRIMARY KEY (id);
|
|
|
|
|
|
--
|
|
-- Name: addition_booking_types uk4s1rioppwy61o71buupr6ewb; Type: CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.addition_booking_types
|
|
ADD CONSTRAINT uk4s1rioppwy61o71buupr6ewb UNIQUE (name);
|
|
|
|
|
|
--
|
|
-- Name: users uk6dotkott2kjsp8vw4d0m25fb7; Type: CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.users
|
|
ADD CONSTRAINT uk6dotkott2kjsp8vw4d0m25fb7 UNIQUE (email);
|
|
|
|
|
|
--
|
|
-- Name: user_identity user_identity_pkey; Type: CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.user_identity
|
|
ADD CONSTRAINT user_identity_pkey PRIMARY KEY (id);
|
|
|
|
|
|
--
|
|
-- Name: users_addresses users_addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.users_addresses
|
|
ADD CONSTRAINT users_addresses_pkey PRIMARY KEY (user_id, address_id);
|
|
|
|
|
|
--
|
|
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.users
|
|
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
|
|
|
|
|
|
--
|
|
-- Name: idx6dotkott2kjsp8vw4d0m25fb7; Type: INDEX; Schema: public; Owner: hm
|
|
--
|
|
|
|
CREATE INDEX idx6dotkott2kjsp8vw4d0m25fb7 ON public.users USING btree (email);
|
|
|
|
|
|
--
|
|
-- Name: idx6jvqtxgs6xvh0h0t261hurgqo; Type: INDEX; Schema: public; Owner: hm
|
|
--
|
|
|
|
CREATE INDEX idx6jvqtxgs6xvh0h0t261hurgqo ON public.users USING btree (id);
|
|
|
|
|
|
--
|
|
-- Name: room_features fk5gj1vafc8lvh7eh2x7rs6sfn8; Type: FK CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.room_features
|
|
ADD CONSTRAINT fk5gj1vafc8lvh7eh2x7rs6sfn8 FOREIGN KEY (room_id) REFERENCES public.rooms(id);
|
|
|
|
|
|
--
|
|
-- Name: room_bookings fk8wb395es6guf2c5cq0j6w2i72; Type: FK CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.room_bookings
|
|
ADD CONSTRAINT fk8wb395es6guf2c5cq0j6w2i72 FOREIGN KEY (room_id) REFERENCES public.rooms(id);
|
|
|
|
|
|
--
|
|
-- Name: addition_bookings fkgqcr85yw62hu584jrh9ej11m9; Type: FK CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.addition_bookings
|
|
ADD CONSTRAINT fkgqcr85yw62hu584jrh9ej11m9 FOREIGN KEY (room_booking_id) REFERENCES public.room_bookings(id);
|
|
|
|
|
|
--
|
|
-- Name: rooms fkh9m2n1paq5hmd3u0klfl7wsfv; Type: FK CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.rooms
|
|
ADD CONSTRAINT fkh9m2n1paq5hmd3u0klfl7wsfv FOREIGN KEY (room_type_id) REFERENCES public.room_types(id);
|
|
|
|
|
|
--
|
|
-- Name: user_identity fkha862v3ye3u0ruo01kjdger7b; Type: FK CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.user_identity
|
|
ADD CONSTRAINT fkha862v3ye3u0ruo01kjdger7b FOREIGN KEY (user_id) REFERENCES public.users(id);
|
|
|
|
|
|
--
|
|
-- Name: user_roles fkhfh9dx7w3ubf1co1vdev94g3f; Type: FK CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.user_roles
|
|
ADD CONSTRAINT fkhfh9dx7w3ubf1co1vdev94g3f FOREIGN KEY (user_id) REFERENCES public.users(id);
|
|
|
|
|
|
--
|
|
-- Name: addition_bookings fkhr5ay7uva32llccgcemqn73dc; Type: FK CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.addition_bookings
|
|
ADD CONSTRAINT fkhr5ay7uva32llccgcemqn73dc FOREIGN KEY (addition_booking_type_id) REFERENCES public.addition_booking_types(id);
|
|
|
|
|
|
--
|
|
-- Name: room_bookings fkij8h49orrcde2c3irhnp2ekcm; Type: FK CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.room_bookings
|
|
ADD CONSTRAINT fkij8h49orrcde2c3irhnp2ekcm FOREIGN KEY (user_id) REFERENCES public.users(id);
|
|
|
|
|
|
--
|
|
-- Name: users_addresses fkkiudnofuhukgsdoy6i4ldg43e; Type: FK CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.users_addresses
|
|
ADD CONSTRAINT fkkiudnofuhukgsdoy6i4ldg43e FOREIGN KEY (address_id) REFERENCES public.addresses(id);
|
|
|
|
|
|
--
|
|
-- Name: users_addresses fkrpoauh74gtrrvj9m8skx6vti1; Type: FK CONSTRAINT; Schema: public; Owner: hm
|
|
--
|
|
|
|
ALTER TABLE ONLY public.users_addresses
|
|
ADD CONSTRAINT fkrpoauh74gtrrvj9m8skx6vti1 FOREIGN KEY (user_id) REFERENCES public.users(id);
|
|
|
|
|
|
--
|
|
-- PostgreSQL database dump complete
|
|
--
|
|
|
|
--
|
|
-- PostgreSQL database cluster dump complete
|
|
--
|
|
|