640 lines
15 KiB
Text
640 lines
15 KiB
Text
|
|
--
|
||
|
|
-- PostgreSQL database dump
|
||
|
|
--
|
||
|
|
|
||
|
|
-- Dumped from database version 15.8 (Debian 15.8-1.pgdg110+1)
|
||
|
|
-- Dumped by pg_dump version 15.8 (Debian 15.8-1.pgdg110+1)
|
||
|
|
|
||
|
|
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: tiger; Type: SCHEMA; Schema: -; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE SCHEMA tiger;
|
||
|
|
|
||
|
|
|
||
|
|
ALTER SCHEMA tiger OWNER TO teeoff_admin;
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: tiger_data; Type: SCHEMA; Schema: -; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE SCHEMA tiger_data;
|
||
|
|
|
||
|
|
|
||
|
|
ALTER SCHEMA tiger_data OWNER TO teeoff_admin;
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: topology; Type: SCHEMA; Schema: -; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE SCHEMA topology;
|
||
|
|
|
||
|
|
|
||
|
|
ALTER SCHEMA topology OWNER TO teeoff_admin;
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: SCHEMA topology; Type: COMMENT; Schema: -; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
COMMENT ON SCHEMA topology IS 'PostGIS Topology schema';
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: fuzzystrmatch; Type: EXTENSION; Schema: -; Owner: -
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch WITH SCHEMA public;
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: EXTENSION fuzzystrmatch; Type: COMMENT; Schema: -; Owner:
|
||
|
|
--
|
||
|
|
|
||
|
|
COMMENT ON EXTENSION fuzzystrmatch IS 'determine similarities and distance between strings';
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: postgis; Type: EXTENSION; Schema: -; Owner: -
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public;
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: EXTENSION postgis; Type: COMMENT; Schema: -; Owner:
|
||
|
|
--
|
||
|
|
|
||
|
|
COMMENT ON EXTENSION postgis IS 'PostGIS geometry and geography spatial types and functions';
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: postgis_tiger_geocoder; Type: EXTENSION; Schema: -; Owner: -
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder WITH SCHEMA tiger;
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: EXTENSION postgis_tiger_geocoder; Type: COMMENT; Schema: -; Owner:
|
||
|
|
--
|
||
|
|
|
||
|
|
COMMENT ON EXTENSION postgis_tiger_geocoder IS 'PostGIS tiger geocoder and reverse geocoder';
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: postgis_topology; Type: EXTENSION; Schema: -; Owner: -
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE EXTENSION IF NOT EXISTS postgis_topology WITH SCHEMA topology;
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: EXTENSION postgis_topology; Type: COMMENT; Schema: -; Owner:
|
||
|
|
--
|
||
|
|
|
||
|
|
COMMENT ON EXTENSION postgis_topology IS 'PostGIS topology spatial types and functions';
|
||
|
|
|
||
|
|
|
||
|
|
SET default_tablespace = '';
|
||
|
|
|
||
|
|
SET default_table_access_method = heap;
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: admins; Type: TABLE; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE TABLE public.admins (
|
||
|
|
id integer NOT NULL,
|
||
|
|
username character varying(50) NOT NULL,
|
||
|
|
password_hash text NOT NULL,
|
||
|
|
otp_secret character varying(32),
|
||
|
|
created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
|
||
|
|
email character varying(255)
|
||
|
|
);
|
||
|
|
|
||
|
|
|
||
|
|
ALTER TABLE public.admins OWNER TO teeoff_admin;
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: admins_id_seq; Type: SEQUENCE; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE SEQUENCE public.admins_id_seq
|
||
|
|
AS integer
|
||
|
|
START WITH 1
|
||
|
|
INCREMENT BY 1
|
||
|
|
NO MINVALUE
|
||
|
|
NO MAXVALUE
|
||
|
|
CACHE 1;
|
||
|
|
|
||
|
|
|
||
|
|
ALTER TABLE public.admins_id_seq OWNER TO teeoff_admin;
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: admins_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER SEQUENCE public.admins_id_seq OWNED BY public.admins.id;
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: courses; Type: TABLE; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE TABLE public.courses (
|
||
|
|
id integer NOT NULL,
|
||
|
|
facility_id integer,
|
||
|
|
name character varying(255) NOT NULL,
|
||
|
|
holes integer,
|
||
|
|
par integer,
|
||
|
|
length_meters integer,
|
||
|
|
course_type character varying(255),
|
||
|
|
architect character varying(255),
|
||
|
|
status character varying(255),
|
||
|
|
is_main_course boolean DEFAULT true,
|
||
|
|
created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
|
||
|
|
tee_boxes jsonb,
|
||
|
|
scrape_keyword text,
|
||
|
|
slope_valid_until date
|
||
|
|
);
|
||
|
|
|
||
|
|
|
||
|
|
ALTER TABLE public.courses OWNER TO teeoff_admin;
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: courses_id_seq; Type: SEQUENCE; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE SEQUENCE public.courses_id_seq
|
||
|
|
AS integer
|
||
|
|
START WITH 1
|
||
|
|
INCREMENT BY 1
|
||
|
|
NO MINVALUE
|
||
|
|
NO MAXVALUE
|
||
|
|
CACHE 1;
|
||
|
|
|
||
|
|
|
||
|
|
ALTER TABLE public.courses_id_seq OWNER TO teeoff_admin;
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: courses_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER SEQUENCE public.courses_id_seq OWNED BY public.courses.id;
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: facilities; Type: TABLE; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE TABLE public.facilities (
|
||
|
|
id integer NOT NULL,
|
||
|
|
name character varying(255) NOT NULL,
|
||
|
|
slug character varying(255) NOT NULL,
|
||
|
|
description text,
|
||
|
|
established_year integer,
|
||
|
|
season character varying(255),
|
||
|
|
address character varying(255),
|
||
|
|
zipcode character varying(50),
|
||
|
|
city character varying(255),
|
||
|
|
county character varying(255),
|
||
|
|
lat double precision,
|
||
|
|
lng double precision,
|
||
|
|
email character varying(255),
|
||
|
|
phone character varying(255),
|
||
|
|
website_url character varying(255),
|
||
|
|
golfbox_booking_url character varying(255),
|
||
|
|
golfbox_tournament_url character varying(255),
|
||
|
|
facebook_url character varying(255),
|
||
|
|
instagram_url character varying(255),
|
||
|
|
weather_url character varying(255),
|
||
|
|
webcam_url character varying(255),
|
||
|
|
golfamore boolean DEFAULT false,
|
||
|
|
created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
|
||
|
|
image_url character varying(500),
|
||
|
|
amenities jsonb,
|
||
|
|
greenfee jsonb,
|
||
|
|
architect text,
|
||
|
|
membership jsonb,
|
||
|
|
vtg jsonb,
|
||
|
|
video_url text,
|
||
|
|
baneguide_url text,
|
||
|
|
logo_url text,
|
||
|
|
flyfoto_url text,
|
||
|
|
guest_requirements text,
|
||
|
|
status_updated_at date,
|
||
|
|
gallery jsonb,
|
||
|
|
faqs jsonb DEFAULT '[]'::jsonb,
|
||
|
|
shotzoom jsonb DEFAULT '[]'::jsonb,
|
||
|
|
front_image_url text,
|
||
|
|
nsg_url text,
|
||
|
|
nsg_description text,
|
||
|
|
nsg_data jsonb DEFAULT '{}'::jsonb,
|
||
|
|
golfamore_data jsonb DEFAULT '{}'::jsonb,
|
||
|
|
ngf_number integer,
|
||
|
|
golfbox_club_id integer,
|
||
|
|
golfbox_booking_id text,
|
||
|
|
facebook_id text,
|
||
|
|
instagram_place_id text,
|
||
|
|
tournament_url text,
|
||
|
|
footnote text,
|
||
|
|
social_links jsonb DEFAULT '[]'::jsonb,
|
||
|
|
webcam_html text,
|
||
|
|
length_meters integer,
|
||
|
|
navn_standard_medlemskap text,
|
||
|
|
standard_medlemskap integer,
|
||
|
|
standard_medlemskap_kommentarer text,
|
||
|
|
navn_rimeligste_alternativ text,
|
||
|
|
rimeligste_alternativ integer,
|
||
|
|
rimeligste_alternativ_kommentarer text,
|
||
|
|
medlemskap_url text,
|
||
|
|
banetype text,
|
||
|
|
scrape_status_url text,
|
||
|
|
scrape_status_selector text,
|
||
|
|
scrape_method character varying(50) DEFAULT 'css_selector'::character varying,
|
||
|
|
ai_instruction text,
|
||
|
|
golfpakker jsonb DEFAULT '[]'::jsonb,
|
||
|
|
rabattert_greenfee jsonb DEFAULT '[]'::jsonb,
|
||
|
|
vtg_presentasjon text,
|
||
|
|
vtg_lenke text,
|
||
|
|
vtg_pris integer,
|
||
|
|
vtg_kursdatoer jsonb DEFAULT '[]'::jsonb,
|
||
|
|
membership_draft jsonb,
|
||
|
|
membership_updated_at timestamp with time zone,
|
||
|
|
greenfee_url character varying(255) DEFAULT NULL::character varying,
|
||
|
|
greenfee_draft jsonb,
|
||
|
|
greenfee_updated_at timestamp with time zone,
|
||
|
|
vtg_beskrivelse text,
|
||
|
|
vtg_datoer jsonb,
|
||
|
|
vtg_draft jsonb,
|
||
|
|
vtg_updated_at timestamp with time zone
|
||
|
|
);
|
||
|
|
|
||
|
|
|
||
|
|
ALTER TABLE public.facilities OWNER TO teeoff_admin;
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: facilities_id_seq; Type: SEQUENCE; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE SEQUENCE public.facilities_id_seq
|
||
|
|
AS integer
|
||
|
|
START WITH 1
|
||
|
|
INCREMENT BY 1
|
||
|
|
NO MINVALUE
|
||
|
|
NO MAXVALUE
|
||
|
|
CACHE 1;
|
||
|
|
|
||
|
|
|
||
|
|
ALTER TABLE public.facilities_id_seq OWNER TO teeoff_admin;
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: facilities_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER SEQUENCE public.facilities_id_seq OWNED BY public.facilities.id;
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: facility_images; Type: TABLE; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE TABLE public.facility_images (
|
||
|
|
id integer NOT NULL,
|
||
|
|
facility_id integer,
|
||
|
|
image_url character varying(255) NOT NULL,
|
||
|
|
display_order integer DEFAULT 0,
|
||
|
|
sort_order integer DEFAULT 0
|
||
|
|
);
|
||
|
|
|
||
|
|
|
||
|
|
ALTER TABLE public.facility_images OWNER TO teeoff_admin;
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: facility_images_id_seq; Type: SEQUENCE; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE SEQUENCE public.facility_images_id_seq
|
||
|
|
AS integer
|
||
|
|
START WITH 1
|
||
|
|
INCREMENT BY 1
|
||
|
|
NO MINVALUE
|
||
|
|
NO MAXVALUE
|
||
|
|
CACHE 1;
|
||
|
|
|
||
|
|
|
||
|
|
ALTER TABLE public.facility_images_id_seq OWNER TO teeoff_admin;
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: facility_images_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER SEQUENCE public.facility_images_id_seq OWNED BY public.facility_images.id;
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: hole_lengths; Type: TABLE; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE TABLE public.hole_lengths (
|
||
|
|
id integer NOT NULL,
|
||
|
|
hole_id integer,
|
||
|
|
tee_id integer,
|
||
|
|
length_meters integer
|
||
|
|
);
|
||
|
|
|
||
|
|
|
||
|
|
ALTER TABLE public.hole_lengths OWNER TO teeoff_admin;
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: hole_lengths_id_seq; Type: SEQUENCE; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE SEQUENCE public.hole_lengths_id_seq
|
||
|
|
AS integer
|
||
|
|
START WITH 1
|
||
|
|
INCREMENT BY 1
|
||
|
|
NO MINVALUE
|
||
|
|
NO MAXVALUE
|
||
|
|
CACHE 1;
|
||
|
|
|
||
|
|
|
||
|
|
ALTER TABLE public.hole_lengths_id_seq OWNER TO teeoff_admin;
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: hole_lengths_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER SEQUENCE public.hole_lengths_id_seq OWNED BY public.hole_lengths.id;
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: holes; Type: TABLE; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE TABLE public.holes (
|
||
|
|
id integer NOT NULL,
|
||
|
|
course_id integer,
|
||
|
|
hole_number integer NOT NULL,
|
||
|
|
par integer,
|
||
|
|
hcp_index integer,
|
||
|
|
lengths jsonb
|
||
|
|
);
|
||
|
|
|
||
|
|
|
||
|
|
ALTER TABLE public.holes OWNER TO teeoff_admin;
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: holes_id_seq; Type: SEQUENCE; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE SEQUENCE public.holes_id_seq
|
||
|
|
AS integer
|
||
|
|
START WITH 1
|
||
|
|
INCREMENT BY 1
|
||
|
|
NO MINVALUE
|
||
|
|
NO MAXVALUE
|
||
|
|
CACHE 1;
|
||
|
|
|
||
|
|
|
||
|
|
ALTER TABLE public.holes_id_seq OWNER TO teeoff_admin;
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: holes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER SEQUENCE public.holes_id_seq OWNED BY public.holes.id;
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: tees; Type: TABLE; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE TABLE public.tees (
|
||
|
|
id integer NOT NULL,
|
||
|
|
course_id integer,
|
||
|
|
name character varying(50) NOT NULL,
|
||
|
|
cr_men numeric(4,1),
|
||
|
|
slope_men integer,
|
||
|
|
cr_women numeric(4,1),
|
||
|
|
slope_women integer
|
||
|
|
);
|
||
|
|
|
||
|
|
|
||
|
|
ALTER TABLE public.tees OWNER TO teeoff_admin;
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: tees_id_seq; Type: SEQUENCE; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
CREATE SEQUENCE public.tees_id_seq
|
||
|
|
AS integer
|
||
|
|
START WITH 1
|
||
|
|
INCREMENT BY 1
|
||
|
|
NO MINVALUE
|
||
|
|
NO MAXVALUE
|
||
|
|
CACHE 1;
|
||
|
|
|
||
|
|
|
||
|
|
ALTER TABLE public.tees_id_seq OWNER TO teeoff_admin;
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: tees_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER SEQUENCE public.tees_id_seq OWNED BY public.tees.id;
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: admins id; Type: DEFAULT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.admins ALTER COLUMN id SET DEFAULT nextval('public.admins_id_seq'::regclass);
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: courses id; Type: DEFAULT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.courses ALTER COLUMN id SET DEFAULT nextval('public.courses_id_seq'::regclass);
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: facilities id; Type: DEFAULT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.facilities ALTER COLUMN id SET DEFAULT nextval('public.facilities_id_seq'::regclass);
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: facility_images id; Type: DEFAULT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.facility_images ALTER COLUMN id SET DEFAULT nextval('public.facility_images_id_seq'::regclass);
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: hole_lengths id; Type: DEFAULT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.hole_lengths ALTER COLUMN id SET DEFAULT nextval('public.hole_lengths_id_seq'::regclass);
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: holes id; Type: DEFAULT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.holes ALTER COLUMN id SET DEFAULT nextval('public.holes_id_seq'::regclass);
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: tees id; Type: DEFAULT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.tees ALTER COLUMN id SET DEFAULT nextval('public.tees_id_seq'::regclass);
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: admins admins_email_key; Type: CONSTRAINT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.admins
|
||
|
|
ADD CONSTRAINT admins_email_key UNIQUE (email);
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: admins admins_pkey; Type: CONSTRAINT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.admins
|
||
|
|
ADD CONSTRAINT admins_pkey PRIMARY KEY (id);
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: admins admins_username_key; Type: CONSTRAINT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.admins
|
||
|
|
ADD CONSTRAINT admins_username_key UNIQUE (username);
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: courses courses_pkey; Type: CONSTRAINT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.courses
|
||
|
|
ADD CONSTRAINT courses_pkey PRIMARY KEY (id);
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: facilities facilities_pkey; Type: CONSTRAINT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.facilities
|
||
|
|
ADD CONSTRAINT facilities_pkey PRIMARY KEY (id);
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: facilities facilities_slug_key; Type: CONSTRAINT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.facilities
|
||
|
|
ADD CONSTRAINT facilities_slug_key UNIQUE (slug);
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: facility_images facility_images_pkey; Type: CONSTRAINT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.facility_images
|
||
|
|
ADD CONSTRAINT facility_images_pkey PRIMARY KEY (id);
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: hole_lengths hole_lengths_pkey; Type: CONSTRAINT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.hole_lengths
|
||
|
|
ADD CONSTRAINT hole_lengths_pkey PRIMARY KEY (id);
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: holes holes_pkey; Type: CONSTRAINT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.holes
|
||
|
|
ADD CONSTRAINT holes_pkey PRIMARY KEY (id);
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: tees tees_pkey; Type: CONSTRAINT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.tees
|
||
|
|
ADD CONSTRAINT tees_pkey PRIMARY KEY (id);
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: facilities unique_slug; Type: CONSTRAINT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.facilities
|
||
|
|
ADD CONSTRAINT unique_slug UNIQUE (slug);
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: courses courses_facility_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.courses
|
||
|
|
ADD CONSTRAINT courses_facility_id_fkey FOREIGN KEY (facility_id) REFERENCES public.facilities(id) ON DELETE CASCADE;
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: hole_lengths hole_lengths_hole_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.hole_lengths
|
||
|
|
ADD CONSTRAINT hole_lengths_hole_id_fkey FOREIGN KEY (hole_id) REFERENCES public.holes(id) ON DELETE CASCADE;
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: hole_lengths hole_lengths_tee_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.hole_lengths
|
||
|
|
ADD CONSTRAINT hole_lengths_tee_id_fkey FOREIGN KEY (tee_id) REFERENCES public.tees(id) ON DELETE CASCADE;
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: holes holes_course_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.holes
|
||
|
|
ADD CONSTRAINT holes_course_id_fkey FOREIGN KEY (course_id) REFERENCES public.courses(id) ON DELETE CASCADE;
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- Name: tees tees_course_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: teeoff_admin
|
||
|
|
--
|
||
|
|
|
||
|
|
ALTER TABLE ONLY public.tees
|
||
|
|
ADD CONSTRAINT tees_course_id_fkey FOREIGN KEY (course_id) REFERENCES public.courses(id) ON DELETE CASCADE;
|
||
|
|
|
||
|
|
|
||
|
|
--
|
||
|
|
-- PostgreSQL database dump complete
|
||
|
|
--
|
||
|
|
|