forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPostgreSQL83DialectLinqReadonlyCreateScript.sql
4996 lines (4510 loc) · 1.37 MB
/
PostgreSQL83DialectLinqReadonlyCreateScript.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
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.0.1
-- Dumped by pg_dump version 9.0.1
-- Started on 2011-02-28 22:04:37
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
SET search_path = public, pg_catalog;
SET default_with_oids = false;
--
-- TOC entry 1598 (class 1259 OID 29597)
-- Dependencies: 5
-- Name: animal; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE animal (
id integer NOT NULL,
description character varying(255),
body_weight double precision,
mother_id integer,
father_id integer,
serialnumber character varying(255),
parentid integer
);
--
-- TOC entry 1597 (class 1259 OID 29595)
-- Dependencies: 1598 5
-- Name: animal_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE animal_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2013 (class 0 OID 0)
-- Dependencies: 1597
-- Name: animal_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE animal_id_seq OWNED BY animal.id;
--
-- TOC entry 2014 (class 0 OID 0)
-- Dependencies: 1597
-- Name: animal_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('animal_id_seq', 6, true);
--
-- TOC entry 1587 (class 1259 OID 29548)
-- Dependencies: 5
-- Name: anotherentity; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE anotherentity (
id integer NOT NULL,
output character varying(255),
input character varying(255)
);
--
-- TOC entry 1586 (class 1259 OID 29546)
-- Dependencies: 5 1587
-- Name: anotherentity_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE anotherentity_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2015 (class 0 OID 0)
-- Dependencies: 1586
-- Name: anotherentity_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE anotherentity_id_seq OWNED BY anotherentity.id;
--
-- TOC entry 2016 (class 0 OID 0)
-- Dependencies: 1586
-- Name: anotherentity_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('anotherentity_id_seq', 5, true);
--
-- TOC entry 1603 (class 1259 OID 29626)
-- Dependencies: 5
-- Name: cat; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE cat (
mammal integer NOT NULL
);
--
-- TOC entry 1579 (class 1259 OID 29512)
-- Dependencies: 5
-- Name: categories; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE categories (
categoryid integer NOT NULL,
categoryname character varying(15) NOT NULL,
description character varying(255)
);
--
-- TOC entry 1572 (class 1259 OID 29473)
-- Dependencies: 5
-- Name: customers; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE customers (
customerid character varying(255) NOT NULL,
companyname character varying(40) NOT NULL,
contactname character varying(30),
contacttitle character varying(30),
address character varying(60),
city character varying(15),
region character varying(15),
postalcode character varying(10),
country character varying(15),
phone character varying(24),
fax character varying(24)
);
--
-- TOC entry 1602 (class 1259 OID 29621)
-- Dependencies: 5
-- Name: dog; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE dog (
mammal integer NOT NULL
);
--
-- TOC entry 1573 (class 1259 OID 29481)
-- Dependencies: 5
-- Name: employees; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE employees (
employeeid integer NOT NULL,
lastname character varying(20) NOT NULL,
firstname character varying(10) NOT NULL,
title character varying(30),
titleofcourtesy character varying(25),
birthdate timestamp without time zone,
hiredate timestamp without time zone,
address character varying(60),
city character varying(15),
region character varying(15),
postalcode character varying(10),
country character varying(15),
homephone character varying(24),
extension character varying(4),
notes character varying(4000),
reportsto integer
);
--
-- TOC entry 1574 (class 1259 OID 29489)
-- Dependencies: 5
-- Name: employeeterritories; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE employeeterritories (
employeeid integer NOT NULL,
territoryid bigint NOT NULL
);
--
-- TOC entry 1600 (class 1259 OID 29611)
-- Dependencies: 5
-- Name: lizard; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE lizard (
reptile integer NOT NULL
);
--
-- TOC entry 1601 (class 1259 OID 29616)
-- Dependencies: 5
-- Name: mammal; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE mammal (
animal integer NOT NULL,
pregnant boolean,
birthdate timestamp without time zone
);
--
-- TOC entry 1577 (class 1259 OID 29501)
-- Dependencies: 5
-- Name: orderlines; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE orderlines (
orderlineid bigint NOT NULL,
orderid integer NOT NULL,
productid integer NOT NULL,
unitprice numeric(19,5) NOT NULL,
quantity integer NOT NULL,
discount numeric(19,5) NOT NULL
);
--
-- TOC entry 1576 (class 1259 OID 29499)
-- Dependencies: 1577 5
-- Name: orderlines_orderlineid_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE orderlines_orderlineid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2017 (class 0 OID 0)
-- Dependencies: 1576
-- Name: orderlines_orderlineid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE orderlines_orderlineid_seq OWNED BY orderlines.orderlineid;
--
-- TOC entry 2018 (class 0 OID 0)
-- Dependencies: 1576
-- Name: orderlines_orderlineid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('orderlines_orderlineid_seq', 2155, true);
--
-- TOC entry 1575 (class 1259 OID 29494)
-- Dependencies: 5
-- Name: orders; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE orders (
orderid integer NOT NULL,
customerid character varying(255) NOT NULL,
employeeid integer,
orderdate timestamp without time zone,
requireddate timestamp without time zone,
shippeddate timestamp without time zone,
shipvia integer,
freight numeric(19,5),
shipname character varying(40),
shipaddress character varying(60),
shipcity character varying(15),
shipregion character varying(15),
shippostalcode character varying(10),
shipcountry character varying(15)
);
--
-- TOC entry 1609 (class 1259 OID 29649)
-- Dependencies: 5
-- Name: patientrecords; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE patientrecords (
patientrecordid bigint NOT NULL,
"Gender" integer NOT NULL,
"BirthDate" timestamp without time zone NOT NULL,
"FirstName" character varying(255) NOT NULL,
"LastName" character varying(255) NOT NULL,
"AddressLine1" character varying(255),
"AddressLine2" character varying(255),
"City" character varying(255),
stateid bigint,
"ZipCode" character varying(255),
patientid bigint NOT NULL
);
--
-- TOC entry 1608 (class 1259 OID 29647)
-- Dependencies: 1609 5
-- Name: patientrecords_patientrecordid_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE patientrecords_patientrecordid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2019 (class 0 OID 0)
-- Dependencies: 1608
-- Name: patientrecords_patientrecordid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE patientrecords_patientrecordid_seq OWNED BY patientrecords.patientrecordid;
--
-- TOC entry 2020 (class 0 OID 0)
-- Dependencies: 1608
-- Name: patientrecords_patientrecordid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('patientrecords_patientrecordid_seq', 3, true);
--
-- TOC entry 1605 (class 1259 OID 29633)
-- Dependencies: 5
-- Name: patients; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE patients (
patientid bigint NOT NULL,
"Active" boolean NOT NULL,
physicianid bigint NOT NULL
);
--
-- TOC entry 1604 (class 1259 OID 29631)
-- Dependencies: 5 1605
-- Name: patients_patientid_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE patients_patientid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2021 (class 0 OID 0)
-- Dependencies: 1604
-- Name: patients_patientid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE patients_patientid_seq OWNED BY patients.patientid;
--
-- TOC entry 2022 (class 0 OID 0)
-- Dependencies: 1604
-- Name: patients_patientid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('patients_patientid_seq', 2, true);
--
-- TOC entry 1607 (class 1259 OID 29641)
-- Dependencies: 5
-- Name: physicians; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE physicians (
physicianid bigint NOT NULL,
"Name" character varying(255) NOT NULL
);
--
-- TOC entry 1606 (class 1259 OID 29639)
-- Dependencies: 5 1607
-- Name: physicians_physicianid_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE physicians_physicianid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2023 (class 0 OID 0)
-- Dependencies: 1606
-- Name: physicians_physicianid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE physicians_physicianid_seq OWNED BY physicians.physicianid;
--
-- TOC entry 2024 (class 0 OID 0)
-- Dependencies: 1606
-- Name: physicians_physicianid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('physicians_physicianid_seq', 2, true);
--
-- TOC entry 1578 (class 1259 OID 29507)
-- Dependencies: 5
-- Name: products; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE products (
productid integer NOT NULL,
productname character varying(40) NOT NULL,
supplierid integer,
categoryid integer,
quantityperunit character varying(20),
unitprice numeric(19,5),
unitsinstock integer,
unitsonorder integer,
reorderlevel integer,
discontinued boolean NOT NULL,
shippingweight float
);
--
-- TOC entry 1581 (class 1259 OID 29519)
-- Dependencies: 5
-- Name: region; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE region (
regionid bigint NOT NULL,
regiondescription character varying(50) NOT NULL
);
--
-- TOC entry 1580 (class 1259 OID 29517)
-- Dependencies: 1581 5
-- Name: region_regionid_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE region_regionid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2025 (class 0 OID 0)
-- Dependencies: 1580
-- Name: region_regionid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE region_regionid_seq OWNED BY region.regionid;
--
-- TOC entry 2026 (class 0 OID 0)
-- Dependencies: 1580
-- Name: region_regionid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('region_regionid_seq', 1, false);
--
-- TOC entry 1599 (class 1259 OID 29606)
-- Dependencies: 5
-- Name: reptile; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE reptile (
animal integer NOT NULL,
bodytemperature double precision
);
--
-- TOC entry 1589 (class 1259 OID 29559)
-- Dependencies: 5
-- Name: roles; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE roles (
id integer NOT NULL,
name character varying(255),
isactive boolean,
entityid integer,
parentid integer
);
--
-- TOC entry 1588 (class 1259 OID 29557)
-- Dependencies: 1589 5
-- Name: roles_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE roles_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2027 (class 0 OID 0)
-- Dependencies: 1588
-- Name: roles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE roles_id_seq OWNED BY roles.id;
--
-- TOC entry 2028 (class 0 OID 0)
-- Dependencies: 1588
-- Name: roles_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('roles_id_seq', 2, true);
--
-- TOC entry 1582 (class 1259 OID 29525)
-- Dependencies: 5
-- Name: shippers; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE shippers (
shipperid integer NOT NULL,
companyname character varying(40) NOT NULL,
phone character varying(24),
"Reference" uuid
);
--
-- TOC entry 1611 (class 1259 OID 29660)
-- Dependencies: 5
-- Name: states; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE states (
stateid bigint NOT NULL,
"Abbreviation" character varying(255) NOT NULL,
"FullName" character varying(255) NOT NULL
);
--
-- TOC entry 1610 (class 1259 OID 29658)
-- Dependencies: 1611 5
-- Name: states_stateid_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE states_stateid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2029 (class 0 OID 0)
-- Dependencies: 1610
-- Name: states_stateid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE states_stateid_seq OWNED BY states.stateid;
--
-- TOC entry 2030 (class 0 OID 0)
-- Dependencies: 1610
-- Name: states_stateid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('states_stateid_seq', 2, true);
--
-- TOC entry 1583 (class 1259 OID 29530)
-- Dependencies: 5
-- Name: suppliers; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE suppliers (
supplierid integer NOT NULL,
companyname character varying(40) NOT NULL,
contactname character varying(30),
contacttitle character varying(30),
homepage character varying(255),
address character varying(60),
city character varying(15),
region character varying(15),
postalcode character varying(10),
country character varying(15),
phone character varying(24),
fax character varying(24)
);
--
-- TOC entry 1585 (class 1259 OID 29540)
-- Dependencies: 5
-- Name: territories; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE territories (
territoryid bigint NOT NULL,
territorydescription character varying(50) NOT NULL,
regionid bigint NOT NULL
);
--
-- TOC entry 1584 (class 1259 OID 29538)
-- Dependencies: 5 1585
-- Name: territories_territoryid_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE territories_territoryid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2031 (class 0 OID 0)
-- Dependencies: 1584
-- Name: territories_territoryid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE territories_territoryid_seq OWNED BY territories.territoryid;
--
-- TOC entry 2032 (class 0 OID 0)
-- Dependencies: 1584
-- Name: territories_territoryid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('territories_territoryid_seq', 1, false);
--
-- TOC entry 1596 (class 1259 OID 29589)
-- Dependencies: 5
-- Name: timesheetentries; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE timesheetentries (
timesheetentryid integer NOT NULL,
entrydate timestamp without time zone,
numberofhours integer,
comments character varying(255),
timesheetid integer
);
--
-- TOC entry 1595 (class 1259 OID 29587)
-- Dependencies: 5 1596
-- Name: timesheetentries_timesheetentryid_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE timesheetentries_timesheetentryid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2033 (class 0 OID 0)
-- Dependencies: 1595
-- Name: timesheetentries_timesheetentryid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE timesheetentries_timesheetentryid_seq OWNED BY timesheetentries.timesheetentryid;
--
-- TOC entry 2034 (class 0 OID 0)
-- Dependencies: 1595
-- Name: timesheetentries_timesheetentryid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('timesheetentries_timesheetentryid_seq', 6, true);
--
-- TOC entry 1593 (class 1259 OID 29578)
-- Dependencies: 5
-- Name: timesheets; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE timesheets (
timesheetid integer NOT NULL,
submitteddate timestamp without time zone,
submitted boolean
);
--
-- TOC entry 1592 (class 1259 OID 29576)
-- Dependencies: 1593 5
-- Name: timesheets_timesheetid_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE timesheets_timesheetid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2035 (class 0 OID 0)
-- Dependencies: 1592
-- Name: timesheets_timesheetid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE timesheets_timesheetid_seq OWNED BY timesheets.timesheetid;
--
-- TOC entry 2036 (class 0 OID 0)
-- Dependencies: 1592
-- Name: timesheets_timesheetid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('timesheets_timesheetid_seq', 3, true);
--
-- TOC entry 1594 (class 1259 OID 29584)
-- Dependencies: 5
-- Name: timesheetusers; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE timesheetusers (
timesheetid integer NOT NULL,
userid integer NOT NULL
);
--
-- TOC entry 1591 (class 1259 OID 29567)
-- Dependencies: 5
-- Name: users; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE users (
userid integer NOT NULL,
name character varying(255),
invalidloginattempts integer,
registeredat timestamp without time zone,
lastlogindate timestamp without time zone,
enum1 character varying(12),
enum2 integer NOT NULL,
features integer NOT NULL,
roleid integer,
property1 character varying(255),
property2 character varying(255),
otherproperty1 character varying(255),
createdbyid integer NOT NULL,
modifiedbyid integer NULL
);
CREATE TABLE numericentity (
short smallint not null constraint numericentity_pkey primary key,
nullableshort smallint,
"Integer" integer not null,
nullableinteger integer,
"Long" bigint not null,
nullablelong bigint,
"Decimal" numeric(19,5) not null,
nullabledecimal numeric(19,5),
"Single" real not null,
nullablesingle real,
"Double" double precision not null,
nullabledouble double precision
);
--
-- TOC entry 1590 (class 1259 OID 29565)
-- Dependencies: 1591 5
-- Name: users_userid_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE users_userid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2037 (class 0 OID 0)
-- Dependencies: 1590
-- Name: users_userid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE users_userid_seq OWNED BY users.userid;
--
-- TOC entry 2038 (class 0 OID 0)
-- Dependencies: 1590
-- Name: users_userid_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('users_userid_seq', 3, true);
--
-- TOC entry 1897 (class 2604 OID 29600)
-- Dependencies: 1597 1598 1598
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE animal ALTER COLUMN id SET DEFAULT nextval('animal_id_seq'::regclass);
--
-- TOC entry 1892 (class 2604 OID 29551)
-- Dependencies: 1587 1586 1587
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE anotherentity ALTER COLUMN id SET DEFAULT nextval('anotherentity_id_seq'::regclass);
--
-- TOC entry 1889 (class 2604 OID 29504)
-- Dependencies: 1576 1577 1577
-- Name: orderlineid; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE orderlines ALTER COLUMN orderlineid SET DEFAULT nextval('orderlines_orderlineid_seq'::regclass);
--
-- TOC entry 1900 (class 2604 OID 29652)
-- Dependencies: 1609 1608 1609
-- Name: patientrecordid; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE patientrecords ALTER COLUMN patientrecordid SET DEFAULT nextval('patientrecords_patientrecordid_seq'::regclass);
--
-- TOC entry 1898 (class 2604 OID 29636)
-- Dependencies: 1605 1604 1605
-- Name: patientid; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE patients ALTER COLUMN patientid SET DEFAULT nextval('patients_patientid_seq'::regclass);
--
-- TOC entry 1899 (class 2604 OID 29644)
-- Dependencies: 1607 1606 1607
-- Name: physicianid; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE physicians ALTER COLUMN physicianid SET DEFAULT nextval('physicians_physicianid_seq'::regclass);
--
-- TOC entry 1890 (class 2604 OID 29522)
-- Dependencies: 1580 1581 1581
-- Name: regionid; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE region ALTER COLUMN regionid SET DEFAULT nextval('region_regionid_seq'::regclass);
--
-- TOC entry 1893 (class 2604 OID 29562)
-- Dependencies: 1588 1589 1589
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE roles ALTER COLUMN id SET DEFAULT nextval('roles_id_seq'::regclass);
--
-- TOC entry 1901 (class 2604 OID 29663)
-- Dependencies: 1610 1611 1611
-- Name: stateid; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE states ALTER COLUMN stateid SET DEFAULT nextval('states_stateid_seq'::regclass);
--
-- TOC entry 1891 (class 2604 OID 29543)
-- Dependencies: 1584 1585 1585
-- Name: territoryid; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE territories ALTER COLUMN territoryid SET DEFAULT nextval('territories_territoryid_seq'::regclass);
--
-- TOC entry 1896 (class 2604 OID 29592)
-- Dependencies: 1596 1595 1596
-- Name: timesheetentryid; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE timesheetentries ALTER COLUMN timesheetentryid SET DEFAULT nextval('timesheetentries_timesheetentryid_seq'::regclass);
--
-- TOC entry 1895 (class 2604 OID 29581)
-- Dependencies: 1592 1593 1593
-- Name: timesheetid; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE timesheets ALTER COLUMN timesheetid SET DEFAULT nextval('timesheets_timesheetid_seq'::regclass);
--
-- TOC entry 1894 (class 2604 OID 29570)
-- Dependencies: 1591 1590 1591
-- Name: userid; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE users ALTER COLUMN userid SET DEFAULT nextval('users_userid_seq'::regclass);
--
-- TOC entry 1999 (class 0 OID 29597)
-- Dependencies: 1598
-- Data for Name: animal; Type: TABLE DATA; Schema: public; Owner: -
--
INSERT INTO animal (id, description, body_weight, mother_id, father_id, serialnumber, parentid) VALUES (1, NULL, 100, NULL, NULL, '123', NULL);
INSERT INTO animal (id, description, body_weight, mother_id, father_id, serialnumber, parentid) VALUES (2, NULL, 40, NULL, NULL, '789', NULL);
INSERT INTO animal (id, description, body_weight, mother_id, father_id, serialnumber, parentid) VALUES (3, NULL, 30, NULL, NULL, '1234', NULL);
INSERT INTO animal (id, description, body_weight, mother_id, father_id, serialnumber, parentid) VALUES (4, NULL, 156, NULL, NULL, '5678', 1);
INSERT INTO animal (id, description, body_weight, mother_id, father_id, serialnumber, parentid) VALUES (5, NULL, 205, NULL, NULL, '9101', 1);
INSERT INTO animal (id, description, body_weight, mother_id, father_id, serialnumber, parentid) VALUES (6, NULL, 115, 5, 4, '1121', 2);