forked from pulibrary/allsearch_api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstructure.sql
More file actions
640 lines (446 loc) · 18 KB
/
Copy pathstructure.sql
File metadata and controls
640 lines (446 loc) · 18 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
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: unaccent; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS unaccent WITH SCHEMA public;
--
-- Name: EXTENSION unaccent; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION unaccent IS 'text search dictionary that removes accents';
--
-- Name: unaccented_dict; Type: TEXT SEARCH CONFIGURATION; Schema: public; Owner: -
--
CREATE TEXT SEARCH CONFIGURATION public.unaccented_dict (
PARSER = pg_catalog."default" );
ALTER TEXT SEARCH CONFIGURATION public.unaccented_dict
ADD MAPPING FOR asciiword WITH english_stem;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_dict
ADD MAPPING FOR word WITH public.unaccent, simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_dict
ADD MAPPING FOR numword WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_dict
ADD MAPPING FOR email WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_dict
ADD MAPPING FOR url WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_dict
ADD MAPPING FOR host WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_dict
ADD MAPPING FOR sfloat WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_dict
ADD MAPPING FOR version WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_dict
ADD MAPPING FOR hword_numpart WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_dict
ADD MAPPING FOR hword_part WITH public.unaccent, simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_dict
ADD MAPPING FOR hword_asciipart WITH english_stem;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_dict
ADD MAPPING FOR numhword WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_dict
ADD MAPPING FOR asciihword WITH english_stem;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_dict
ADD MAPPING FOR hword WITH public.unaccent, simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_dict
ADD MAPPING FOR url_path WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_dict
ADD MAPPING FOR file WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_dict
ADD MAPPING FOR "float" WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_dict
ADD MAPPING FOR "int" WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_dict
ADD MAPPING FOR uint WITH simple;
--
-- Name: unaccented_simple_dict; Type: TEXT SEARCH CONFIGURATION; Schema: public; Owner: -
--
CREATE TEXT SEARCH CONFIGURATION public.unaccented_simple_dict (
PARSER = pg_catalog."default" );
ALTER TEXT SEARCH CONFIGURATION public.unaccented_simple_dict
ADD MAPPING FOR asciiword WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_simple_dict
ADD MAPPING FOR word WITH public.unaccent, simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_simple_dict
ADD MAPPING FOR numword WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_simple_dict
ADD MAPPING FOR email WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_simple_dict
ADD MAPPING FOR url WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_simple_dict
ADD MAPPING FOR host WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_simple_dict
ADD MAPPING FOR sfloat WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_simple_dict
ADD MAPPING FOR version WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_simple_dict
ADD MAPPING FOR hword_numpart WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_simple_dict
ADD MAPPING FOR hword_part WITH public.unaccent, simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_simple_dict
ADD MAPPING FOR hword_asciipart WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_simple_dict
ADD MAPPING FOR numhword WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_simple_dict
ADD MAPPING FOR asciihword WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_simple_dict
ADD MAPPING FOR hword WITH public.unaccent, simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_simple_dict
ADD MAPPING FOR url_path WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_simple_dict
ADD MAPPING FOR file WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_simple_dict
ADD MAPPING FOR "float" WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_simple_dict
ADD MAPPING FOR "int" WITH simple;
ALTER TEXT SEARCH CONFIGURATION public.unaccented_simple_dict
ADD MAPPING FOR uint WITH simple;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.ar_internal_metadata (
key character varying NOT NULL,
value character varying,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL
);
--
-- Name: banners; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.banners (
id bigint NOT NULL,
text text DEFAULT ''::text,
display_banner boolean DEFAULT false,
alert_status integer DEFAULT 1,
dismissible boolean DEFAULT true,
autoclear boolean DEFAULT false,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL
);
--
-- Name: banners_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.banners_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: banners_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.banners_id_seq OWNED BY public.banners.id;
--
-- Name: best_bet_records; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.best_bet_records (
id bigint NOT NULL,
title character varying,
description character varying,
url character varying,
search_terms character varying[],
last_update date,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL
);
--
-- Name: best_bet_records_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.best_bet_records_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: best_bet_records_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.best_bet_records_id_seq OWNED BY public.best_bet_records.id;
--
-- Name: flipper_features; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.flipper_features (
id bigint NOT NULL,
key character varying NOT NULL,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL
);
--
-- Name: flipper_features_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.flipper_features_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: flipper_features_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.flipper_features_id_seq OWNED BY public.flipper_features.id;
--
-- Name: flipper_gates; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.flipper_gates (
id bigint NOT NULL,
feature_key character varying NOT NULL,
key character varying NOT NULL,
value text,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL
);
--
-- Name: flipper_gates_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.flipper_gates_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: flipper_gates_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.flipper_gates_id_seq OWNED BY public.flipper_gates.id;
--
-- Name: library_database_records; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.library_database_records (
id bigint NOT NULL,
libguides_id bigint NOT NULL,
name character varying NOT NULL,
description character varying,
alt_names character varying[],
alt_names_concat character varying,
url character varying,
friendly_url character varying,
subjects character varying[],
subjects_concat character varying,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
searchable tsvector GENERATED ALWAYS AS ((((setweight(to_tsvector('public.unaccented_dict'::regconfig, (COALESCE(name, ''::character varying))::text), 'A'::"char") || setweight(to_tsvector('public.unaccented_dict'::regconfig, (COALESCE(alt_names_concat, ''::character varying))::text), 'B'::"char")) || setweight(to_tsvector('public.unaccented_dict'::regconfig, (COALESCE(description, ''::character varying))::text), 'C'::"char")) || setweight(to_tsvector('public.unaccented_dict'::regconfig, (COALESCE(subjects_concat, ''::character varying))::text), 'D'::"char"))) STORED
);
--
-- Name: library_database_records_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.library_database_records_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: library_database_records_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.library_database_records_id_seq OWNED BY public.library_database_records.id;
--
-- Name: library_staff_records; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.library_staff_records (
id bigint NOT NULL,
puid bigint NOT NULL,
netid character varying NOT NULL,
phone character varying,
name character varying NOT NULL,
last_name character varying,
first_name character varying,
middle_name character varying,
title character varying NOT NULL,
library_title character varying NOT NULL,
email character varying NOT NULL,
team character varying,
division character varying,
department character varying,
unit character varying,
office character varying,
building character varying,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
areas_of_study character varying,
other_entities character varying,
my_scheduler_link character varying,
pronouns character varying,
name_searchable tsvector GENERATED ALWAYS AS (to_tsvector('public.unaccented_simple_dict'::regconfig, (((((((COALESCE(name, ''::character varying))::text || ' '::text) || (COALESCE(first_name, ''::character varying))::text) || ' '::text) || (COALESCE(middle_name, ''::character varying))::text) || ' '::text) || (COALESCE(last_name, ''::character varying))::text))) STORED,
bio character varying,
searchable tsvector GENERATED ALWAYS AS (to_tsvector('public.unaccented_dict'::regconfig, (((((((((((((((((((((COALESCE(title, ''::character varying))::text || ' '::text) || (COALESCE(email, ''::character varying))::text) || ' '::text) || (COALESCE(department, ''::character varying))::text) || ' '::text) || (COALESCE(office, ''::character varying))::text) || ' '::text) || (COALESCE(building, ''::character varying))::text) || ' '::text) || (COALESCE(team, ''::character varying))::text) || ' '::text) || (COALESCE(division, ''::character varying))::text) || ' '::text) || (COALESCE(unit, ''::character varying))::text) || ' '::text) || (COALESCE(areas_of_study, ''::character varying))::text) || ' '::text) || (COALESCE(bio, ''::character varying))::text) || ' '::text) || (COALESCE(other_entities, ''::character varying))::text))) STORED
);
--
-- Name: library_staff_records_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.library_staff_records_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: library_staff_records_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.library_staff_records_id_seq OWNED BY public.library_staff_records.id;
--
-- Name: oauth_tokens; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.oauth_tokens (
id bigint NOT NULL,
service character varying NOT NULL,
endpoint character varying NOT NULL,
token character varying,
expiration_time timestamp(6) without time zone,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL
);
--
-- Name: oauth_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.oauth_tokens_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: oauth_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.oauth_tokens_id_seq OWNED BY public.oauth_tokens.id;
--
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.schema_migrations (
version character varying NOT NULL
);
--
-- Name: banners id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.banners ALTER COLUMN id SET DEFAULT nextval('public.banners_id_seq'::regclass);
--
-- Name: best_bet_records id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.best_bet_records ALTER COLUMN id SET DEFAULT nextval('public.best_bet_records_id_seq'::regclass);
--
-- Name: flipper_features id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.flipper_features ALTER COLUMN id SET DEFAULT nextval('public.flipper_features_id_seq'::regclass);
--
-- Name: flipper_gates id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.flipper_gates ALTER COLUMN id SET DEFAULT nextval('public.flipper_gates_id_seq'::regclass);
--
-- Name: library_database_records id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.library_database_records ALTER COLUMN id SET DEFAULT nextval('public.library_database_records_id_seq'::regclass);
--
-- Name: library_staff_records id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.library_staff_records ALTER COLUMN id SET DEFAULT nextval('public.library_staff_records_id_seq'::regclass);
--
-- Name: oauth_tokens id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.oauth_tokens ALTER COLUMN id SET DEFAULT nextval('public.oauth_tokens_id_seq'::regclass);
--
-- Name: ar_internal_metadata ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.ar_internal_metadata
ADD CONSTRAINT ar_internal_metadata_pkey PRIMARY KEY (key);
--
-- Name: banners banners_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.banners
ADD CONSTRAINT banners_pkey PRIMARY KEY (id);
--
-- Name: best_bet_records best_bet_records_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.best_bet_records
ADD CONSTRAINT best_bet_records_pkey PRIMARY KEY (id);
--
-- Name: flipper_features flipper_features_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.flipper_features
ADD CONSTRAINT flipper_features_pkey PRIMARY KEY (id);
--
-- Name: flipper_gates flipper_gates_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.flipper_gates
ADD CONSTRAINT flipper_gates_pkey PRIMARY KEY (id);
--
-- Name: library_database_records library_database_records_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.library_database_records
ADD CONSTRAINT library_database_records_pkey PRIMARY KEY (id);
--
-- Name: library_staff_records library_staff_records_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.library_staff_records
ADD CONSTRAINT library_staff_records_pkey PRIMARY KEY (id);
--
-- Name: oauth_tokens oauth_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.oauth_tokens
ADD CONSTRAINT oauth_tokens_pkey PRIMARY KEY (id);
--
-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.schema_migrations
ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version);
--
-- Name: index_flipper_features_on_key; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_flipper_features_on_key ON public.flipper_features USING btree (key);
--
-- Name: index_flipper_gates_on_feature_key_and_key_and_value; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_flipper_gates_on_feature_key_and_key_and_value ON public.flipper_gates USING btree (feature_key, key, value);
--
-- Name: index_oauth_tokens_on_endpoint; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_oauth_tokens_on_endpoint ON public.oauth_tokens USING btree (endpoint);
--
-- Name: index_oauth_tokens_on_service; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_oauth_tokens_on_service ON public.oauth_tokens USING btree (service);
--
-- Name: searchable_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX searchable_idx ON public.library_database_records USING gin (searchable);
--
-- Name: staff_name_search_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX staff_name_search_idx ON public.library_staff_records USING gin (name_searchable);
--
-- Name: staff_search_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX staff_search_idx ON public.library_staff_records USING gin (searchable);
--
-- PostgreSQL database dump complete
--
SET search_path TO "$user", public;
INSERT INTO "schema_migrations" (version) VALUES
('20250627142651'),
('20240820185228'),
('20240820184147'),
('20240819201829'),
('20240819150118'),
('20240819142401'),
('20240815164656'),
('20240813174823'),
('20240717173433'),
('20240717164314'),
('20240716214838'),
('20240716210532'),
('20240710210913'),
('20231121205208'),
('20231120153410'),
('20230921193904'),
('20230920214343'),
('20230919194551'),
('20230919194126'),
('20230918230048'),
('20230918174143');