-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtreedb-schema.sql
767 lines (571 loc) · 39.6 KB
/
treedb-schema.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
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
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
--
-- PostgreSQL database dump
--
-- Dumped from database version 15.1 (Debian 15.1-1.pgdg110+1)
-- Dumped by pg_dump version 15.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: public; Type: SCHEMA; Schema: -; Owner: pg_database_owner
--
CREATE SCHEMA public;
ALTER SCHEMA public OWNER TO pg_database_owner;
--
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: pg_database_owner
--
COMMENT ON SCHEMA public IS 'standard public schema';
--
-- Name: add_geom(); Type: FUNCTION; Schema: public; Owner: trees
--
CREATE FUNCTION public.add_geom() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE treedata SET geom = ST_SetSRID(ST_MakePoint(lng, lat), 4326) where id_tree=NEW.id_tree;
RETURN NEW;
END;
$$;
ALTER FUNCTION public.add_geom() OWNER TO trees;
--
-- Name: update_modified_column(); Type: FUNCTION; Schema: public; Owner: trees
--
CREATE FUNCTION public.update_modified_column() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
NEW.modified = now();
RETURN NEW;
END;
$$;
ALTER FUNCTION public.update_modified_column() OWNER TO trees;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: cities; Type: TABLE; Schema: public; Owner: trees
--
CREATE TABLE public.cities (
id_city integer NOT NULL,
city character varying(255),
lng double precision,
lat double precision,
email character varying(255),
who character varying(255),
created timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
count integer,
country text,
city_count_trees integer DEFAULT 0,
modified timestamp without time zone,
id character varying(255),
short character varying(255),
info text,
download text,
format character varying(255)
);
ALTER TABLE public.cities OWNER TO trees;
--
-- Name: cities_id_city_seq; Type: SEQUENCE; Schema: public; Owner: trees
--
ALTER TABLE public.cities ALTER COLUMN id_city ADD GENERATED ALWAYS AS IDENTITY (
SEQUENCE NAME public.cities_id_city_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1
);
--
-- Name: countries; Type: TABLE; Schema: public; Owner: trees
--
CREATE TABLE public.countries (
id_country integer NOT NULL,
country character varying(255) NOT NULL,
country_count_trees integer DEFAULT 0,
created timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
modified timestamp without time zone,
country_count_cities integer DEFAULT 0,
country_short character varying(64),
country_code character varying(64),
lng double precision,
lat double precision
);
ALTER TABLE public.countries OWNER TO trees;
--
-- Name: countries_id_country_seq; Type: SEQUENCE; Schema: public; Owner: trees
--
ALTER TABLE public.countries ALTER COLUMN id_country ADD GENERATED ALWAYS AS IDENTITY (
SEQUENCE NAME public.countries_id_country_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1
);
--
-- Name: crosswalk; Type: TABLE; Schema: public; Owner: trees
--
CREATE TABLE public.crosswalk (
id_crosswalk integer NOT NULL,
id character varying(255),
common character varying(255),
species character varying(255),
genus character varying(255),
scientific character varying(255),
family character varying(255),
variety character varying(255),
dbh character varying(255),
height character varying(255),
structure character varying(255),
trunks character varying(255),
age character varying(255),
health character varying(255),
crown character varying(255),
spread character varying(255),
planted character varying(255),
updated character varying(255),
location character varying(255),
note character varying(255),
address character varying(255),
ref character varying(255),
owner character varying(255),
ule character varying(255),
ule_min character varying(255),
ule_max character varying(255),
cost character varying(255),
gps_date character varying(255),
audited character varying(255),
modified timestamp without time zone,
created timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);
ALTER TABLE public.crosswalk OWNER TO trees;
--
-- Name: crosswalk_id_crosswalk_seq; Type: SEQUENCE; Schema: public; Owner: trees
--
ALTER TABLE public.crosswalk ALTER COLUMN id_crosswalk ADD GENERATED ALWAYS AS IDENTITY (
SEQUENCE NAME public.crosswalk_id_crosswalk_seq
START WITH 30
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1
);
--
-- Name: sources; Type: TABLE; Schema: public; Owner: trees
--
CREATE TABLE public.sources (
id_sources integer NOT NULL,
id character varying(255),
short character varying(255),
city character varying(255),
state character varying(255),
country character varying(255),
iso_alpha_2 character varying(2),
iso_alpha_3 character varying(3),
numeric_country_code integer DEFAULT 0,
long character varying(255),
id_city_name character varying(255),
main character varying(255),
center character varying(255),
longitude double precision,
latitude double precision,
email character varying(255),
contact character varying(255),
who character varying(255),
phone character varying(255),
trees_per_source_count integer DEFAULT 0,
country_code character varying(10),
broken boolean DEFAULT false,
broken_reason character varying(255),
info text,
download text,
format character varying(255),
filename character varying(255),
gdal_options character varying(255),
license character varying(255),
modified timestamp without time zone,
created timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);
ALTER TABLE public.sources OWNER TO trees;
--
-- Name: sources_id_sources_seq; Type: SEQUENCE; Schema: public; Owner: trees
--
ALTER TABLE public.sources ALTER COLUMN id_sources ADD GENERATED ALWAYS AS IDENTITY (
SEQUENCE NAME public.sources_id_sources_seq
START WITH 30
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1
);
--
-- Name: tree_taxonomy; Type: TABLE; Schema: public; Owner: trees
--
CREATE TABLE public.tree_taxonomy (
id_tree_taxonomy integer NOT NULL,
id character varying(255),
common character varying(255),
scientific character varying(255),
genus character varying(255),
species character varying(255),
family character varying(255),
class character varying(255),
phylum character varying(255),
kingdom character varying(255),
fia_code character varying(255),
conservation_status character varying(255),
max_height integer,
max_diameter_trunk integer,
max_diameter_crown integer,
native_country character varying(255),
modified timestamp without time zone,
created timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);
ALTER TABLE public.tree_taxonomy OWNER TO trees;
--
-- Name: tree_taxonomy_id_tree_taxonomy_seq; Type: SEQUENCE; Schema: public; Owner: trees
--
ALTER TABLE public.tree_taxonomy ALTER COLUMN id_tree_taxonomy ADD GENERATED ALWAYS AS IDENTITY (
SEQUENCE NAME public.tree_taxonomy_id_tree_taxonomy_seq
START WITH 30
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1
);
--
-- Name: treeadoption; Type: TABLE; Schema: public; Owner: trees
--
CREATE TABLE public.treeadoption (
id_adopted integer NOT NULL,
id_tree integer NOT NULL,
common character varying(255) NOT NULL,
nickname character varying(255) NOT NULL,
email character varying(255) NOT NULL,
created timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
modified timestamp without time zone,
id bigint NOT NULL
);
ALTER TABLE public.treeadoption OWNER TO trees;
--
-- Name: treeadoption_id_adopted_seq; Type: SEQUENCE; Schema: public; Owner: trees
--
ALTER TABLE public.treeadoption ALTER COLUMN id_adopted ADD GENERATED ALWAYS AS IDENTITY (
SEQUENCE NAME public.treeadoption_id_adopted_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1
);
--
-- Name: treedata; Type: TABLE; Schema: public; Owner: trees
--
CREATE TABLE public.treedata (
id_tree integer NOT NULL,
id_wtt character varying(255),
id_reference character varying(255),
who character varying(255),
common character varying(255),
scientific character varying(255),
genus character varying(255),
lng double precision,
lat double precision,
date_planted timestamp without time zone,
address character varying(255),
city character varying(255),
state character varying(255),
zip character varying(255),
country character varying(255),
neighborhood character varying(255),
health character varying(255),
dbh character varying(255),
height character varying(255),
owner character varying(255),
url character varying(255),
urlimage character varying(255),
status character varying(255),
notes text,
created timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
email character varying(255),
volunteer character varying(255),
modified timestamp without time zone,
planting_opt1 character varying(255),
planting_opt1_com character varying(255),
planting_opt2 character varying(255),
planting_opt3 character varying(255),
side_type character varying(50),
location_tree_count character varying(10),
geom public.geometry(Point,4326),
legal_status character varying,
irrigation boolean,
water_freq integer DEFAULT 14,
watering_end_date timestamp without time zone,
last_watered timestamp without time zone,
id bigint NOT NULL,
source_id character varying(255)
);
ALTER TABLE public.treedata OWNER TO trees;
--
-- Name: treedata_id_tree_seq; Type: SEQUENCE; Schema: public; Owner: trees
--
ALTER TABLE public.treedata ALTER COLUMN id_tree ADD GENERATED ALWAYS AS IDENTITY (
SEQUENCE NAME public.treedata_id_tree_seq
START WITH 3000
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1
);
--
-- Name: treehistory; Type: TABLE; Schema: public; Owner: trees
--
CREATE TABLE public.treehistory (
id_treehistory integer NOT NULL,
id_tree integer,
watered character varying(255),
mulched character varying(255),
pruned character varying(255),
staked character varying(255),
braced character varying(255),
weeded character varying(255),
comment text,
volunteer character varying(255),
date_visit timestamp without time zone,
created timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
modified timestamp without time zone,
adopted boolean,
liked boolean,
id bigint NOT NULL
);
ALTER TABLE public.treehistory OWNER TO trees;
--
-- Name: treehistory_id_treehistory_seq; Type: SEQUENCE; Schema: public; Owner: trees
--
ALTER TABLE public.treehistory ALTER COLUMN id_treehistory ADD GENERATED ALWAYS AS IDENTITY (
SEQUENCE NAME public.treehistory_id_treehistory_seq
START WITH 3000
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1
);
--
-- Name: treelikes; Type: TABLE; Schema: public; Owner: trees
--
CREATE TABLE public.treelikes (
id_liked integer NOT NULL,
id_tree integer NOT NULL,
common character varying(255) NOT NULL,
nickname character varying(255) NOT NULL,
email character varying(255) NOT NULL,
created timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
modified timestamp without time zone,
id bigint NOT NULL
);
ALTER TABLE public.treelikes OWNER TO trees;
--
-- Name: treelikes_id_liked_seq; Type: SEQUENCE; Schema: public; Owner: trees
--
ALTER TABLE public.treelikes ALTER COLUMN id_liked ADD GENERATED ALWAYS AS IDENTITY (
SEQUENCE NAME public.treelikes_id_liked_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1
);
--
-- Name: users; Type: TABLE; Schema: public; Owner: trees
--
CREATE TABLE public.users (
volunteer character varying(255),
nickname character varying(255) NOT NULL,
name character varying(255),
picture character varying(255),
email character varying(255) NOT NULL,
zipcode character varying(255),
created timestamp without time zone DEFAULT now() NOT NULL,
modified timestamp without time zone,
id_user integer NOT NULL,
phone text,
url text
);
ALTER TABLE public.users OWNER TO trees;
--
-- Name: users_id_user_seq; Type: SEQUENCE; Schema: public; Owner: trees
--
ALTER TABLE public.users ALTER COLUMN id_user ADD GENERATED ALWAYS AS IDENTITY (
SEQUENCE NAME public.users_id_user_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1
);
--
-- Name: cities cities_city_key; Type: CONSTRAINT; Schema: public; Owner: trees
--
ALTER TABLE ONLY public.cities
ADD CONSTRAINT cities_city_key UNIQUE (city);
--
-- Name: countries country_unique; Type: CONSTRAINT; Schema: public; Owner: trees
--
ALTER TABLE ONLY public.countries
ADD CONSTRAINT country_unique UNIQUE (country);
--
-- Name: users email_check; Type: CONSTRAINT; Schema: public; Owner: trees
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT email_check UNIQUE (email);
--
-- Name: users email_uk; Type: CONSTRAINT; Schema: public; Owner: trees
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT email_uk UNIQUE (email);
--
-- Name: users nickname_check; Type: CONSTRAINT; Schema: public; Owner: trees
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT nickname_check UNIQUE (nickname);
--
-- Name: treeadoption treeadoption_pkey; Type: CONSTRAINT; Schema: public; Owner: trees
--
ALTER TABLE ONLY public.treeadoption
ADD CONSTRAINT treeadoption_pkey PRIMARY KEY (id_adopted);
--
-- Name: treedata treedata_pk; Type: CONSTRAINT; Schema: public; Owner: trees
--
ALTER TABLE ONLY public.treedata
ADD CONSTRAINT treedata_pk PRIMARY KEY (id_tree);
--
-- Name: treehistory treehistory_pk; Type: CONSTRAINT; Schema: public; Owner: trees
--
ALTER TABLE ONLY public.treehistory
ADD CONSTRAINT treehistory_pk PRIMARY KEY (id_treehistory);
--
-- Name: treelikes treelikes_pkey; Type: CONSTRAINT; Schema: public; Owner: trees
--
ALTER TABLE ONLY public.treelikes
ADD CONSTRAINT treelikes_pkey PRIMARY KEY (id_liked);
--
-- Name: users users_pk; Type: CONSTRAINT; Schema: public; Owner: trees
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT users_pk PRIMARY KEY (id_user);
--
-- Name: cities_city_idx; Type: INDEX; Schema: public; Owner: trees
--
CREATE INDEX cities_city_idx ON public.cities USING btree (city);
--
-- Name: cities_id_city_idx; Type: INDEX; Schema: public; Owner: trees
--
CREATE INDEX cities_id_city_idx ON public.cities USING btree (id_city);
--
-- Name: id_geohash; Type: INDEX; Schema: public; Owner: trees
--
CREATE UNIQUE INDEX id_geohash ON public.treedata USING btree (id);
--
-- Name: id_idx; Type: INDEX; Schema: public; Owner: trees
--
CREATE UNIQUE INDEX id_idx ON public.sources USING btree (id);
--
-- Name: treeadoption_id_adopted_idx; Type: INDEX; Schema: public; Owner: trees
--
CREATE INDEX treeadoption_id_adopted_idx ON public.treeadoption USING btree (id_adopted);
--
-- Name: treeadoption_id_idx; Type: INDEX; Schema: public; Owner: trees
--
CREATE INDEX treeadoption_id_idx ON public.treeadoption USING btree (id);
--
-- Name: treeadoption_id_idx1; Type: INDEX; Schema: public; Owner: trees
--
CREATE INDEX treeadoption_id_idx1 ON public.treeadoption USING btree (id);
--
-- Name: treedata_geom_idx; Type: INDEX; Schema: public; Owner: trees
--
CREATE INDEX treedata_geom_idx ON public.treedata USING gist (geom);
--
-- Name: treedata_id_idx; Type: INDEX; Schema: public; Owner: trees
--
CREATE INDEX treedata_id_idx ON public.treedata USING btree (id);
--
-- Name: treedata_id_tree_idx; Type: INDEX; Schema: public; Owner: trees
--
CREATE INDEX treedata_id_tree_idx ON public.treedata USING btree (id_tree);
--
-- Name: treehistory_id_idx; Type: INDEX; Schema: public; Owner: trees
--
CREATE INDEX treehistory_id_idx ON public.treehistory USING btree (id);
--
-- Name: treehistory_id_idx1; Type: INDEX; Schema: public; Owner: trees
--
CREATE INDEX treehistory_id_idx1 ON public.treehistory USING btree (id);
--
-- Name: treehistory_id_treehistory_idx; Type: INDEX; Schema: public; Owner: trees
--
CREATE INDEX treehistory_id_treehistory_idx ON public.treehistory USING btree (id_treehistory);
--
-- Name: treelikes_id_idx; Type: INDEX; Schema: public; Owner: trees
--
CREATE INDEX treelikes_id_idx ON public.treelikes USING btree (id);
--
-- Name: treelikes_id_idx1; Type: INDEX; Schema: public; Owner: trees
--
CREATE INDEX treelikes_id_idx1 ON public.treelikes USING btree (id);
--
-- Name: treelikes_id_liked_idx; Type: INDEX; Schema: public; Owner: trees
--
CREATE INDEX treelikes_id_liked_idx ON public.treelikes USING btree (id_liked);
--
-- Name: users_id_user_idx; Type: INDEX; Schema: public; Owner: trees
--
CREATE INDEX users_id_user_idx ON public.users USING btree (id_user);
--
-- Name: treedata geom_update; Type: TRIGGER; Schema: public; Owner: trees
--
CREATE TRIGGER geom_update AFTER INSERT ON public.treedata FOR EACH ROW EXECUTE FUNCTION public.add_geom();
--
-- Name: crosswalk crosswalk_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: trees
--
ALTER TABLE ONLY public.crosswalk
ADD CONSTRAINT crosswalk_id_fkey FOREIGN KEY (id) REFERENCES public.sources(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: treelikes id_tree_fkey; Type: FK CONSTRAINT; Schema: public; Owner: trees
--
ALTER TABLE ONLY public.treelikes
ADD CONSTRAINT id_tree_fkey FOREIGN KEY (id_tree) REFERENCES public.treedata(id_tree) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: treeadoption id_tree_fkey; Type: FK CONSTRAINT; Schema: public; Owner: trees
--
ALTER TABLE ONLY public.treeadoption
ADD CONSTRAINT id_tree_fkey FOREIGN KEY (id_tree) REFERENCES public.treedata(id_tree) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: treeadoption treeadoption_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: trees
--
ALTER TABLE ONLY public.treeadoption
ADD CONSTRAINT treeadoption_id_fkey FOREIGN KEY (id) REFERENCES public.treedata(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: treedata treedata_planted_by_email_fkey; Type: FK CONSTRAINT; Schema: public; Owner: trees
--
ALTER TABLE ONLY public.treedata
ADD CONSTRAINT treedata_planted_by_email_fkey FOREIGN KEY (email) REFERENCES public.users(email);
--
-- Name: treedata treedata_planted_by_nickname_fkey; Type: FK CONSTRAINT; Schema: public; Owner: trees
--
ALTER TABLE ONLY public.treedata
ADD CONSTRAINT treedata_planted_by_nickname_fkey FOREIGN KEY (volunteer) REFERENCES public.users(nickname);
--
-- Name: treelikes treelikes_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: trees
--
ALTER TABLE ONLY public.treelikes
ADD CONSTRAINT treelikes_id_fkey FOREIGN KEY (id) REFERENCES public.treedata(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- PostgreSQL database dump complete
--