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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
|
--
-- PostgreSQL database dump
--
SET client_encoding = 'SQL_ASCII';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
--
-- Name: cvslog; Type: SCHEMA; Schema: -; Owner: postgres
--
CREATE SCHEMA cvslog;
ALTER SCHEMA cvslog OWNER TO postgres;
--
-- Name: pgcrypto; Type: SCHEMA; Schema: -; Owner: pgsql
--
CREATE SCHEMA pgcrypto;
ALTER SCHEMA pgcrypto OWNER TO pgsql;
--
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: stefan
--
CREATE PROCEDURAL LANGUAGE plpgsql;
ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO stefan;
SET search_path = cvslog, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: branches; Type: TABLE; Schema: cvslog; Owner: postgres; Tablespace:
--
CREATE TABLE branches (
branchid integer NOT NULL,
branchname text NOT NULL,
lastcheck timestamp with time zone DEFAULT '1996-01-01 00:00:00+00'::timestamp with time zone NOT NULL,
active boolean DEFAULT false NOT NULL
);
ALTER TABLE cvslog.branches OWNER TO postgres;
--
-- Name: commits; Type: TABLE; Schema: cvslog; Owner: postgres; Tablespace:
--
CREATE TABLE commits (
commitid integer NOT NULL,
branch integer NOT NULL,
"time" timestamp with time zone NOT NULL,
author text NOT NULL,
message text NOT NULL
);
ALTER TABLE cvslog.commits OWNER TO postgres;
--
-- Name: files; Type: TABLE; Schema: cvslog; Owner: postgres; Tablespace:
--
CREATE TABLE files (
fileid integer NOT NULL,
commitid integer NOT NULL,
filename text NOT NULL,
revision text NOT NULL,
linesadded integer NOT NULL,
linesremoved integer NOT NULL
);
ALTER TABLE cvslog.files OWNER TO postgres;
SET search_path = public, pg_catalog;
--
-- Name: applications; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE applications (
id character varying(100) NOT NULL,
version character varying(20) NOT NULL,
name text NOT NULL,
active boolean DEFAULT true NOT NULL,
description text NOT NULL,
category text NOT NULL,
pgversion character varying(5),
edbversion character varying(5),
format character varying(4) NOT NULL,
installoptions text,
upgradeoptions text,
checksum character varying(32) NOT NULL,
mirrorpath text,
alturl text,
dependencies character varying(100)[],
versionkey text NOT NULL,
platform character varying(20) NOT NULL,
secondaryplatform character varying(20)
);
ALTER TABLE public.applications OWNER TO "186_pgsql";
SET default_with_oids = true;
--
-- Name: clickthrus; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE clickthrus (
id bigint NOT NULL,
ts timestamp without time zone DEFAULT ('now'::text)::timestamp(6) without time zone,
scheme character varying(4),
host character varying(100),
path text,
country character(2)
);
ALTER TABLE public.clickthrus OWNER TO "186_pgsql";
--
-- Name: clickthrus_id_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE clickthrus_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.clickthrus_id_seq OWNER TO "186_pgsql";
--
-- Name: clickthrus_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 186_pgsql
--
ALTER SEQUENCE clickthrus_id_seq OWNED BY clickthrus.id;
SET default_with_oids = false;
--
-- Name: clickthrus2; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE clickthrus2 (
id bigint DEFAULT nextval('clickthrus_id_seq'::regclass) NOT NULL,
ts timestamp with time zone DEFAULT now() NOT NULL,
mirror integer NOT NULL,
protocol character(1) NOT NULL,
client inet,
path text
);
ALTER TABLE public.clickthrus2 OWNER TO "186_pgsql";
SET default_with_oids = true;
--
-- Name: comment_rejects; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE comment_rejects (
re character varying(128) NOT NULL
);
ALTER TABLE public.comment_rejects OWNER TO "186_pgsql";
SET default_with_oids = false;
--
-- Name: comments; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE comments (
id integer DEFAULT nextval(('"comments_id_seq"'::text)::regclass) NOT NULL,
version numeric(2,1),
file character varying(64),
comment text,
posted_at timestamp with time zone DEFAULT now(),
posted_by text,
posted_ip character varying(16),
approved boolean DEFAULT false NOT NULL,
processed boolean DEFAULT false NOT NULL
);
ALTER TABLE public.comments OWNER TO "186_pgsql";
--
-- Name: communitypages; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE communitypages (
pageid integer NOT NULL,
version integer DEFAULT 0 NOT NULL,
syspage integer DEFAULT 0 NOT NULL,
parent integer NOT NULL,
author character varying(16) NOT NULL,
origauthor character varying(16) NOT NULL,
savedate timestamp with time zone DEFAULT now() NOT NULL,
title character varying(128) NOT NULL,
shorttitle character varying(128) NOT NULL,
contents text NOT NULL
);
ALTER TABLE public.communitypages OWNER TO "186_pgsql";
--
-- Name: communitypages_breadcrumb_type; Type: TYPE; Schema: public; Owner: 186_pgsql
--
CREATE TYPE communitypages_breadcrumb_type AS (
pageid integer,
title character varying(128)
);
ALTER TYPE public.communitypages_breadcrumb_type OWNER TO "186_pgsql";
--
-- Name: communitypages_files; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE communitypages_files (
fileid integer NOT NULL,
pageid integer NOT NULL,
author character varying(16) NOT NULL,
title character varying(128) NOT NULL,
mimetype character varying(64) NOT NULL,
image bytea
);
ALTER TABLE public.communitypages_files OWNER TO "186_pgsql";
--
-- Name: communitypages_history; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE communitypages_history (
pageid integer NOT NULL,
version integer NOT NULL,
author character varying(16) NOT NULL,
savedate timestamp with time zone NOT NULL,
title character varying(128) NOT NULL,
shorttitle character varying(128) NOT NULL,
contents text NOT NULL
);
ALTER TABLE public.communitypages_history OWNER TO "186_pgsql";
--
-- Name: communitypages_root; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE communitypages_root (
pageid integer NOT NULL,
template character varying(128)
);
ALTER TABLE public.communitypages_root OWNER TO "186_pgsql";
--
-- Name: communitypages_work; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE communitypages_work (
pageid integer NOT NULL,
parent integer NOT NULL,
syspage integer DEFAULT 0 NOT NULL,
author character varying(16) NOT NULL,
ready integer DEFAULT 0 NOT NULL,
savedate timestamp with time zone DEFAULT now() NOT NULL,
title character varying(128) NOT NULL,
shorttitle character varying(128) NOT NULL,
contents text NOT NULL
);
ALTER TABLE public.communitypages_work OWNER TO "186_pgsql";
--
-- Name: communitypages_work_files; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE communitypages_work_files (
fileid integer NOT NULL,
pageid integer NOT NULL,
author character varying(16) NOT NULL,
title character varying(128) NOT NULL,
mimetype character varying(64) NOT NULL,
image bytea
);
ALTER TABLE public.communitypages_work_files OWNER TO "186_pgsql";
SET default_with_oids = true;
--
-- Name: countries; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE countries (
id integer NOT NULL,
name text,
tld character varying(3)
);
ALTER TABLE public.countries OWNER TO "186_pgsql";
--
-- Name: developers_id_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE developers_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.developers_id_seq OWNER TO "186_pgsql";
SET default_with_oids = false;
--
-- Name: developers; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE developers (
id integer DEFAULT nextval('developers_id_seq'::regclass) NOT NULL,
type integer NOT NULL,
lastname text NOT NULL,
firstname text NOT NULL,
email text NOT NULL,
company text,
companyurl text,
location text,
contribution text
);
ALTER TABLE public.developers OWNER TO "186_pgsql";
--
-- Name: developers_types_type_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE developers_types_type_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.developers_types_type_seq OWNER TO "186_pgsql";
--
-- Name: developers_types; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE developers_types (
type integer DEFAULT nextval('developers_types_type_seq'::regclass) NOT NULL,
typename character varying(32),
sortorder integer NOT NULL,
extrainfo text,
detailed integer DEFAULT 1 NOT NULL
);
ALTER TABLE public.developers_types OWNER TO "186_pgsql";
SET default_with_oids = true;
--
-- Name: docs; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE docs (
id integer DEFAULT nextval(('docs_id_seq'::text)::regclass) NOT NULL,
file character varying(64) NOT NULL,
version numeric(2,1) NOT NULL,
title character varying(256),
content text,
dirty boolean
);
ALTER TABLE public.docs OWNER TO "186_pgsql";
--
-- Name: events; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE events (
id integer DEFAULT nextval(('"events_id_seq"'::text)::regclass) NOT NULL,
posted date DEFAULT ('now'::text)::date,
posted_by character varying(64),
approved boolean DEFAULT false,
start_date date,
end_date date,
training boolean DEFAULT false,
organisation text
);
ALTER TABLE public.events OWNER TO "186_pgsql";
--
-- Name: events_location; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE events_location (
eventid integer NOT NULL,
country integer NOT NULL,
state text,
city text
);
ALTER TABLE public.events_location OWNER TO "186_pgsql";
--
-- Name: events_text; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE events_text (
eventid integer NOT NULL,
language character varying(5) DEFAULT 'en'::character varying NOT NULL,
event text NOT NULL,
summary text NOT NULL,
details text NOT NULL,
modified timestamp(0) with time zone DEFAULT now() NOT NULL,
CONSTRAINT events_text_language CHECK (((language)::text ~ '[a-z]{2}(-[a-z]{2})?'::text))
);
ALTER TABLE public.events_text OWNER TO "186_pgsql";
SET default_with_oids = false;
--
-- Name: features_categories; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE features_categories (
categoryid integer NOT NULL,
categoryname text NOT NULL,
categorydescription text NOT NULL
);
ALTER TABLE public.features_categories OWNER TO "186_pgsql";
--
-- Name: features_features; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE features_features (
featureid integer NOT NULL,
groupid integer NOT NULL,
featurename text NOT NULL,
featuredescription text DEFAULT ''::text
);
ALTER TABLE public.features_features OWNER TO "186_pgsql";
--
-- Name: features_groups; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE features_groups (
groupid integer NOT NULL,
groupsort integer NOT NULL,
groupname text NOT NULL,
category integer NOT NULL
);
ALTER TABLE public.features_groups OWNER TO "186_pgsql";
--
-- Name: features_log; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE features_log (
ts timestamp with time zone DEFAULT now() NOT NULL,
userid character varying(16) NOT NULL,
txt text NOT NULL
);
ALTER TABLE public.features_log OWNER TO "186_pgsql";
--
-- Name: features_matrix; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE features_matrix (
version integer NOT NULL,
feature integer NOT NULL,
state integer NOT NULL
);
ALTER TABLE public.features_matrix OWNER TO "186_pgsql";
--
-- Name: features_versions; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE features_versions (
versionid integer NOT NULL,
versionname text NOT NULL,
active boolean DEFAULT false NOT NULL,
category integer NOT NULL
);
ALTER TABLE public.features_versions OWNER TO "186_pgsql";
--
-- Name: frontends; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE frontends (
id integer NOT NULL,
name character varying(64) NOT NULL,
ip character varying(64) NOT NULL
);
ALTER TABLE public.frontends OWNER TO "186_pgsql";
SET default_with_oids = true;
--
-- Name: iptocountry; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE iptocountry (
id integer DEFAULT nextval(('iptocountry_id_seq'::text)::regclass) NOT NULL,
startip bigint NOT NULL,
endip bigint NOT NULL,
countrycode character(2) NOT NULL,
country character varying(100) NOT NULL
);
ALTER TABLE public.iptocountry OWNER TO "186_pgsql";
SET default_with_oids = false;
--
-- Name: listgroups; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE listgroups (
id integer NOT NULL,
name character varying(64) NOT NULL,
sortkey integer NOT NULL
);
ALTER TABLE public.listgroups OWNER TO "186_pgsql";
--
-- Name: lists; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE lists (
id integer NOT NULL,
name character varying(64) NOT NULL,
active integer NOT NULL,
grp integer NOT NULL,
description text NOT NULL,
shortdesc text
);
ALTER TABLE public.lists OWNER TO "186_pgsql";
SET default_with_oids = true;
--
-- Name: mirrors; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE mirrors (
id integer DEFAULT nextval(('"mirrors_id_seq"'::text)::regclass) NOT NULL,
country_name character varying(50) NOT NULL,
country_code character varying(2) NOT NULL,
mirror_created timestamp with time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL,
mirror_last_rsync timestamp with time zone DEFAULT '1970-01-01 00:00:00+00'::timestamp with time zone NOT NULL,
mirror_type character varying(10) NOT NULL,
mirror_index smallint NOT NULL,
host_addr inet DEFAULT '0.0.0.0'::inet,
host_path character varying(100),
host_sponsor character varying(100),
host_contact character varying(100),
host_email character varying(100),
host_notes text,
rsync_host1 character varying(100),
rsync_host2 character varying(100),
host_port character varying(5),
mirror_active boolean DEFAULT true NOT NULL,
mirror_dns boolean DEFAULT false NOT NULL,
mirror_private boolean DEFAULT false NOT NULL,
host_use_cname boolean DEFAULT false,
host_cname_host character varying(100),
mirror_primary boolean DEFAULT false NOT NULL,
error_count integer DEFAULT 0 NOT NULL,
alternate_protocol boolean DEFAULT false NOT NULL,
alternate_at_root boolean DEFAULT false NOT NULL
);
ALTER TABLE public.mirrors OWNER TO "186_pgsql";
--
-- Name: news; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE news (
id integer DEFAULT nextval(('"news_id_seq"'::text)::regclass) NOT NULL,
posted date DEFAULT ('now'::text)::date,
posted_by character varying(64),
active boolean DEFAULT false,
approved boolean DEFAULT false
);
ALTER TABLE public.news OWNER TO "186_pgsql";
--
-- Name: news_text; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE news_text (
newsid integer NOT NULL,
language character varying(5) DEFAULT 'en'::character varying NOT NULL,
headline text NOT NULL,
summary text NOT NULL,
story text NOT NULL,
modified timestamp(0) with time zone DEFAULT now() NOT NULL,
CONSTRAINT news_text_language CHECK (((language)::text ~ '[a-z]{2}(-[a-z]{2})?'::text))
);
ALTER TABLE public.news_text OWNER TO "186_pgsql";
SET default_with_oids = false;
--
-- Name: organisations; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE organisations (
id integer NOT NULL,
name text NOT NULL,
address text,
url text,
email text,
phone text,
orgtype character(1) NOT NULL,
contact character varying(16) NOT NULL,
approved boolean DEFAULT false NOT NULL,
lastconfirmed timestamp with time zone DEFAULT now() NOT NULL,
CONSTRAINT check_orgtype CHECK ((orgtype = ANY (ARRAY['p'::bpchar, 'c'::bpchar, 'i'::bpchar, 'n'::bpchar])))
);
ALTER TABLE public.organisations OWNER TO "186_pgsql";
--
-- Name: product_categories; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE product_categories (
id integer NOT NULL,
name text,
blurb text DEFAULT ''::text NOT NULL
);
ALTER TABLE public.product_categories OWNER TO "186_pgsql";
--
-- Name: products; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE products (
id integer NOT NULL,
publisher integer NOT NULL,
name text NOT NULL,
url text NOT NULL,
category integer NOT NULL,
description text NOT NULL,
price text,
licence character(1) NOT NULL,
contact character varying(16) NOT NULL,
approved boolean DEFAULT false NOT NULL,
lastconfirmed timestamp with time zone DEFAULT now() NOT NULL,
CONSTRAINT products_licence_check CHECK ((licence = ANY (ARRAY['o'::bpchar, 'c'::bpchar, 'f'::bpchar, 'm'::bpchar])))
);
ALTER TABLE public.products OWNER TO "186_pgsql";
SET default_with_oids = true;
--
-- Name: profserv; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE profserv (
id integer NOT NULL,
email character varying(246) NOT NULL,
lastconfirmed timestamp with time zone DEFAULT ('now'::text)::timestamp(6) with time zone NOT NULL,
name character varying(256) NOT NULL,
description character varying(1024) NOT NULL,
employees character varying(32),
locations character varying(128),
region_africa boolean NOT NULL,
region_asia boolean NOT NULL,
region_europe boolean NOT NULL,
region_northamerica boolean NOT NULL,
region_oceania boolean NOT NULL,
region_southamerica boolean NOT NULL,
hours character varying(128),
languages character varying(256),
customerexample character varying(4096),
experience character varying(2048),
contact character varying(1024),
url character varying(256),
provides_support boolean NOT NULL,
provides_hosting boolean NOT NULL,
interfaces character varying(512),
approved boolean DEFAULT false NOT NULL
);
ALTER TABLE public.profserv OWNER TO "186_pgsql";
--
-- Name: quotes; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE quotes (
id integer NOT NULL,
active boolean,
approved boolean
);
ALTER TABLE public.quotes OWNER TO "186_pgsql";
--
-- Name: quotes_text; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE quotes_text (
quoteid integer NOT NULL,
language character varying(5) DEFAULT 'en'::character varying NOT NULL,
quote text,
tagline text,
modified timestamp with time zone DEFAULT now(),
CONSTRAINT "$2" CHECK (((language)::text ~ '[a-z]{2}(-[a-z]{2})?'::text))
);
ALTER TABLE public.quotes_text OWNER TO "186_pgsql";
--
-- Name: survey_lock; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE survey_lock (
ipaddr character varying(15) NOT NULL,
voted timestamp with time zone DEFAULT now()
);
ALTER TABLE public.survey_lock OWNER TO "186_pgsql";
--
-- Name: survey_questions; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE survey_questions (
surveyid integer NOT NULL,
language character varying(5) DEFAULT 'en'::character varying NOT NULL,
question text NOT NULL,
opt1 text,
opt2 text,
opt3 text,
opt4 text,
opt5 text,
opt6 text,
opt7 text,
opt8 text,
modified timestamp(0) with time zone DEFAULT now() NOT NULL,
CONSTRAINT survey_questions_language CHECK (((language)::text ~ '[a-z]{2}(-[a-z]{2})?'::text))
);
ALTER TABLE public.survey_questions OWNER TO "186_pgsql";
--
-- Name: surveys; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE surveys (
id integer DEFAULT nextval(('"survey_id_seq"'::text)::regclass) NOT NULL,
tot1 integer DEFAULT 0 NOT NULL,
tot2 integer DEFAULT 0 NOT NULL,
tot3 integer DEFAULT 0 NOT NULL,
tot4 integer DEFAULT 0 NOT NULL,
tot5 integer DEFAULT 0 NOT NULL,
tot6 integer DEFAULT 0 NOT NULL,
tot7 integer DEFAULT 0 NOT NULL,
tot8 integer DEFAULT 0 NOT NULL,
respondants integer DEFAULT 0 NOT NULL,
current boolean DEFAULT false NOT NULL
);
ALTER TABLE public.surveys OWNER TO "186_pgsql";
SET default_with_oids = false;
--
-- Name: sync_log; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE sync_log (
t timestamp with time zone DEFAULT now() NOT NULL,
op character varying(8) NOT NULL,
node character varying(32) NOT NULL,
start timestamp with time zone NOT NULL
);
ALTER TABLE public.sync_log OWNER TO "186_pgsql";
--
-- Name: sync_request; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE sync_request (
t timestamp with time zone DEFAULT now() NOT NULL,
docs integer DEFAULT 0 NOT NULL,
ftp integer DEFAULT 0 NOT NULL,
requestby character varying(32) NOT NULL,
completed timestamp with time zone
);
ALTER TABLE public.sync_request OWNER TO "186_pgsql";
--
-- Name: users; Type: TABLE; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE TABLE users (
userid character varying(16) NOT NULL,
fullname character varying(128) NOT NULL,
authorblurb text DEFAULT ''::character varying NOT NULL,
email character varying(128) NOT NULL,
communitydoc_superuser integer DEFAULT 0 NOT NULL,
created timestamp with time zone DEFAULT now() NOT NULL,
lastlogin timestamp with time zone,
matrixeditor integer DEFAULT 0 NOT NULL,
pwdhash text NOT NULL,
resethash text,
resethashtime timestamp with time zone,
sshkey text,
sshkey_last_update timestamp with time zone
);
ALTER TABLE public.users OWNER TO "186_pgsql";
--
-- Name: users_keys; Type: VIEW; Schema: public; Owner: 186_pgsql
--
CREATE VIEW users_keys AS
SELECT users.userid, users.sshkey, users.sshkey_last_update FROM users WHERE ((users.sshkey IS NOT NULL) AND (NOT (users.sshkey = ''::text)));
ALTER TABLE public.users_keys OWNER TO "186_pgsql";
SET search_path = pgcrypto, pg_catalog;
--
-- Name: armor(bytea); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION armor(bytea) RETURNS text
AS '$libdir/pgcrypto', 'pg_armor'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.armor(bytea) OWNER TO postgres;
--
-- Name: crypt(text, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION crypt(text, text) RETURNS text
AS '$libdir/pgcrypto', 'pg_crypt'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.crypt(text, text) OWNER TO postgres;
--
-- Name: dearmor(text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION dearmor(text) RETURNS bytea
AS '$libdir/pgcrypto', 'pg_dearmor'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.dearmor(text) OWNER TO postgres;
--
-- Name: decrypt(bytea, bytea, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION decrypt(bytea, bytea, text) RETURNS bytea
AS '$libdir/pgcrypto', 'pg_decrypt'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.decrypt(bytea, bytea, text) OWNER TO postgres;
--
-- Name: decrypt_iv(bytea, bytea, bytea, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION decrypt_iv(bytea, bytea, bytea, text) RETURNS bytea
AS '$libdir/pgcrypto', 'pg_decrypt_iv'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.decrypt_iv(bytea, bytea, bytea, text) OWNER TO postgres;
--
-- Name: digest(text, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION digest(text, text) RETURNS bytea
AS '$libdir/pgcrypto', 'pg_digest'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.digest(text, text) OWNER TO postgres;
--
-- Name: digest(bytea, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION digest(bytea, text) RETURNS bytea
AS '$libdir/pgcrypto', 'pg_digest'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.digest(bytea, text) OWNER TO postgres;
--
-- Name: encrypt(bytea, bytea, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION encrypt(bytea, bytea, text) RETURNS bytea
AS '$libdir/pgcrypto', 'pg_encrypt'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.encrypt(bytea, bytea, text) OWNER TO postgres;
--
-- Name: encrypt_iv(bytea, bytea, bytea, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION encrypt_iv(bytea, bytea, bytea, text) RETURNS bytea
AS '$libdir/pgcrypto', 'pg_encrypt_iv'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.encrypt_iv(bytea, bytea, bytea, text) OWNER TO postgres;
--
-- Name: gen_random_bytes(integer); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION gen_random_bytes(integer) RETURNS bytea
AS '$libdir/pgcrypto', 'pg_random_bytes'
LANGUAGE c STRICT;
ALTER FUNCTION pgcrypto.gen_random_bytes(integer) OWNER TO postgres;
--
-- Name: gen_salt(text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION gen_salt(text) RETURNS text
AS '$libdir/pgcrypto', 'pg_gen_salt'
LANGUAGE c STRICT;
ALTER FUNCTION pgcrypto.gen_salt(text) OWNER TO postgres;
--
-- Name: gen_salt(text, integer); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION gen_salt(text, integer) RETURNS text
AS '$libdir/pgcrypto', 'pg_gen_salt_rounds'
LANGUAGE c STRICT;
ALTER FUNCTION pgcrypto.gen_salt(text, integer) OWNER TO postgres;
--
-- Name: hmac(text, text, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION hmac(text, text, text) RETURNS bytea
AS '$libdir/pgcrypto', 'pg_hmac'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.hmac(text, text, text) OWNER TO postgres;
--
-- Name: hmac(bytea, bytea, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION hmac(bytea, bytea, text) RETURNS bytea
AS '$libdir/pgcrypto', 'pg_hmac'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.hmac(bytea, bytea, text) OWNER TO postgres;
--
-- Name: pgp_key_id(bytea); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION pgp_key_id(bytea) RETURNS text
AS '$libdir/pgcrypto', 'pgp_key_id_w'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.pgp_key_id(bytea) OWNER TO postgres;
--
-- Name: pgp_pub_decrypt(bytea, bytea); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION pgp_pub_decrypt(bytea, bytea) RETURNS text
AS '$libdir/pgcrypto', 'pgp_pub_decrypt_text'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.pgp_pub_decrypt(bytea, bytea) OWNER TO postgres;
--
-- Name: pgp_pub_decrypt(bytea, bytea, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION pgp_pub_decrypt(bytea, bytea, text) RETURNS text
AS '$libdir/pgcrypto', 'pgp_pub_decrypt_text'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.pgp_pub_decrypt(bytea, bytea, text) OWNER TO postgres;
--
-- Name: pgp_pub_decrypt(bytea, bytea, text, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION pgp_pub_decrypt(bytea, bytea, text, text) RETURNS text
AS '$libdir/pgcrypto', 'pgp_pub_decrypt_text'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.pgp_pub_decrypt(bytea, bytea, text, text) OWNER TO postgres;
--
-- Name: pgp_pub_decrypt_bytea(bytea, bytea); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea) RETURNS bytea
AS '$libdir/pgcrypto', 'pgp_pub_decrypt_bytea'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.pgp_pub_decrypt_bytea(bytea, bytea) OWNER TO postgres;
--
-- Name: pgp_pub_decrypt_bytea(bytea, bytea, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text) RETURNS bytea
AS '$libdir/pgcrypto', 'pgp_pub_decrypt_bytea'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.pgp_pub_decrypt_bytea(bytea, bytea, text) OWNER TO postgres;
--
-- Name: pgp_pub_decrypt_bytea(bytea, bytea, text, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text, text) RETURNS bytea
AS '$libdir/pgcrypto', 'pgp_pub_decrypt_bytea'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.pgp_pub_decrypt_bytea(bytea, bytea, text, text) OWNER TO postgres;
--
-- Name: pgp_pub_encrypt(text, bytea); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION pgp_pub_encrypt(text, bytea) RETURNS bytea
AS '$libdir/pgcrypto', 'pgp_pub_encrypt_text'
LANGUAGE c STRICT;
ALTER FUNCTION pgcrypto.pgp_pub_encrypt(text, bytea) OWNER TO postgres;
--
-- Name: pgp_pub_encrypt(text, bytea, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION pgp_pub_encrypt(text, bytea, text) RETURNS bytea
AS '$libdir/pgcrypto', 'pgp_pub_encrypt_text'
LANGUAGE c STRICT;
ALTER FUNCTION pgcrypto.pgp_pub_encrypt(text, bytea, text) OWNER TO postgres;
--
-- Name: pgp_pub_encrypt_bytea(bytea, bytea); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION pgp_pub_encrypt_bytea(bytea, bytea) RETURNS bytea
AS '$libdir/pgcrypto', 'pgp_pub_encrypt_bytea'
LANGUAGE c STRICT;
ALTER FUNCTION pgcrypto.pgp_pub_encrypt_bytea(bytea, bytea) OWNER TO postgres;
--
-- Name: pgp_pub_encrypt_bytea(bytea, bytea, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION pgp_pub_encrypt_bytea(bytea, bytea, text) RETURNS bytea
AS '$libdir/pgcrypto', 'pgp_pub_encrypt_bytea'
LANGUAGE c STRICT;
ALTER FUNCTION pgcrypto.pgp_pub_encrypt_bytea(bytea, bytea, text) OWNER TO postgres;
--
-- Name: pgp_sym_decrypt(bytea, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION pgp_sym_decrypt(bytea, text) RETURNS text
AS '$libdir/pgcrypto', 'pgp_sym_decrypt_text'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.pgp_sym_decrypt(bytea, text) OWNER TO postgres;
--
-- Name: pgp_sym_decrypt(bytea, text, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION pgp_sym_decrypt(bytea, text, text) RETURNS text
AS '$libdir/pgcrypto', 'pgp_sym_decrypt_text'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.pgp_sym_decrypt(bytea, text, text) OWNER TO postgres;
--
-- Name: pgp_sym_decrypt_bytea(bytea, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION pgp_sym_decrypt_bytea(bytea, text) RETURNS bytea
AS '$libdir/pgcrypto', 'pgp_sym_decrypt_bytea'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.pgp_sym_decrypt_bytea(bytea, text) OWNER TO postgres;
--
-- Name: pgp_sym_decrypt_bytea(bytea, text, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION pgp_sym_decrypt_bytea(bytea, text, text) RETURNS bytea
AS '$libdir/pgcrypto', 'pgp_sym_decrypt_bytea'
LANGUAGE c IMMUTABLE STRICT;
ALTER FUNCTION pgcrypto.pgp_sym_decrypt_bytea(bytea, text, text) OWNER TO postgres;
--
-- Name: pgp_sym_encrypt(text, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION pgp_sym_encrypt(text, text) RETURNS bytea
AS '$libdir/pgcrypto', 'pgp_sym_encrypt_text'
LANGUAGE c STRICT;
ALTER FUNCTION pgcrypto.pgp_sym_encrypt(text, text) OWNER TO postgres;
--
-- Name: pgp_sym_encrypt(text, text, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION pgp_sym_encrypt(text, text, text) RETURNS bytea
AS '$libdir/pgcrypto', 'pgp_sym_encrypt_text'
LANGUAGE c STRICT;
ALTER FUNCTION pgcrypto.pgp_sym_encrypt(text, text, text) OWNER TO postgres;
--
-- Name: pgp_sym_encrypt_bytea(bytea, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION pgp_sym_encrypt_bytea(bytea, text) RETURNS bytea
AS '$libdir/pgcrypto', 'pgp_sym_encrypt_bytea'
LANGUAGE c STRICT;
ALTER FUNCTION pgcrypto.pgp_sym_encrypt_bytea(bytea, text) OWNER TO postgres;
--
-- Name: pgp_sym_encrypt_bytea(bytea, text, text); Type: FUNCTION; Schema: pgcrypto; Owner: postgres
--
CREATE FUNCTION pgp_sym_encrypt_bytea(bytea, text, text) RETURNS bytea
AS '$libdir/pgcrypto', 'pgp_sym_encrypt_bytea'
LANGUAGE c STRICT;
ALTER FUNCTION pgcrypto.pgp_sym_encrypt_bytea(bytea, text, text) OWNER TO postgres;
SET search_path = public, pg_catalog;
--
-- Name: clickstats_platform(character varying); Type: FUNCTION; Schema: public; Owner: 186_pgsql
--
CREATE FUNCTION clickstats_platform(character varying) RETURNS character varying
AS $_$
SELECT CASE
WHEN $1 LIKE '%projects/%' THEN 'Projects'
WHEN $1 LIKE '%.sig' OR $1 LIKE '%.md5' THEN 'Signature'
WHEN $1 LIKE '%binary/%/win32/%.zip' THEN 'Win32'
WHEN $1 LIKE '%binary/%.rpm' THEN 'Linux binary'
WHEN $1 LIKE '%source%' OR $1 LIKE '%/latest/%' THEN 'Source'
WHEN $1 LIKE '%psqlodbc%' THEN 'ODBC'
WHEN $1 LIKE '%pgadmin%' THEN 'pgAdmin'
ELSE 'Other' END
$_$
LANGUAGE sql;
ALTER FUNCTION public.clickstats_platform(character varying) OWNER TO "186_pgsql";
--
-- Name: clickstats_version(character varying); Type: FUNCTION; Schema: public; Owner: 186_pgsql
--
CREATE FUNCTION clickstats_version(character varying) RETURNS character varying
AS $_$
SELECT CASE
WHEN $1 LIKE '%.sig' OR $1 LIKE '%.md5' THEN NULL
WHEN $1 LIKE '%odbc%' OR $1 LIKE '%pgadmin%' OR $1 LIKE '%projects/%' THEN NULL
WHEN $1 NOT LIKE '%.tar.%' AND $1 NOT LIKE '%.zip' AND $1 NOT LIKE '%.rpm' THEN NULL
ELSE substring($1, '([678]\\.\\d+)\\.\\d+')
END
$_$
LANGUAGE sql;
ALTER FUNCTION public.clickstats_version(character varying) OWNER TO "186_pgsql";
--
-- Name: community_login(text, text); Type: FUNCTION; Schema: public; Owner: 186_pgsql
--
CREATE FUNCTION community_login(INOUT userid text, password text, OUT success integer, OUT fullname text, OUT email text, OUT authorblurb text, OUT communitydoc_superuser integer, OUT last_login timestamp with time zone, OUT matrixeditor integer) RETURNS record
AS $$
BEGIN
SELECT users.userid,users.fullname,users.email,users.authorblurb,users.communitydoc_superuser,users.lastlogin,users.matrixeditor
INTO userid,fullname,email,authorblurb,communitydoc_superuser,last_login,matrixeditor
FROM users WHERE lower(users.userid)=lower(userid) AND
substring(users.pwdhash, 30) = pgcrypto.crypt(password, substring(users.pwdhash, 1, 29));
-- bf salts are always 29 chars!
IF FOUND THEN
success := 1;
UPDATE users SET lastlogin=CURRENT_TIMESTAMP WHERE users.userid=userid;
ELSE
success := 0;
END IF;
END
$$
LANGUAGE plpgsql SECURITY DEFINER;
ALTER FUNCTION public.community_login(INOUT userid text, password text, OUT success integer, OUT fullname text, OUT email text, OUT authorblurb text, OUT communitydoc_superuser integer, OUT last_login timestamp with time zone, OUT matrixeditor integer) OWNER TO "186_pgsql";
--
-- Name: community_login_create(text, text, text, text); Type: FUNCTION; Schema: public; Owner: 186_pgsql
--
CREATE FUNCTION community_login_create(_userid text, _password text, _fullname text, _email text) RETURNS boolean
AS $$
BEGIN
IF _userid IS NULL OR _userid='' OR _password IS NULL OR _password='' OR _email IS NULL OR _email='' THEN
RETURN false;
END IF;
PERFORM userid FROM users WHERE lower(userid)=lower(_userid) OR lower(email)=lower(_email);
IF FOUND THEN
RETURN false;
END IF;
INSERT INTO users (userid,pwdhash,fullname,email)
VALUES (_userid,community_login_make_password(_password),_fullname,_email);
RETURN true;
END;
$$
LANGUAGE plpgsql SECURITY DEFINER;
ALTER FUNCTION public.community_login_create(_userid text, _password text, _fullname text, _email text) OWNER TO "186_pgsql";
--
-- Name: community_login_exists(text); Type: FUNCTION; Schema: public; Owner: 186_pgsql
--
CREATE FUNCTION community_login_exists(userid text) RETURNS boolean
AS $$
BEGIN
PERFORM userid
FROM users WHERE lower(users.userid)=lower(userid);
IF FOUND THEN
RETURN true;
END IF;
RETURN false;
END
$$
LANGUAGE plpgsql SECURITY DEFINER;
ALTER FUNCTION public.community_login_exists(userid text) OWNER TO "186_pgsql";
--
-- Name: community_login_make_password(text); Type: FUNCTION; Schema: public; Owner: 186_pgsql
--
CREATE FUNCTION community_login_make_password(pwd text) RETURNS text
AS $$
DECLARE
salt text;
i int;
BEGIN
-- Note: bf salts are always 29 characters
salt = pgcrypto.gen_salt('bf');
RETURN salt || pgcrypto.crypt(pwd, salt);
END
$$
LANGUAGE plpgsql;
ALTER FUNCTION public.community_login_make_password(pwd text) OWNER TO "186_pgsql";
--
-- Name: community_login_setinfo(text, text, text, text, text); Type: FUNCTION; Schema: public; Owner: 186_pgsql
--
CREATE FUNCTION community_login_setinfo(_userid text, _password text, _fullname text, _email text, _authorblurb text) RETURNS boolean
AS $$
BEGIN
IF _userid IS NULL OR _userid='' OR _email IS NULL OR _email='' THEN
RETURN false;
END IF;
IF _password IS NOT NULL AND NOT _password='' THEN
UPDATE users SET fullname=_fullname,email=_email,authorblurb=_authorblurb,
pwdhash=community_login_make_password(_password)
WHERE lower(userid)=lower(_userid);
ELSE
UPDATE users SET fullname=_fullname,email=_email,authorblurb=_authorblurb
WHERE lower(userid)=lower(_userid);
END IF;
RETURN FOUND;
END;
$$
LANGUAGE plpgsql SECURITY DEFINER;
ALTER FUNCTION public.community_login_setinfo(_userid text, _password text, _fullname text, _email text, _authorblurb text) OWNER TO "186_pgsql";
--
-- Name: community_login_setinfo(text, text, text, text); Type: FUNCTION; Schema: public; Owner: 186_pgsql
--
CREATE FUNCTION community_login_setinfo(_userid text, _password text, _fullname text, _email text) RETURNS boolean
AS $$
BEGIN
IF _userid IS NULL OR _userid='' OR _email IS NULL OR _email='' THEN
RETURN false;
END IF;
IF _password IS NOT NULL AND NOT _password='' THEN
UPDATE users SET fullname=_fullname,email=_email,
pwdhash=community_login_make_password(_password)
WHERE lower(userid)=lower(_userid);
ELSE
UPDATE users SET fullname=_fullname,email=_email
WHERE lower(userid)=lower(_userid);
END IF;
RETURN FOUND;
END;
$$
LANGUAGE plpgsql SECURITY DEFINER;
ALTER FUNCTION public.community_login_setinfo(_userid text, _password text, _fullname text, _email text) OWNER TO "186_pgsql";
--
-- Name: community_login_setinfo(text, text, text, text, text, text); Type: FUNCTION; Schema: public; Owner: 186_pgsql
--
CREATE FUNCTION community_login_setinfo(_userid text, _password text, _fullname text, _email text, _authorblurb text, _sshkey text) RETURNS boolean
AS $$
BEGIN
IF _userid IS NULL OR _userid='' OR _email IS NULL OR _email='' THEN
RETURN false;
END IF;
IF _password IS NOT NULL AND NOT _password='' THEN
UPDATE users SET fullname=_fullname,email=_email,authorblurb=_authorblurb,
pwdhash=community_login_make_password(_password)
WHERE lower(userid)=lower(_userid);
ELSE
UPDATE users SET fullname=_fullname,email=_email,authorblurb=_authorblurb,sshkey=_sshkey
WHERE lower(userid)=lower(_userid);
END IF;
RETURN FOUND;
END;
$$
LANGUAGE plpgsql;
ALTER FUNCTION public.community_login_setinfo(_userid text, _password text, _fullname text, _email text, _authorblurb text, _sshkey text) OWNER TO "186_pgsql";
--
-- Name: community_login_setpassword(text, text); Type: FUNCTION; Schema: public; Owner: 186_pgsql
--
CREATE FUNCTION community_login_setpassword(_userid text, _password text) RETURNS boolean
AS $$
BEGIN
IF _password IS NOT NULL AND NOT _password='' THEN
UPDATE users SET pwdhash=community_login_make_password(_password) WHERE lower(userid)=lower(_userid);
END IF;
RETURN FOUND;
END;
$$
LANGUAGE plpgsql SECURITY DEFINER;
ALTER FUNCTION public.community_login_setpassword(_userid text, _password text) OWNER TO "186_pgsql";
--
-- Name: community_login_trigger_sshkey(); Type: FUNCTION; Schema: public; Owner: 186_pgsql
--
CREATE FUNCTION community_login_trigger_sshkey() RETURNS trigger
AS $$
BEGIN
IF NEW.sshkey IS DISTINCT FROM OLD.sshkey THEN
NEW.sshkey_last_update=CURRENT_TIMESTAMP;
END IF;
RETURN NEW;
END;
$$
LANGUAGE plpgsql;
ALTER FUNCTION public.community_login_trigger_sshkey() OWNER TO "186_pgsql";
--
-- Name: communitypages_approve(integer); Type: FUNCTION; Schema: public; Owner: 186_pgsql
--
CREATE FUNCTION communitypages_approve(integer) RETURNS integer
AS $_$
DECLARE lastver int;
BEGIN
SELECT INTO lastver version FROM communitypages WHERE pageid=$1;
IF NOT FOUND THEN
-- Completley new page, add it
INSERT INTO communitypages (pageid, parent, author, origauthor, savedate, title, shorttitle, contents) SELECT pageid,parent,author,author,savedate,title,shorttitle,contents FROM communitypages_work WHERE pageid=$1;
ELSE
-- Pre-existing page, copy to history and then overwrite
INSERT INTO communitypages_history (pageid, version, author, savedate, title, shorttitle, contents) SELECT pageid,version,author,savedate,title,shorttitle,contents FROM communitypages WHERE pageid=$1;
UPDATE communitypages SET version=version+1,author=w.author,savedate=w.savedate,title=w.title,shorttitle=w.shorttitle,contents=w.contents FROM communitypages_work w WHERE w.pageid=$1 AND communitypages.pageid=$1;
END IF;
-- Transfer any new files
INSERT INTO communitypages_files (fileid, pageid, title, author, mimetype, image) SELECT fileid, pageid, title, author, mimetype, image FROM communitypages_work_files WHERE pageid=$1;
DELETE FROM communitypages_work_files WHERE pageid=$1;
-- Now remove from the pending table
DELETE FROM communitypages_work WHERE pageid=$1;
-- Placeholder return value
RETURN 0;
END;
$_$
LANGUAGE plpgsql;
ALTER FUNCTION public.communitypages_approve(integer) OWNER TO "186_pgsql";
--
-- Name: communitypages_breadcrumbs(integer); Type: FUNCTION; Schema: public; Owner: 186_pgsql
--
CREATE FUNCTION communitypages_breadcrumbs(integer) RETURNS SETOF communitypages_breadcrumb_type
AS $_$
DECLARE r communitypages_breadcrumb_type%rowtype;
DECLARE currpageid int;
DECLARE currparent int;
BEGIN
currpageid := $1;
LOOP
SELECT INTO r.pageid,currparent,r.title pageid,parent,shorttitle FROM communitypages WHERE pageid=currpageid;
EXIT WHEN NOT FOUND;
RETURN NEXT r;
EXIT WHEN r.pageid = currparent;
currpageid = currparent;
END LOOP;
RETURN;
END;
$_$
LANGUAGE plpgsql;
ALTER FUNCTION public.communitypages_breadcrumbs(integer) OWNER TO "186_pgsql";
--
-- Name: communitypages_findroot(integer); Type: FUNCTION; Schema: public; Owner: 186_pgsql
--
CREATE FUNCTION communitypages_findroot(integer) RETURNS integer
AS $_$
DECLARE currpageid int;
DECLARE currparent int;
BEGIN
currpageid := $1;
LOOP
SELECT INTO currparent parent FROM communitypages WHERE pageid=currpageid;
IF NOT FOUND THEN
SELECT INTO currparent parent FROM communitypages_work WHERE pageid=currpageid;
IF NOT FOUND THEN
RETURN NULL;
END IF;
END IF;
IF currparent=currpageid THEN
RETURN currpageid;
END IF;
currpageid = currparent;
END LOOP;
RETURN NULL;
END;
$_$
LANGUAGE plpgsql;
ALTER FUNCTION public.communitypages_findroot(integer) OWNER TO "186_pgsql";
--
-- Name: event_translation_modified(); Type: FUNCTION; Schema: public; Owner: 186_pgsql
--
CREATE FUNCTION event_translation_modified() RETURNS trigger
AS $$
BEGIN
IF NEW.language = 'en' THEN
IF NEW.event <> OLD.event OR NEW.summary <> OLD.summary OR NEW.details <> OLD.details THEN
NEW.modified := 'now';
END IF;
ELSE
NEW.modified := 'now';
END IF;
RETURN NEW;
END;
$$
LANGUAGE plpgsql;
ALTER FUNCTION public.event_translation_modified() OWNER TO "186_pgsql";
--
-- Name: news_translation_modified(); Type: FUNCTION; Schema: public; Owner: 186_pgsql
--
CREATE FUNCTION news_translation_modified() RETURNS trigger
AS $$
BEGIN
IF NEW.language = 'en' THEN
IF NEW.headline <> OLD.headline OR NEW.summary <> OLD.summary OR NEW.story <> OLD.story THEN
NEW.modified := 'now';
END IF;
ELSE
NEW.modified := 'now';
END IF;
RETURN NEW;
END;
$$
LANGUAGE plpgsql;
ALTER FUNCTION public.news_translation_modified() OWNER TO "186_pgsql";
--
-- Name: plpgsql_call_handler(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler
AS '$libdir/plpgsql', 'plpgsql_call_handler'
LANGUAGE c;
ALTER FUNCTION public.plpgsql_call_handler() OWNER TO postgres;
--
-- Name: quotes_translation_modified(); Type: FUNCTION; Schema: public; Owner: 186_pgsql
--
CREATE FUNCTION quotes_translation_modified() RETURNS trigger
AS $$
BEGIN
IF NEW.language = 'en' THEN
IF NEW.quote <> OLD.quote OR NEW.tagline <> OLD.tagline THEN
NEW.modified := 'now';
END IF;
ELSE
NEW.modified := 'now';
END IF;
RETURN NEW;
END;
$$
LANGUAGE plpgsql;
ALTER FUNCTION public.quotes_translation_modified() OWNER TO "186_pgsql";
--
-- Name: survey_translation_modified(); Type: FUNCTION; Schema: public; Owner: 186_pgsql
--
CREATE FUNCTION survey_translation_modified() RETURNS trigger
AS $$
BEGIN
IF NEW.language = 'en' THEN
IF NEW.question <> OLD.question OR COALESCE(NEW.opt1, '') <> COALESCE(OLD.opt1, '') OR
COALESCE(NEW.opt2, '') <> COALESCE(OLD.opt2, '') OR COALESCE(NEW.opt3, '') <> COALESCE(OLD.opt3, '') OR
COALESCE(NEW.opt4, '') <> COALESCE(OLD.opt4, '') OR COALESCE(NEW.opt5, '') <> COALESCE(OLD.opt5, '') OR
COALESCE(NEW.opt6, '') <> COALESCE(OLD.opt6, '') OR COALESCE(NEW.opt7, '') <> COALESCE(OLD.opt7, '') OR
COALESCE(NEW.opt8, '') <> COALESCE(OLD.opt8, '') THEN
NEW.modified := 'now';
END IF;
ELSE
NEW.modified := 'now';
END IF;
RETURN NEW;
END;
$$
LANGUAGE plpgsql;
ALTER FUNCTION public.survey_translation_modified() OWNER TO "186_pgsql";
SET search_path = cvslog, pg_catalog;
--
-- Name: branches_branchid_seq; Type: SEQUENCE; Schema: cvslog; Owner: postgres
--
CREATE SEQUENCE branches_branchid_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE cvslog.branches_branchid_seq OWNER TO postgres;
--
-- Name: branches_branchid_seq; Type: SEQUENCE OWNED BY; Schema: cvslog; Owner: postgres
--
ALTER SEQUENCE branches_branchid_seq OWNED BY branches.branchid;
--
-- Name: commits_commitid_seq; Type: SEQUENCE; Schema: cvslog; Owner: postgres
--
CREATE SEQUENCE commits_commitid_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE cvslog.commits_commitid_seq OWNER TO postgres;
--
-- Name: commits_commitid_seq; Type: SEQUENCE OWNED BY; Schema: cvslog; Owner: postgres
--
ALTER SEQUENCE commits_commitid_seq OWNED BY commits.commitid;
--
-- Name: files_fileid_seq; Type: SEQUENCE; Schema: cvslog; Owner: postgres
--
CREATE SEQUENCE files_fileid_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE cvslog.files_fileid_seq OWNER TO postgres;
--
-- Name: files_fileid_seq; Type: SEQUENCE OWNED BY; Schema: cvslog; Owner: postgres
--
ALTER SEQUENCE files_fileid_seq OWNED BY files.fileid;
SET search_path = public, pg_catalog;
--
-- Name: bug_id_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE bug_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.bug_id_seq OWNER TO "186_pgsql";
--
-- Name: comments_id_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE comments_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.comments_id_seq OWNER TO "186_pgsql";
--
-- Name: communitypages_files_id_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE communitypages_files_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.communitypages_files_id_seq OWNER TO "186_pgsql";
--
-- Name: communitypages_id_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE communitypages_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.communitypages_id_seq OWNER TO "186_pgsql";
--
-- Name: countries_id_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE countries_id_seq
START WITH 1
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.countries_id_seq OWNER TO "186_pgsql";
--
-- Name: countries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 186_pgsql
--
ALTER SEQUENCE countries_id_seq OWNED BY countries.id;
--
-- Name: docs_id_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE docs_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.docs_id_seq OWNER TO "186_pgsql";
--
-- Name: events_id_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE events_id_seq
INCREMENT BY 1
MAXVALUE 2147483647
NO MINVALUE
CACHE 1;
ALTER TABLE public.events_id_seq OWNER TO "186_pgsql";
--
-- Name: features_features_featureid_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE features_features_featureid_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.features_features_featureid_seq OWNER TO "186_pgsql";
--
-- Name: features_features_featureid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 186_pgsql
--
ALTER SEQUENCE features_features_featureid_seq OWNED BY features_features.featureid;
--
-- Name: features_groups_groupid_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE features_groups_groupid_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.features_groups_groupid_seq OWNER TO "186_pgsql";
--
-- Name: features_groups_groupid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 186_pgsql
--
ALTER SEQUENCE features_groups_groupid_seq OWNED BY features_groups.groupid;
--
-- Name: features_versions_versionid_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE features_versions_versionid_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.features_versions_versionid_seq OWNER TO "186_pgsql";
--
-- Name: features_versions_versionid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 186_pgsql
--
ALTER SEQUENCE features_versions_versionid_seq OWNED BY features_versions.versionid;
--
-- Name: iptocountry_id_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE iptocountry_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.iptocountry_id_seq OWNER TO "186_pgsql";
--
-- Name: mirrors_id_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE mirrors_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.mirrors_id_seq OWNER TO "186_pgsql";
--
-- Name: news_id_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE news_id_seq
INCREMENT BY 1
MAXVALUE 2147483647
NO MINVALUE
CACHE 1;
ALTER TABLE public.news_id_seq OWNER TO "186_pgsql";
--
-- Name: organisations_id_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE organisations_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.organisations_id_seq OWNER TO "186_pgsql";
--
-- Name: organisations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 186_pgsql
--
ALTER SEQUENCE organisations_id_seq OWNED BY organisations.id;
--
-- Name: product_categories_id_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE product_categories_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.product_categories_id_seq OWNER TO "186_pgsql";
--
-- Name: product_categories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 186_pgsql
--
ALTER SEQUENCE product_categories_id_seq OWNED BY product_categories.id;
--
-- Name: products_id_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE products_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.products_id_seq OWNER TO "186_pgsql";
--
-- Name: products_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 186_pgsql
--
ALTER SEQUENCE products_id_seq OWNED BY products.id;
--
-- Name: profserv_id_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE profserv_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.profserv_id_seq OWNER TO "186_pgsql";
--
-- Name: profserv_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 186_pgsql
--
ALTER SEQUENCE profserv_id_seq OWNED BY profserv.id;
--
-- Name: quotes_id_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE quotes_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.quotes_id_seq OWNER TO "186_pgsql";
--
-- Name: quotes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: 186_pgsql
--
ALTER SEQUENCE quotes_id_seq OWNED BY quotes.id;
--
-- Name: survey_id_seq; Type: SEQUENCE; Schema: public; Owner: 186_pgsql
--
CREATE SEQUENCE survey_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.survey_id_seq OWNER TO "186_pgsql";
SET search_path = cvslog, pg_catalog;
--
-- Name: branchid; Type: DEFAULT; Schema: cvslog; Owner: postgres
--
ALTER TABLE branches ALTER COLUMN branchid SET DEFAULT nextval('branches_branchid_seq'::regclass);
--
-- Name: commitid; Type: DEFAULT; Schema: cvslog; Owner: postgres
--
ALTER TABLE commits ALTER COLUMN commitid SET DEFAULT nextval('commits_commitid_seq'::regclass);
--
-- Name: fileid; Type: DEFAULT; Schema: cvslog; Owner: postgres
--
ALTER TABLE files ALTER COLUMN fileid SET DEFAULT nextval('files_fileid_seq'::regclass);
SET search_path = public, pg_catalog;
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE clickthrus ALTER COLUMN id SET DEFAULT nextval('clickthrus_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE countries ALTER COLUMN id SET DEFAULT nextval('countries_id_seq'::regclass);
--
-- Name: featureid; Type: DEFAULT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE features_features ALTER COLUMN featureid SET DEFAULT nextval('features_features_featureid_seq'::regclass);
--
-- Name: groupid; Type: DEFAULT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE features_groups ALTER COLUMN groupid SET DEFAULT nextval('features_groups_groupid_seq'::regclass);
--
-- Name: versionid; Type: DEFAULT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE features_versions ALTER COLUMN versionid SET DEFAULT nextval('features_versions_versionid_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE organisations ALTER COLUMN id SET DEFAULT nextval('organisations_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE product_categories ALTER COLUMN id SET DEFAULT nextval('product_categories_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE products ALTER COLUMN id SET DEFAULT nextval('products_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE profserv ALTER COLUMN id SET DEFAULT nextval('profserv_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE quotes ALTER COLUMN id SET DEFAULT nextval('quotes_id_seq'::regclass);
SET search_path = cvslog, pg_catalog;
--
-- Name: branches_pkey; Type: CONSTRAINT; Schema: cvslog; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY branches
ADD CONSTRAINT branches_pkey PRIMARY KEY (branchid);
--
-- Name: commits_pkey; Type: CONSTRAINT; Schema: cvslog; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY commits
ADD CONSTRAINT commits_pkey PRIMARY KEY (commitid);
--
-- Name: files_pkey; Type: CONSTRAINT; Schema: cvslog; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY files
ADD CONSTRAINT files_pkey PRIMARY KEY (fileid);
SET search_path = public, pg_catalog;
--
-- Name: applications_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY applications
ADD CONSTRAINT applications_pkey PRIMARY KEY (id, version, platform);
--
-- Name: clickthrus2_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY clickthrus2
ADD CONSTRAINT clickthrus2_pkey PRIMARY KEY (id);
--
-- Name: clickthrus_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY clickthrus
ADD CONSTRAINT clickthrus_pkey PRIMARY KEY (id);
--
-- Name: comments_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY comments
ADD CONSTRAINT comments_pkey PRIMARY KEY (id);
--
-- Name: communitypages_files_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY communitypages_files
ADD CONSTRAINT communitypages_files_pkey PRIMARY KEY (fileid);
--
-- Name: communitypages_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY communitypages
ADD CONSTRAINT communitypages_pkey PRIMARY KEY (pageid);
--
-- Name: communitypages_root_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY communitypages_root
ADD CONSTRAINT communitypages_root_pkey PRIMARY KEY (pageid);
--
-- Name: communitypages_work_files_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY communitypages_work_files
ADD CONSTRAINT communitypages_work_files_pkey PRIMARY KEY (fileid);
--
-- Name: communitypages_work_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY communitypages_work
ADD CONSTRAINT communitypages_work_pkey PRIMARY KEY (pageid);
--
-- Name: countries_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY countries
ADD CONSTRAINT countries_pkey PRIMARY KEY (id);
--
-- Name: developers_email_key; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY developers
ADD CONSTRAINT developers_email_key UNIQUE (email);
--
-- Name: developers_name_key; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY developers
ADD CONSTRAINT developers_name_key UNIQUE (lastname, firstname);
--
-- Name: developers_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY developers
ADD CONSTRAINT developers_pkey PRIMARY KEY (id);
--
-- Name: developers_types_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY developers_types
ADD CONSTRAINT developers_types_pkey PRIMARY KEY (type);
--
-- Name: doc_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY docs
ADD CONSTRAINT doc_pkey PRIMARY KEY (id);
--
-- Name: events_location_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY events_location
ADD CONSTRAINT events_location_pkey PRIMARY KEY (eventid);
--
-- Name: events_text_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY events_text
ADD CONSTRAINT events_text_pkey PRIMARY KEY (eventid, language);
--
-- Name: features_categories_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY features_categories
ADD CONSTRAINT features_categories_pkey PRIMARY KEY (categoryid);
--
-- Name: features_features_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY features_features
ADD CONSTRAINT features_features_pkey PRIMARY KEY (featureid);
--
-- Name: features_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY features_groups
ADD CONSTRAINT features_groups_pkey PRIMARY KEY (groupid);
--
-- Name: features_matrix_pk; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY features_matrix
ADD CONSTRAINT features_matrix_pk PRIMARY KEY (version, feature);
--
-- Name: features_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY features_versions
ADD CONSTRAINT features_versions_pkey PRIMARY KEY (versionid);
--
-- Name: frontends_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY frontends
ADD CONSTRAINT frontends_pkey PRIMARY KEY (id);
--
-- Name: iptocountry_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY iptocountry
ADD CONSTRAINT iptocountry_pkey PRIMARY KEY (id);
--
-- Name: listgroups_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY listgroups
ADD CONSTRAINT listgroups_pkey PRIMARY KEY (id);
--
-- Name: lists_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY lists
ADD CONSTRAINT lists_pkey PRIMARY KEY (id);
--
-- Name: mirrors_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY mirrors
ADD CONSTRAINT mirrors_pkey PRIMARY KEY (id);
--
-- Name: news_text_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY news_text
ADD CONSTRAINT news_text_pkey PRIMARY KEY (newsid, language);
--
-- Name: organisations_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY organisations
ADD CONSTRAINT organisations_pkey PRIMARY KEY (id);
--
-- Name: product_categories_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY product_categories
ADD CONSTRAINT product_categories_pkey PRIMARY KEY (id);
--
-- Name: products_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY products
ADD CONSTRAINT products_pkey PRIMARY KEY (id);
--
-- Name: profserv_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY profserv
ADD CONSTRAINT profserv_pkey PRIMARY KEY (id);
--
-- Name: quotes_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY quotes
ADD CONSTRAINT quotes_pkey PRIMARY KEY (id);
--
-- Name: quotes_text_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY quotes_text
ADD CONSTRAINT quotes_text_pkey PRIMARY KEY (quoteid, language);
--
-- Name: survey_questions_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY survey_questions
ADD CONSTRAINT survey_questions_pkey PRIMARY KEY (surveyid, language);
--
-- Name: sync_log_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY sync_log
ADD CONSTRAINT sync_log_pkey PRIMARY KEY (t);
--
-- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: 186_pgsql; Tablespace:
--
ALTER TABLE ONLY users
ADD CONSTRAINT users_pkey PRIMARY KEY (userid);
SET search_path = cvslog, pg_catalog;
--
-- Name: commits_branch_time; Type: INDEX; Schema: cvslog; Owner: postgres; Tablespace:
--
CREATE INDEX commits_branch_time ON commits USING btree (branch, "time");
SET search_path = public, pg_catalog;
--
-- Name: clickthrus2_ts_idx; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE INDEX clickthrus2_ts_idx ON clickthrus2 USING btree (ts);
--
-- Name: clickthrus_ts_idx; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE INDEX clickthrus_ts_idx ON clickthrus USING btree (ts);
--
-- Name: comment_rejects_ui_re; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE UNIQUE INDEX comment_rejects_ui_re ON comment_rejects USING btree (re);
--
-- Name: comments_idx; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE INDEX comments_idx ON comments USING btree (version, file);
--
-- Name: doc_idx; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE UNIQUE INDEX doc_idx ON docs USING btree (file, version);
--
-- Name: events_id_key; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE UNIQUE INDEX events_id_key ON events USING btree (id);
--
-- Name: features_features_idx_grp; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE INDEX features_features_idx_grp ON features_features USING btree (groupid);
--
-- Name: features_groups_idx_cat; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE INDEX features_groups_idx_cat ON features_groups USING btree (category);
--
-- Name: features_versions_idx_cat; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE INDEX features_versions_idx_cat ON features_versions USING btree (category);
--
-- Name: lists_name_unique; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE UNIQUE INDEX lists_name_unique ON lists USING btree (name);
--
-- Name: mirrors_hosts_idx; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE UNIQUE INDEX mirrors_hosts_idx ON mirrors USING btree (country_code, mirror_type, mirror_index);
--
-- Name: mirrors_status_idx; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE INDEX mirrors_status_idx ON mirrors USING btree (mirror_type, mirror_last_rsync, rsync_host1, rsync_host2, mirror_active, mirror_dns, mirror_private);
--
-- Name: news_id_key; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE UNIQUE INDEX news_id_key ON news USING btree (id);
--
-- Name: news_idx; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE INDEX news_idx ON news USING btree (active, approved);
--
-- Name: organisations_name; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE UNIQUE INDEX organisations_name ON organisations USING btree (lower(name));
--
-- Name: product_categories_name; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE UNIQUE INDEX product_categories_name ON product_categories USING btree (lower(name));
--
-- Name: products_publisher_name_idx; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE UNIQUE INDEX products_publisher_name_idx ON products USING btree (publisher, lower(name));
--
-- Name: survey_id_key; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE UNIQUE INDEX survey_id_key ON surveys USING btree (id);
--
-- Name: survey_lock_idx; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE UNIQUE INDEX survey_lock_idx ON survey_lock USING btree (ipaddr);
--
-- Name: sync_request_completed; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE INDEX sync_request_completed ON sync_request USING btree (t) WHERE (completed IS NULL);
--
-- Name: sync_request_t; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE INDEX sync_request_t ON sync_request USING btree (t);
--
-- Name: users_email_idx; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE UNIQUE INDEX users_email_idx ON users USING btree (email);
--
-- Name: users_email_unique_idx; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE UNIQUE INDEX users_email_unique_idx ON users USING btree (lower((email)::text));
--
-- Name: users_userid_unique_idx; Type: INDEX; Schema: public; Owner: 186_pgsql; Tablespace:
--
CREATE UNIQUE INDEX users_userid_unique_idx ON users USING btree (lower((userid)::text));
--
-- Name: community_login_trigger_sshkey; Type: TRIGGER; Schema: public; Owner: 186_pgsql
--
CREATE TRIGGER community_login_trigger_sshkey
BEFORE UPDATE ON users
FOR EACH ROW
EXECUTE PROCEDURE community_login_trigger_sshkey();
--
-- Name: events_text_update; Type: TRIGGER; Schema: public; Owner: 186_pgsql
--
CREATE TRIGGER events_text_update
BEFORE UPDATE ON events_text
FOR EACH ROW
EXECUTE PROCEDURE event_translation_modified();
--
-- Name: news_text_update; Type: TRIGGER; Schema: public; Owner: 186_pgsql
--
CREATE TRIGGER news_text_update
BEFORE UPDATE ON news_text
FOR EACH ROW
EXECUTE PROCEDURE news_translation_modified();
--
-- Name: quotes_text_update; Type: TRIGGER; Schema: public; Owner: 186_pgsql
--
CREATE TRIGGER quotes_text_update
BEFORE UPDATE ON quotes_text
FOR EACH ROW
EXECUTE PROCEDURE quotes_translation_modified();
--
-- Name: survey_questions_update; Type: TRIGGER; Schema: public; Owner: 186_pgsql
--
CREATE TRIGGER survey_questions_update
BEFORE UPDATE ON survey_questions
FOR EACH ROW
EXECUTE PROCEDURE survey_translation_modified();
SET search_path = cvslog, pg_catalog;
--
-- Name: commits_branch_fkey; Type: FK CONSTRAINT; Schema: cvslog; Owner: postgres
--
ALTER TABLE ONLY commits
ADD CONSTRAINT commits_branch_fkey FOREIGN KEY (branch) REFERENCES branches(branchid);
--
-- Name: files_commitid_fkey; Type: FK CONSTRAINT; Schema: cvslog; Owner: postgres
--
ALTER TABLE ONLY files
ADD CONSTRAINT files_commitid_fkey FOREIGN KEY (commitid) REFERENCES commits(commitid);
SET search_path = public, pg_catalog;
--
-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY quotes_text
ADD CONSTRAINT "$1" FOREIGN KEY (quoteid) REFERENCES quotes(id) ON UPDATE RESTRICT ON DELETE CASCADE;
--
-- Name: communitypages_author_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY communitypages
ADD CONSTRAINT communitypages_author_fkey FOREIGN KEY (author) REFERENCES users(userid);
--
-- Name: communitypages_files_author_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY communitypages_files
ADD CONSTRAINT communitypages_files_author_fkey FOREIGN KEY (author) REFERENCES users(userid);
--
-- Name: communitypages_files_pageid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY communitypages_files
ADD CONSTRAINT communitypages_files_pageid_fkey FOREIGN KEY (pageid) REFERENCES communitypages(pageid);
--
-- Name: communitypages_history_author_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY communitypages_history
ADD CONSTRAINT communitypages_history_author_fkey FOREIGN KEY (author) REFERENCES users(userid);
--
-- Name: communitypages_origauthor_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY communitypages
ADD CONSTRAINT communitypages_origauthor_fkey FOREIGN KEY (origauthor) REFERENCES users(userid);
--
-- Name: communitypages_parent_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY communitypages
ADD CONSTRAINT communitypages_parent_fkey FOREIGN KEY (parent) REFERENCES communitypages(pageid);
--
-- Name: communitypages_root_pageid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY communitypages_root
ADD CONSTRAINT communitypages_root_pageid_fkey FOREIGN KEY (pageid) REFERENCES communitypages(pageid);
--
-- Name: communitypages_work_author_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY communitypages_work
ADD CONSTRAINT communitypages_work_author_fkey FOREIGN KEY (author) REFERENCES users(userid);
--
-- Name: communitypages_work_files_author_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY communitypages_work_files
ADD CONSTRAINT communitypages_work_files_author_fkey FOREIGN KEY (author) REFERENCES users(userid);
--
-- Name: communitypages_work_files_pageid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY communitypages_work_files
ADD CONSTRAINT communitypages_work_files_pageid_fkey FOREIGN KEY (pageid) REFERENCES communitypages_work(pageid);
--
-- Name: communitypages_work_parent_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY communitypages_work
ADD CONSTRAINT communitypages_work_parent_fkey FOREIGN KEY (parent) REFERENCES communitypages(pageid);
--
-- Name: developers_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY developers
ADD CONSTRAINT developers_type_fkey FOREIGN KEY (type) REFERENCES developers_types(type);
--
-- Name: events_location_country_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY events_location
ADD CONSTRAINT events_location_country_fkey FOREIGN KEY (country) REFERENCES countries(id);
--
-- Name: events_location_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY events_location
ADD CONSTRAINT events_location_fkey FOREIGN KEY (eventid) REFERENCES events(id) ON UPDATE RESTRICT ON DELETE CASCADE;
--
-- Name: events_text_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY events_text
ADD CONSTRAINT events_text_fkey FOREIGN KEY (eventid) REFERENCES events(id) ON UPDATE RESTRICT ON DELETE CASCADE;
--
-- Name: features_features_groupid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY features_features
ADD CONSTRAINT features_features_groupid_fkey FOREIGN KEY (groupid) REFERENCES features_groups(groupid);
--
-- Name: features_groups_category_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY features_groups
ADD CONSTRAINT features_groups_category_fkey FOREIGN KEY (category) REFERENCES features_categories(categoryid);
--
-- Name: features_matrix_feature_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY features_matrix
ADD CONSTRAINT features_matrix_feature_fkey FOREIGN KEY (feature) REFERENCES features_features(featureid);
--
-- Name: features_matrix_version_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY features_matrix
ADD CONSTRAINT features_matrix_version_fkey FOREIGN KEY (version) REFERENCES features_versions(versionid);
--
-- Name: features_versions_category_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY features_versions
ADD CONSTRAINT features_versions_category_fkey FOREIGN KEY (category) REFERENCES features_categories(categoryid);
--
-- Name: lists_grp_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY lists
ADD CONSTRAINT lists_grp_fkey FOREIGN KEY (grp) REFERENCES listgroups(id);
--
-- Name: news_text_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY news_text
ADD CONSTRAINT news_text_fkey FOREIGN KEY (newsid) REFERENCES news(id) ON UPDATE RESTRICT ON DELETE CASCADE;
--
-- Name: products_category_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY products
ADD CONSTRAINT products_category_fkey FOREIGN KEY (category) REFERENCES product_categories(id);
--
-- Name: products_contact_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY products
ADD CONSTRAINT products_contact_fkey FOREIGN KEY (contact) REFERENCES users(userid);
--
-- Name: products_publisher_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY products
ADD CONSTRAINT products_publisher_fkey FOREIGN KEY (publisher) REFERENCES organisations(id);
--
-- Name: survey_questions_fkey; Type: FK CONSTRAINT; Schema: public; Owner: 186_pgsql
--
ALTER TABLE ONLY survey_questions
ADD CONSTRAINT survey_questions_fkey FOREIGN KEY (surveyid) REFERENCES surveys(id) ON UPDATE RESTRICT ON DELETE CASCADE;
--
-- Name: cvslog; Type: ACL; Schema: -; Owner: postgres
--
REVOKE ALL ON SCHEMA cvslog FROM PUBLIC;
REVOKE ALL ON SCHEMA cvslog FROM postgres;
GRANT ALL ON SCHEMA cvslog TO postgres;
GRANT USAGE ON SCHEMA cvslog TO cvslog;
--
-- Name: pgcrypto; Type: ACL; Schema: -; Owner: pgsql
--
REVOKE ALL ON SCHEMA pgcrypto FROM PUBLIC;
REVOKE ALL ON SCHEMA pgcrypto FROM pgsql;
GRANT ALL ON SCHEMA pgcrypto TO pgsql;
GRANT USAGE ON SCHEMA pgcrypto TO PUBLIC;
--
-- Name: public; Type: ACL; Schema: -; Owner: pgsql
--
REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM pgsql;
GRANT ALL ON SCHEMA public TO pgsql;
GRANT ALL ON SCHEMA public TO stefan;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;
SET search_path = cvslog, pg_catalog;
--
-- Name: branches; Type: ACL; Schema: cvslog; Owner: postgres
--
REVOKE ALL ON TABLE branches FROM PUBLIC;
REVOKE ALL ON TABLE branches FROM postgres;
GRANT ALL ON TABLE branches TO postgres;
GRANT ALL ON TABLE branches TO cvslog;
--
-- Name: commits; Type: ACL; Schema: cvslog; Owner: postgres
--
REVOKE ALL ON TABLE commits FROM PUBLIC;
REVOKE ALL ON TABLE commits FROM postgres;
GRANT ALL ON TABLE commits TO postgres;
GRANT ALL ON TABLE commits TO cvslog;
--
-- Name: files; Type: ACL; Schema: cvslog; Owner: postgres
--
REVOKE ALL ON TABLE files FROM PUBLIC;
REVOKE ALL ON TABLE files FROM postgres;
GRANT ALL ON TABLE files TO postgres;
GRANT ALL ON TABLE files TO cvslog;
SET search_path = public, pg_catalog;
--
-- Name: listgroups; Type: ACL; Schema: public; Owner: 186_pgsql
--
REVOKE ALL ON TABLE listgroups FROM PUBLIC;
REVOKE ALL ON TABLE listgroups FROM "186_pgsql";
GRANT ALL ON TABLE listgroups TO "186_pgsql";
GRANT ALL ON TABLE listgroups TO search;
GRANT SELECT ON TABLE listgroups TO archives;
--
-- Name: lists; Type: ACL; Schema: public; Owner: 186_pgsql
--
REVOKE ALL ON TABLE lists FROM PUBLIC;
REVOKE ALL ON TABLE lists FROM "186_pgsql";
GRANT ALL ON TABLE lists TO "186_pgsql";
GRANT ALL ON TABLE lists TO search;
GRANT SELECT ON TABLE lists TO archives;
--
-- Name: mirrors; Type: ACL; Schema: public; Owner: 186_pgsql
--
REVOKE ALL ON TABLE mirrors FROM PUBLIC;
REVOKE ALL ON TABLE mirrors FROM "186_pgsql";
GRANT ALL ON TABLE mirrors TO "186_pgsql";
GRANT SELECT,UPDATE ON TABLE mirrors TO dns_svc;
GRANT SELECT ON TABLE mirrors TO rsync_svc;
--
-- Name: users; Type: ACL; Schema: public; Owner: 186_pgsql
--
REVOKE ALL ON TABLE users FROM PUBLIC;
REVOKE ALL ON TABLE users FROM "186_pgsql";
GRANT ALL ON TABLE users TO "186_pgsql";
--
-- Name: users_keys; Type: ACL; Schema: public; Owner: 186_pgsql
--
REVOKE ALL ON TABLE users_keys FROM PUBLIC;
REVOKE ALL ON TABLE users_keys FROM "186_pgsql";
GRANT ALL ON TABLE users_keys TO "186_pgsql";
GRANT SELECT ON TABLE users_keys TO auth_svc;
SET search_path = cvslog, pg_catalog;
--
-- Name: branches_branchid_seq; Type: ACL; Schema: cvslog; Owner: postgres
--
REVOKE ALL ON SEQUENCE branches_branchid_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE branches_branchid_seq FROM postgres;
GRANT ALL ON SEQUENCE branches_branchid_seq TO postgres;
GRANT ALL ON SEQUENCE branches_branchid_seq TO cvslog;
--
-- Name: commits_commitid_seq; Type: ACL; Schema: cvslog; Owner: postgres
--
REVOKE ALL ON SEQUENCE commits_commitid_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE commits_commitid_seq FROM postgres;
GRANT ALL ON SEQUENCE commits_commitid_seq TO postgres;
GRANT ALL ON SEQUENCE commits_commitid_seq TO cvslog;
--
-- Name: files_fileid_seq; Type: ACL; Schema: cvslog; Owner: postgres
--
REVOKE ALL ON SEQUENCE files_fileid_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE files_fileid_seq FROM postgres;
GRANT ALL ON SEQUENCE files_fileid_seq TO postgres;
GRANT ALL ON SEQUENCE files_fileid_seq TO cvslog;
--
-- PostgreSQL database dump complete
--
|