-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdb.sql
108 lines (75 loc) · 2.27 KB
/
db.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
--
-- PostgreSQL database dump
--
-- Dumped from database version 13.2 (Debian 13.2-1.pgdg100+1)
-- Dumped by pg_dump version 16.2
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: public; Type: SCHEMA; Schema: -; Owner: -
--
-- *not* creating schema, since initdb creates it
--
-- Name: remote_rank(text); Type: FUNCTION; Schema: public; Owner: -
--
CREATE FUNCTION public.remote_rank(text) RETURNS integer
LANGUAGE sql
AS $_$ select case when $1 in ('worldwide', 'global') then 1000 else array_length(string_to_array($1, ','), 1) end $_$;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: jobs; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.jobs (
id integer NOT NULL,
title text,
descrip text,
descrip_fts tsvector GENERATED ALWAYS AS (to_tsvector('english'::regconfig, descrip)) STORED,
url text,
tags text[],
metadata jsonb DEFAULT '{}'::jsonb,
created_at timestamp without time zone DEFAULT timezone('utc'::text, now())
);
--
-- Name: jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.jobs_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.jobs_id_seq OWNED BY public.jobs.id;
--
-- Name: jobs id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.jobs ALTER COLUMN id SET DEFAULT nextval('public.jobs_id_seq'::regclass);
--
-- Name: jobs jobs_url_key; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.jobs
ADD CONSTRAINT jobs_url_key UNIQUE (url);
--
-- Name: descrip_fts_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX descrip_fts_idx ON public.jobs USING gin (descrip_fts);
--
-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: -
--
REVOKE USAGE ON SCHEMA public FROM PUBLIC;
GRANT ALL ON SCHEMA public TO PUBLIC;
--
-- PostgreSQL database dump complete
--