forked from roji/Npgsql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNpgsqlSchema.ssdl
More file actions
724 lines (723 loc) · 29.8 KB
/
NpgsqlSchema.ssdl
File metadata and controls
724 lines (723 loc) · 29.8 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
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
<?xml version="1.0" encoding="utf-8"?>
<Schema Namespace="NpgsqlSchema" Provider="Npgsql" ProviderManifestToken="8.1.3" Alias="Self" xmlns="http://schemas.microsoft.com/ado/2006/04/edm/ssdl">
<EntityContainer Name="NpgsqlSchema">
<EntitySet Name="PgTables" EntityType="NpgsqlSchema.Table">
<DefiningQuery>
select
cast(c.oid as varchar) as id,
c.relname AS name,
current_database() as catalog_name,
n.nspname AS schema_name
from pg_class c
left join pg_namespace n
on n.oid = c.relnamespace
where c.relkind = 'r' and n.nspname not in ('pg_catalog','information_schema')
</DefiningQuery>
</EntitySet>
<EntitySet Name="PgTableColumns" EntityType="NpgsqlSchema.TableColumn">
<DefiningQuery>
select
cast(a.attrelid as varchar) || '.' || cast (a.attnum as varchar) as id,
cast(c.oid as varchar) as table_id,
a.attname as name,
a.attnum as ordinal,
not a.attnotnull as is_nullable,
t.typname as type_name,
case
when t.typname in ('bpchar', 'varchar') and a.atttypmod != -1 then a.atttypmod - 4
when t.typname in ('bit', 'varbit') and a.atttypmod != -1 then a.atttypmod
else null
end as max_length,
case
when t.typname = 'numeric' and a.atttypmod != -1 then ((a.atttypmod - 4) >> 16) & 65535
else null
end as precision,
case
when t.typname in ('time', 'timestamp', 'timestamptz') and a.atttypmod != -1 then a.atttypmod
when t.typname = 'interval' and a.atttypmod & 65535 != 65535 then a.atttypmod & 65535
else null
end as datetime_precision,
case
when t.typname = 'numeric' and a.atttypmod != -1 then (a.atttypmod - 4) & 65535
else null
end as scale,
case
when t.typlen = -1 and t.typelem != 0 then true
else false
end as is_multiset,
null as collation_catalog_name,
null as collation_schema_name,
null as collation_name,
null as char_set_catalog_name,
null as char_set_schema_name,
null as char_set_name,
case
when pg_get_expr(ad.adbin, ad.adrelid) like 'nextval%' then true
else false
end as is_identity,
false as is_generated,
-- default value column
ad.adsrc as default_value
from pg_attribute a
join pg_class c
on a.attrelid = c.oid
join pg_type t
on a.atttypid = t.oid
left join pg_attrdef ad
on a.attrelid = ad.adrelid and a.attnum = ad.adnum
where t.typtype = 'b' and c.relkind = 'r' and a.attnum >= 0 and c.relnamespace in
(select oid from pg_namespace where nspname not in ('pg_catalog','information_schema'))
</DefiningQuery>
</EntitySet>
<EntitySet Name="PgConstraints" EntityType="NpgsqlSchema.Constraint">
<DefiningQuery>
select
cast(c.oid as varchar) as id,
cast(c.conrelid as varchar) as table_id,
c.conname as name,
c.condeferrable as is_deferrable,
c.condeferred as is_initially_deferred,
c.contype as constraint_type,
c.consrc as expression,
case c.confupdtype
when 'c' then 'CASCADE'
when 'n' then 'SET NULL'
when 'd' then 'SET DEFAULT'
when 'r' then 'RESTRICT'
when 'a' then 'NO ACTION'
else NULL
end AS update_rule,
case c.confdeltype
when 'c' then 'CASCADE'
when 'n' then 'SET NULL'
when 'd' then 'SET DEFAULT'
when 'r' then 'RESTRICT'
when 'a' then 'NO ACTION'
else NULL
end AS delete_rule
from pg_constraint c
</DefiningQuery>
</EntitySet>
<EntitySet Name="PgForeignKeyColumns" EntityType="NpgsqlSchema.ForeignKeyColumn">
<DefiningQuery>
select
cast(c.oid as varchar) || '.' || cast((c.confkey).n as varchar) as id,
(c.confkey).n as ordinal,
cast(pkc.attrelid as varchar) || '.' || cast (pkc.attnum as varchar) as from_columnid,
cast(fkc.attrelid as varchar) || '.' || cast (fkc.attnum as varchar) as to_columnid,
cast(c.oid as varchar) as constraint_id
from (select c.oid,
c.conname,
c.conrelid,
information_schema._pg_expandarray(c.conkey) as conkey,
c.confrelid,
information_schema._pg_expandarray(c.confkey) as confkey
from pg_constraint c
where contype = 'f') c
join pg_class pt on pt.oid = c.conrelid
join pg_class ft on ft.oid = c.confrelid
join pg_attribute pkc on pkc.attrelid = c.conrelid and pkc.attnum = (c.conkey).x
join pg_attribute fkc on fkc.attrelid = c.confrelid and fkc.attnum = (c.confkey).x
</DefiningQuery>
</EntitySet>
<EntitySet Name="PgViews" EntityType="NpgsqlSchema.View">
<DefiningQuery>
select
cast(c.oid as varchar) as id,
c.relname AS name,
current_database() as catalog_name,
n.nspname AS schema_name,
false as is_updatable,
pg_get_viewdef(c.oid) AS definition
from pg_class c
left join pg_namespace n
on n.oid = c.relnamespace
where c.relkind = 'v' and n.nspname not in ('pg_catalog','information_schema')
</DefiningQuery>
</EntitySet>
<EntitySet Name="PgViewColumns" EntityType="NpgsqlSchema.ViewColumn">
<DefiningQuery>
select
cast(a.attrelid as varchar) || '.' || cast (a.attnum as varchar) as id,
cast(c.oid as varchar) as view_id,
a.attname as name,
a.attnum as ordinal,
not a.attnotnull as is_nullable,
t.typname as type_name,
case
when t.typname in ('bpchar', 'varchar') and a.atttypmod != -1 then a.atttypmod - 4
when t.typname in ('bit', 'varbit') and a.atttypmod != -1 then a.atttypmod
else null
end as max_length,
case
when t.typname = 'numeric' and a.atttypmod != -1 then ((a.atttypmod - 4) >> 16) & 65535
else null
end as precision,
case
when t.typname in ('time', 'timestamp', 'timestamptz') and a.atttypmod != -1 then a.atttypmod
when t.typname = 'interval' and a.atttypmod & 65535 != 65535 then a.atttypmod & 65535
else null
end as datetime_precision,
case
when t.typname = 'numeric' and a.atttypmod != -1 then (a.atttypmod - 4) & 65535
else null
end as scale,
case
when t.typlen = -1 and t.typelem != 0 then true
else false
end as is_multiset,
null as collation_catalog_name,
null as collation_schema_name,
null as collation_name,
null as char_set_catalog_name,
null as char_set_schema_name,
null as char_set_name,
case
when pg_get_expr(ad.adbin, ad.adrelid) like 'nextval%' then true
else false
end as is_identity,
false as is_generated,
-- default value column
ad.adsrc as default_value
from pg_attribute a
join pg_class c
on a.attrelid = c.oid
join pg_type t
on a.atttypid = t.oid
left join pg_attrdef ad
on a.attrelid = ad.adrelid AND a.attnum = ad.adnum
where t.typtype = 'b' and c.relkind = 'v' and a.attnum >= 0 and c.relnamespace in
(select oid from pg_namespace where nspname not in ('pg_catalog','information_schema'))
</DefiningQuery>
</EntitySet>
<EntitySet Name="PgViewConstraints" EntityType="NpgsqlSchema.ViewConstraint">
<DefiningQuery>
select '1'::varchar as id, '1'::varchar as view_id, '1'::varchar as name, false as is_deferrable, false as is_initially_deferred, 'p'::varchar as constraint_type, '1'::varchar as expression, '1'::varchar as update_rule, '1'::varchar as delete_rule where 1=0
</DefiningQuery>
</EntitySet>
<EntitySet Name="PgViewForeignKeys" EntityType="NpgsqlSchema.ViewForeignKey">
<DefiningQuery>
select '1'::varchar as id, 0 as ordinal where 1=0
</DefiningQuery>
</EntitySet>
<EntitySet Name="PgFunctions" EntityType="NpgsqlSchema.Function">
<DefiningQuery>
select
cast(p.oid as varchar) as id,
current_database() as catalog_name,
n.nspname AS schema_name,
p.proname as name,
false as is_builtin,
false as is_niladic,
t.typname as returntype,
null as max_length,
null as precision,
null as datetime_precision,
null as scale,
case
when t.typlen = -1 and t.typelem != 0 then true
else false
end as is_multiset,
null as collation_catalog_name,
null as collation_schema_name,
null as collation_name,
null as char_set_catalog_name,
null as char_set_schema_name,
null as char_set_name,
false as is_aggregate
from pg_proc p
left join pg_namespace n
on n.oid = p.pronamespace
left join pg_type t
on p.prorettype = t.oid
where (p.proretset = false and t.typname != 'void') and n.nspname not in ('pg_catalog','information_schema') and p.proname not in (select pg_proc.proname from pg_proc group by pg_proc.proname having count(pg_proc.proname) > 1)
</DefiningQuery>
</EntitySet>
<EntitySet Name="PgFunctionParameters" EntityType="NpgsqlSchema.FunctionParameter">
<DefiningQuery>
select
cast(ss.p_oid as varchar) || '.' || cast((ss.x).n as varchar) as id,
cast(ss.p_oid as varchar) as function_id,
case
when NULLIF(ss.proargnames[(ss.x).n], '') is null then 'x'
else ss.proargnames[(ss.x).n]
end as name,
(ss.x).n as ordinal,
t.typname as type_name,
null as max_length,
null as precision,
null as datetime_precision,
null as scale,
case
when t.typlen = -1 and t.typelem != 0 then true
else false
end as is_multiset,
null as collation_catalog_name,
null as collation_schema_name,
null as collation_name,
null as char_set_catalog_name,
null as char_set_schema_name,
null as char_set_name,
case
when ss.proargmodes IS null then 'IN'
when ss.proargmodes[(ss.x).n] = 'i' then 'IN'
when ss.proargmodes[(ss.x).n] = 'o' then 'OUT'
when ss.proargmodes[(ss.x).n] = 'b' then 'INOUT'
else null
end as mode,
null as default
from pg_type t
join (select
n.nspname AS n_nspname,
p.proname,
p.oid AS p_oid,
p.proargnames,
p.proargmodes,
p.proretset,
p.prorettype,
information_schema._pg_expandarray(COALESCE(p.proallargtypes, p.proargtypes::oid[])) AS x
from pg_namespace n
join pg_proc p
on n.oid = p.pronamespace and p.proname not in (select pg_proc.proname from pg_proc group by pg_proc.proname having count(pg_proc.proname) > 1)) ss
on t.oid = (ss.x).x
join pg_type rt
on ss.prorettype = rt.oid
where (ss.proretset = false and rt.typname != 'void') and ss.n_nspname not in ('pg_catalog','information_schema')
</DefiningQuery>
</EntitySet>
<EntitySet Name="PgProcedures" EntityType="NpgsqlSchema.Procedure">
<DefiningQuery>
select
cast(p.oid as varchar) as id,
current_database() as catalog_name,
n.nspname AS schema_name,
p.proname as name,
false as is_builtin,
false as is_niladic,
--t.typname as returntype,
false as is_aggregate
from pg_proc p
left join pg_namespace n
on n.oid = p.pronamespace
left join pg_type t
on p.prorettype = t.oid
where (p.proretset = true or t.typname = 'void') and n.nspname not in ('pg_catalog','information_schema') and p.proname not in (select pg_proc.proname from pg_proc group by pg_proc.proname having count(pg_proc.proname) > 1)
</DefiningQuery>
</EntitySet>
<EntitySet Name="PgProcedureParameters" EntityType="NpgsqlSchema.ProcedureParameter">
<DefiningQuery>
select
cast(ss.p_oid as varchar) || '.' || cast((ss.x).n as varchar) as id,
cast(ss.p_oid as varchar) as procedure_id,
case
when NULLIF(ss.proargnames[(ss.x).n], '') is null then 'x'
else ss.proargnames[(ss.x).n]
end as name,
(ss.x).n as ordinal,
t.typname as type_name,
null as max_length,
null as precision,
null as datetime_precision,
null as scale,
case
when t.typlen = -1 and t.typelem != 0 then true
else false
end as is_multiset,
null as collation_catalog_name,
null as collation_schema_name,
null as collation_name,
null as char_set_catalog_name,
null as char_set_schema_name,
null as char_set_name,
case
when ss.proargmodes IS null then 'IN'
when ss.proargmodes[(ss.x).n] = 'i' then 'IN'
when ss.proargmodes[(ss.x).n] = 'o' then 'OUT'
when ss.proargmodes[(ss.x).n] = 'b' then 'INOUT'
else null
end as mode,
null as default
from pg_type t
join (select
n.nspname AS n_nspname,
p.proname,
p.oid AS p_oid,
p.proargnames,
p.proargmodes,
p.proretset,
p.prorettype,
information_schema._pg_expandarray(COALESCE(p.proallargtypes, p.proargtypes::oid[])) AS x
from pg_namespace n
join pg_proc p
on n.oid = p.pronamespace and p.proname not in (select pg_proc.proname from pg_proc group by pg_proc.proname having count(pg_proc.proname) > 1)) ss
on t.oid = (ss.x).x
join pg_type rt
on ss.prorettype = rt.oid
where (ss.proretset = true or rt.typname = 'void') and ss.n_nspname not in ('pg_catalog','information_schema')
</DefiningQuery>
</EntitySet>
<EntitySet Name="PgConstraintColumns" EntityType="NpgsqlSchema.ConstraintColumn">
<DefiningQuery>
select
cast(a.attrelid as varchar) || '.' || cast (a.attnum as varchar) as column_id,
cast(coid as varchar) as constraint_id,
(ss.x).n as ordinal
from pg_attribute a
join (select
r.oid AS roid,
c.oid as coid,
c.conname,
information_schema._pg_expandarray(c.conkey) as x,
r.relnamespace as rrelnamespace
from pg_constraint c
join pg_class r
on r.oid = c.conrelid
where r.relkind = 'r') ss
on a.attrelid = ss.roid and a.attnum = (ss.x).x and not a.attisdropped and rrelnamespace in
(select oid from pg_namespace where nspname not in ('pg_catalog','information_schema'))
</DefiningQuery>
</EntitySet>
<EntitySet Name="PgViewConstraintColumns" EntityType="NpgsqlSchema.ViewConstraintColumn">
<DefiningQuery>
select '1'::varchar as column_id, '1'::varchar as constraint_id where 1=0
</DefiningQuery>
</EntitySet>
<EntitySet Name="PgViewForeignKeyColumns" EntityType="NpgsqlSchema.ViewForeignKeyColumn">
<DefiningQuery>
select '1'::varchar as id, '1'::varchar as constraint_id, '1'::varchar as from_columnid, '1'::varchar as to_columnid, 0 as ordinal where 1=0
</DefiningQuery>
</EntitySet>
<AssociationSet Association="NpgsqlSchema.TableTableColumn" Name="TableTableColumns" />
<AssociationSet Association="NpgsqlSchema.TableTableConstraint" Name="TableTableConstraints"/>
<AssociationSet Association="NpgsqlSchema.TableConstraintColumn" Name="TableConstraintColumns"/>
<AssociationSet Association="NpgsqlSchema.RelationshipRelationshipColumnMap" Name="RelationshipRelationshipColumnMaps" />
<AssociationSet Association="NpgsqlSchema.FromColumnRelationshipColumnMap" Name="FromColumnRelationshipColumnMaps" />
<AssociationSet Association="NpgsqlSchema.ToColumnRelationshipColumnMap" Name="ToColumnRelationshipColumnMaps" />
<AssociationSet Association="NpgsqlSchema.ViewViewColumn" Name="ViewViewColumns" />
<AssociationSet Association="NpgsqlSchema.FunctionFunctionParameter" Name="FunctionFunctionParameters" />
</EntityContainer>
<EntityType Name="Table">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="varchar" Nullable="false"/>
<Property Name="name" Type="varchar" Nullable="false"/>
<Property Name="catalog_name" Type="varchar"/>
<Property Name="schema_name" Type="varchar"/>
</EntityType>
<EntityType Name="TableColumn">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="varchar" Nullable="false"/>
<Property Name="table_id" Type="varchar" Nullable="false"/>
<Property Name="name" Type="varchar" Nullable="false"/>
<Property Name="ordinal" Type="int4" Nullable="false"/>
<Property Name="is_nullable" Type="bool" Nullable="false"/>
<Property Name="type_name" Type="varchar" Nullable="false"/>
<Property Name="max_length" Type="int4"/>
<Property Name="precision" Type="int4"/>
<Property Name="datetime_precision" Type="int4"/>
<Property Name="scale" Type="int4"/>
<Property Name="collation_catalog_name" Type="varchar"/>
<Property Name="collation_schema_name" Type="varchar"/>
<Property Name="collation_name" Type="varchar"/>
<Property Name="char_set_catalog_name" Type="varchar"/>
<Property Name="char_set_schema_name" Type="varchar"/>
<Property Name="char_set_name" Type="varchar"/>
<Property Name="is_multiset" Type="bool" Nullable="false"/>
<Property Name="is_identity" Type="bool" Nullable="false"/>
<Property Name="is_generated" Type="bool" Nullable="false"/>
<Property Name="default_value" Type="text"/>
</EntityType>
<EntityType Name="Constraint">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="varchar" Nullable="false"/>
<Property Name="table_id" Type="varchar" Nullable="false"/>
<Property Name="name" Type="varchar" Nullable="false"/>
<Property Name="is_deferrable" Type="bool" Nullable="false"/>
<Property Name="is_initially_deferred" Type="bool" Nullable="false"/>
<Property Name="constraint_type" Type="varchar"/>
<Property Name="expression" Type="text"/>
<Property Name="update_rule" Type="text"/>
<Property Name="delete_rule" Type="text"/>
</EntityType>
<EntityType Name="ForeignKey">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="varchar" Nullable="false"/>
<Property Name="name" Type="varchar" Nullable="false"/>
<Property Name="update_rule" Type="varchar" Nullable="false"/>
<Property Name="delete_rule" Type="varchar" Nullable="false"/>
</EntityType>
<EntityType Name="ForeignKeyColumn">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="varchar" Nullable="false"/>
<Property Name="ordinal" Type="int4" Nullable="false"/>
<Property Name="to_columnid" Type="varchar" Nullable="false"/>
<Property Name="from_columnid" Type="varchar" Nullable="false"/>
<Property Name="constraint_id" Type="varchar" Nullable="false"/>
</EntityType>
<EntityType Name="View">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="varchar" Nullable="false"/>
<Property Name="name" Type="varchar" Nullable="false"/>
<Property Name="catalog_name" Type="varchar"/>
<Property Name="schema_name" Type="varchar"/>
<Property Name="definition" Type="text"/>
<Property Name="is_updatable" Type="bool" Nullable="false"/>
</EntityType>
<EntityType Name="ViewColumn">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="varchar" Nullable="false"/>
<Property Name="view_id" Type="varchar" Nullable="false"/>
<Property Name="name" Type="varchar" Nullable="false"/>
<Property Name="ordinal" Type="int4" Nullable="false"/>
<Property Name="is_nullable" Type="bool" Nullable="false"/>
<Property Name="type_name" Type="varchar" Nullable="false"/>
<Property Name="max_length" Type="int4"/>
<Property Name="precision" Type="int4"/>
<Property Name="datetime_precision" Type="int4"/>
<Property Name="scale" Type="int4"/>
<Property Name="collation_catalog_name" Type="varchar"/>
<Property Name="collation_schema_name" Type="varchar"/>
<Property Name="collation_name" Type="varchar"/>
<Property Name="char_set_catalog_name" Type="varchar"/>
<Property Name="char_set_schema_name" Type="varchar"/>
<Property Name="char_set_name" Type="varchar"/>
<Property Name="is_multiset" Type="bool" Nullable="false"/>
<Property Name="is_identity" Type="bool" Nullable="false"/>
<Property Name="is_generated" Type="bool" Nullable="false"/>
<Property Name="default_value" Type="text"/>
</EntityType>
<EntityType Name="ViewConstraint">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="varchar" Nullable="false"/>
<Property Name="view_id" Type="varchar" Nullable="false"/>
<Property Name="name" Type="varchar" Nullable="false"/>
<Property Name="is_deferrable" Type="bool" Nullable="false"/>
<Property Name="is_initially_deferred" Type="bool" Nullable="false"/>
<Property Name="constraint_type" Type="varchar" Nullable="false"/>
<Property Name="expression" Type="text"/>
<Property Name="update_rule" Type="text"/>
<Property Name="delete_rule" Type="text"/>
</EntityType>
<EntityType Name="ViewForeignKey">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="varchar" Nullable="false"/>
<Property Name="ordinal" Type="int4" Nullable="false"/>
</EntityType>
<EntityType Name="Function">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="varchar" Nullable="false"/>
<Property Name="catalog_name" Type="varchar"/>
<Property Name="schema_name" Type="varchar"/>
<Property Name="name" Type="varchar" Nullable="false"/>
<Property Name="is_builtin" Type="bool"/>
<Property Name="is_niladic" Type="bool"/>
<Property Name="returntype" Type="varchar"/>
<Property Name="max_length" Type="int4"/>
<Property Name="precision" Type="int4"/>
<Property Name="datetime_precision" Type="int4"/>
<Property Name="scale" Type="int4"/>
<Property Name="collation_catalog_name" Type="varchar"/>
<Property Name="collation_schema_name" Type="varchar"/>
<Property Name="collation_name" Type="varchar"/>
<Property Name="char_set_catalog_name" Type="varchar"/>
<Property Name="char_set_schema_name" Type="varchar"/>
<Property Name="char_set_name" Type="varchar"/>
<Property Name="is_multiset" Type="bool" Nullable="false"/>
<Property Name="is_aggregate" Type="bool"/>
</EntityType>
<EntityType Name="FunctionParameter">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="varchar" Nullable="false"/>
<Property Name="function_id" Type="varchar" Nullable="false"/>
<Property Name="name" Type="text" Nullable="false"/>
<Property Name="ordinal" Type="int4" Nullable="false"/>
<Property Name="type_name" Type="varchar" Nullable="false"/>
<Property Name="max_length" Type="int4"/>
<Property Name="precision" Type="int4"/>
<Property Name="datetime_precision" Type="int4"/>
<Property Name="scale" Type="int4"/>
<Property Name="collation_catalog_name" Type="varchar"/>
<Property Name="collation_schema_name" Type="varchar"/>
<Property Name="collation_name" Type="varchar"/>
<Property Name="char_set_catalog_name" Type="varchar"/>
<Property Name="char_set_schema_name" Type="varchar"/>
<Property Name="char_set_name" Type="varchar"/>
<Property Name="is_multiset" Type="bool" Nullable="false"/>
<Property Name="mode" Type="varchar"/>
<Property Name="default" Type="text"/>
</EntityType>
<EntityType Name="Procedure">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="varchar" Nullable="false"/>
<Property Name="catalog_name" Type="varchar"/>
<Property Name="schema_name" Type="varchar"/>
<Property Name="name" Type="varchar" Nullable="false"/>
</EntityType>
<EntityType Name="ProcedureParameter">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="varchar" Nullable="false"/>
<Property Name="procedure_id" Type="varchar" Nullable="false"/>
<Property Name="name" Type="text" Nullable="false"/>
<Property Name="ordinal" Type="int4" Nullable="false"/>
<Property Name="type_name" Type="varchar" Nullable="false"/>
<Property Name="max_length" Type="int4"/>
<Property Name="precision" Type="int4"/>
<Property Name="datetime_precision" Type="int4"/>
<Property Name="scale" Type="int4"/>
<Property Name="collation_catalog_name" Type="varchar"/>
<Property Name="collation_schema_name" Type="varchar"/>
<Property Name="collation_name" Type="varchar"/>
<Property Name="char_set_catalog_name" Type="varchar"/>
<Property Name="char_set_schema_name" Type="varchar"/>
<Property Name="char_set_name" Type="varchar"/>
<Property Name="is_multiset" Type="bool" Nullable="false"/>
<Property Name="mode" Type="varchar"/>
<Property Name="default" Type="text"/>
</EntityType>
<EntityType Name="ConstraintColumn">
<Key>
<PropertyRef Name="column_id"/>
<PropertyRef Name="constraint_id"/>
</Key>
<Property Name="column_id" Type="varchar" Nullable="false"/>
<Property Name="constraint_id" Type="varchar" Nullable="false"/>
</EntityType>
<EntityType Name="ViewForeignKeyColumn">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="varchar" Nullable="false"/>
<Property Name="constraint_id" Type="varchar" Nullable="false"/>
<Property Name="from_columnid" Type="varchar" Nullable="false"/>
<Property Name="to_columnid" Type="varchar" Nullable="false"/>
</EntityType>
<EntityType Name="ViewConstraintColumn">
<Key>
<PropertyRef Name="column_id"/>
<PropertyRef Name="constraint_id"/>
</Key>
<Property Name="column_id" Type="varchar" Nullable="false"/>
<Property Name="constraint_id" Type="varchar" Nullable="false"/>
</EntityType>
<Association Name="TableTableColumn">
<End Type="NpgsqlSchema.Table" Role="Table" Multiplicity="1"/>
<End Type="NpgsqlSchema.TableColumn" Role="TableColumn" Multiplicity="*"/>
<ReferentialConstraint>
<Principal Role="Table">
<PropertyRef Name="id"/>
</Principal>
<Dependent Role="TableColumn">
<PropertyRef Name="table_id"/>
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="TableTableConstraint">
<End Type="NpgsqlSchema.Table" Role="Table" Multiplicity="1"/>
<End Type="NpgsqlSchema.Constraint" Role="Constraint" Multiplicity="*"/>
<ReferentialConstraint>
<Principal Role="Table">
<PropertyRef Name="id"/>
</Principal>
<Dependent Role="Constraint">
<PropertyRef Name="table_id"/>
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="TableConstraintColumn">
<End Type="NpgsqlSchema.Constraint" Role="Constraint" Multiplicity="1"/>
<End Type="NpgsqlSchema.ConstraintColumn" Role="ConstraintColumn" Multiplicity="*"/>
<ReferentialConstraint>
<Principal Role="Constraint">
<PropertyRef Name="id"/>
</Principal>
<Dependent Role="ConstraintColumn">
<PropertyRef Name="constraint_id"/>
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="RelationshipRelationshipColumnMap">
<End Type="NpgsqlSchema.Constraint" Role="ForeignKey" Multiplicity="1"/>
<End Type="NpgsqlSchema.ForeignKeyColumn" Role="ForeignKeyColumn" Multiplicity="*"/>
<ReferentialConstraint>
<Principal Role="ForeignKey">
<PropertyRef Name="id"/>
</Principal>
<Dependent Role="ForeignKeyColumn">
<PropertyRef Name="constraint_id"/>
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FromColumnRelationshipColumnMap">
<End Type="NpgsqlSchema.TableColumn" Role="TableColumn" Multiplicity="1"/>
<End Type="NpgsqlSchema.ForeignKeyColumn" Role="ForeignKeyColumn" Multiplicity="*"/>
<ReferentialConstraint>
<Principal Role="TableColumn">
<PropertyRef Name="id"/>
</Principal>
<Dependent Role="ForeignKeyColumn">
<PropertyRef Name="from_columnid"/>
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="ToColumnRelationshipColumnMap">
<End Type="NpgsqlSchema.TableColumn" Role="TableColumn" Multiplicity="1"/>
<End Type="NpgsqlSchema.ForeignKeyColumn" Role="ForeignKeyColumn" Multiplicity="*"/>
<ReferentialConstraint>
<Principal Role="TableColumn">
<PropertyRef Name="id"/>
</Principal>
<Dependent Role="ForeignKeyColumn">
<PropertyRef Name="to_columnid"/>
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="ViewViewColumn">
<End Type="NpgsqlSchema.View" Role="View" Multiplicity="1"/>
<End Type="NpgsqlSchema.ViewColumn" Role="ViewColumn" Multiplicity="*"/>
<ReferentialConstraint>
<Principal Role="View">
<PropertyRef Name="id"/>
</Principal>
<Dependent Role="ViewColumn">
<PropertyRef Name="view_id"/>
</Dependent>
</ReferentialConstraint>
</Association>
<Association Name="FunctionFunctionParameter">
<End Type="NpgsqlSchema.Function" Role="Function" Multiplicity="1"/>
<End Type="NpgsqlSchema.FunctionParameter" Role="FunctionParameter" Multiplicity="*"/>
<ReferentialConstraint>
<Principal Role="Function">
<PropertyRef Name="id"/>
</Principal>
<Dependent Role="FunctionParameter">
<PropertyRef Name="function_id"/>
</Dependent>
</ReferentialConstraint>
</Association>
</Schema>