[r4315]: wiki / branches / pitpalme / jamwiki-core / src / main / resources / sql / sql.ansi.properties Maximize Restore History

Download this file

sql.ansi.properties    1467 lines (1465 with data), 61.5 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
 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
STATEMENT_CONNECTION_VALIDATION_QUERY = \
select 1
STATEMENT_CREATE_AUTHORITIES_TABLE = \
CREATE TABLE jam_authorities ( \
username VARCHAR(100) NOT NULL, \
authority VARCHAR(30) NOT NULL, \
CONSTRAINT jam_u_auth UNIQUE (username, authority), \
CONSTRAINT jam_f_auth_username FOREIGN KEY (username) REFERENCES jam_users(username), \
CONSTRAINT jam_f_auth_authority FOREIGN KEY (authority) REFERENCES jam_role(role_name) \
)
STATEMENT_CREATE_CATEGORY_TABLE = \
CREATE TABLE jam_category ( \
child_topic_id INTEGER NOT NULL, \
category_name VARCHAR(200) NOT NULL, \
sort_key VARCHAR(200), \
CONSTRAINT jam_p_category PRIMARY KEY (child_topic_id, category_name), \
CONSTRAINT jam_f_cat_child_id FOREIGN KEY (child_topic_id) REFERENCES jam_topic(topic_id) \
)
STATEMENT_CREATE_CATEGORY_INDEX = \
CREATE INDEX jam_i_category_cti on jam_category (child_topic_id)
STATEMENT_CREATE_CONFIGURATION_TABLE = \
CREATE TABLE jam_configuration ( \
config_key VARCHAR(50) NOT NULL, \
config_value VARCHAR(500) NOT NULL, \
CONSTRAINT jam_p_config PRIMARY KEY (config_key) \
)
STATEMENT_CREATE_GROUP_AUTHORITIES_TABLE = \
CREATE TABLE jam_group_authorities ( \
group_id INTEGER NOT NULL, \
authority VARCHAR(30) NOT NULL, \
CONSTRAINT jam_u_gauth UNIQUE (group_id, authority), \
CONSTRAINT jam_f_gauth_group FOREIGN KEY (group_id) REFERENCES jam_group(group_id), \
CONSTRAINT jam_f_gauth_authority FOREIGN KEY (authority) REFERENCES jam_role(role_name) \
)
STATEMENT_CREATE_GROUP_MEMBERS_TABLE = \
CREATE TABLE jam_group_members ( \
id INTEGER NOT NULL, \
username VARCHAR(100) NOT NULL, \
group_id INTEGER NOT NULL, \
CONSTRAINT jam_p_gmemb PRIMARY KEY (id), \
CONSTRAINT jam_f_gmemb_username FOREIGN KEY (username) REFERENCES jam_users(username), \
CONSTRAINT jam_f_gmemb_group FOREIGN KEY (group_id) REFERENCES jam_group(group_id) \
)
STATEMENT_CREATE_GROUP_TABLE = \
CREATE TABLE jam_group ( \
group_id INTEGER NOT NULL, \
group_name VARCHAR(30) NOT NULL, \
group_description VARCHAR(200), \
CONSTRAINT jam_p_group PRIMARY KEY (group_id), \
CONSTRAINT jam_u_group_name UNIQUE (group_name) \
)
STATEMENT_CREATE_INTERWIKI_TABLE = \
CREATE TABLE jam_interwiki ( \
interwiki_prefix VARCHAR(30) NOT NULL, \
interwiki_pattern VARCHAR(200) NOT NULL, \
interwiki_display VARCHAR(30) NOT NULL, \
interwiki_type INTEGER NOT NULL, \
CONSTRAINT jam_p_interw PRIMARY KEY (interwiki_prefix) \
)
STATEMENT_CREATE_LOG_TABLE = \
CREATE TABLE jam_log ( \
log_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, \
virtual_wiki_id INTEGER NOT NULL, \
wiki_user_id INTEGER, \
display_name VARCHAR(200) NOT NULL, \
topic_id INTEGER, \
topic_version_id INTEGER, \
log_type INTEGER NOT NULL, \
log_sub_type INTEGER, \
log_comment VARCHAR(200), \
log_params VARCHAR(500), \
CONSTRAINT jam_f_log_wuser FOREIGN KEY (wiki_user_id) REFERENCES jam_wiki_user(wiki_user_id), \
CONSTRAINT jam_f_log_topic_ver FOREIGN KEY (topic_version_id) REFERENCES jam_topic_version(topic_version_id), \
CONSTRAINT jam_f_log_topic FOREIGN KEY (topic_id) REFERENCES jam_topic(topic_id), \
CONSTRAINT jam_f_log_vwiki FOREIGN KEY (virtual_wiki_id) REFERENCES jam_virtual_wiki(virtual_wiki_id) \
)
STATEMENT_CREATE_NAMESPACE_TABLE = \
CREATE TABLE jam_namespace ( \
namespace_id INTEGER NOT NULL, \
namespace VARCHAR(200) NOT NULL, \
main_namespace_id INTEGER, \
CONSTRAINT jam_p_namesp PRIMARY KEY (namespace_id), \
CONSTRAINT jam_u_namesp_namesp UNIQUE (namespace), \
CONSTRAINT jam_f_namesp_namesp FOREIGN KEY (main_namespace_id) REFERENCES jam_namespace(namespace_id) \
)
STATEMENT_CREATE_NAMESPACE_TRANSLATION_TABLE = \
CREATE TABLE jam_namespace_translation ( \
namespace_id INTEGER NOT NULL, \
virtual_wiki_id INTEGER NOT NULL, \
namespace VARCHAR(200) NOT NULL, \
CONSTRAINT jam_p_namesptr PRIMARY KEY (namespace_id, virtual_wiki_id), \
CONSTRAINT jam_f_namesptr_namesp FOREIGN KEY (namespace_id) REFERENCES jam_namespace(namespace_id), \
CONSTRAINT jam_f_namesptr_vwiki FOREIGN KEY (virtual_wiki_id) REFERENCES jam_virtual_wiki(virtual_wiki_id), \
CONSTRAINT jam_u_namesptr_namesp UNIQUE (virtual_wiki_id, namespace) \
)
STATEMENT_CREATE_RECENT_CHANGE_TABLE = \
CREATE TABLE jam_recent_change ( \
topic_version_id INTEGER, \
previous_topic_version_id INTEGER, \
topic_id INTEGER, \
topic_name VARCHAR(200), \
change_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, \
change_comment VARCHAR(200), \
wiki_user_id INTEGER, \
display_name VARCHAR(200) NOT NULL, \
edit_type INTEGER, \
log_type INTEGER, \
log_sub_type INTEGER, \
log_params VARCHAR(500), \
virtual_wiki_id INTEGER NOT NULL, \
virtual_wiki_name VARCHAR(100) NOT NULL, \
characters_changed INTEGER, \
CONSTRAINT jam_f_rc_topic_ver FOREIGN KEY (topic_version_id) REFERENCES jam_topic_version(topic_version_id), \
CONSTRAINT jam_f_rc_p_topic_v FOREIGN KEY (previous_topic_version_id) REFERENCES jam_topic_version(topic_version_id), \
CONSTRAINT jam_f_rc_topic FOREIGN KEY (topic_id) REFERENCES jam_topic(topic_id), \
CONSTRAINT jam_f_rc_wuser FOREIGN KEY (wiki_user_id) REFERENCES jam_wiki_user(wiki_user_id), \
CONSTRAINT jam_f_rc_vwiki FOREIGN KEY (virtual_wiki_id) REFERENCES jam_virtual_wiki(virtual_wiki_id) \
)
STATEMENT_CREATE_ROLE_TABLE = \
CREATE TABLE jam_role ( \
role_name VARCHAR(30) NOT NULL, \
role_description VARCHAR(200), \
CONSTRAINT jam_p_role PRIMARY KEY (role_name) \
)
STATEMENT_CREATE_TOPIC_CURRENT_VERSION_CONSTRAINT = \
ALTER TABLE jam_topic add constraint jam_f_topic_topicv \
FOREIGN KEY (current_version_id) \
REFERENCES jam_topic_version(topic_version_id)
STATEMENT_CREATE_TOPIC_TABLE = \
CREATE TABLE jam_topic ( \
topic_id INTEGER NOT NULL, \
virtual_wiki_id INTEGER NOT NULL, \
namespace_id INTEGER DEFAULT 0 NOT NULL, \
topic_name VARCHAR(200) NOT NULL, \
page_name VARCHAR(200) NOT NULL, \
page_name_lower VARCHAR(200) NOT NULL, \
delete_date TIMESTAMP, \
topic_read_only INTEGER DEFAULT 0 NOT NULL, \
topic_admin_only INTEGER DEFAULT 0 NOT NULL, \
current_version_id INTEGER, \
topic_type INTEGER NOT NULL, \
redirect_to VARCHAR(200), \
CONSTRAINT jam_p_topic PRIMARY KEY (topic_id), \
CONSTRAINT jam_f_topic_vwiki FOREIGN KEY (virtual_wiki_id) REFERENCES jam_virtual_wiki(virtual_wiki_id), \
CONSTRAINT jam_f_topic_namesp FOREIGN KEY (namespace_id) REFERENCES jam_namespace(namespace_id), \
CONSTRAINT jam_u_topic_name UNIQUE (topic_name, virtual_wiki_id, delete_date) \
)
STATEMENT_CREATE_TOPIC_LINKS_TABLE = \
CREATE TABLE jam_topic_links ( \
topic_id INTEGER NOT NULL, \
link_topic_namespace_id INTEGER DEFAULT 0 NOT NULL, \
link_topic_page_name VARCHAR(200) NOT NULL, \
CONSTRAINT jam_p_topic_links PRIMARY KEY (topic_id, link_topic_namespace_id, link_topic_page_name), \
CONSTRAINT jam_f_tlink_namesp FOREIGN KEY (link_topic_namespace_id) REFERENCES jam_namespace(namespace_id) \
)
STATEMENT_CREATE_TOPIC_LINKS_INDEX = \
CREATE INDEX jam_i_topic_links_tnm on jam_topic_links (link_topic_page_name)
STATEMENT_CREATE_TOPIC_PAGE_NAME_INDEX = \
CREATE INDEX jam_i_topic_pgnm on jam_topic (page_name)
STATEMENT_CREATE_TOPIC_PAGE_NAME_LOWER_INDEX = \
CREATE INDEX jam_i_topic_pgnml on jam_topic (page_name_lower)
STATEMENT_CREATE_TOPIC_VIRTUAL_WIKI_INDEX = \
CREATE INDEX jam_i_topic_vwiki on jam_topic (virtual_wiki_id)
STATEMENT_CREATE_TOPIC_NAMESPACE_INDEX = \
CREATE INDEX jam_i_topic_nmsp on jam_topic (namespace_id)
STATEMENT_CREATE_TOPIC_CURRENT_VERSION_INDEX = \
CREATE INDEX jam_i_topic_cver on jam_topic (current_version_id)
STATEMENT_CREATE_TOPIC_VERSION_TABLE = \
CREATE TABLE jam_topic_version ( \
topic_version_id INTEGER NOT NULL, \
topic_id INTEGER NOT NULL, \
edit_comment VARCHAR(200), \
version_content TEXT, \
wiki_user_id INTEGER, \
wiki_user_display VARCHAR(100) NOT NULL, \
edit_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, \
edit_type INTEGER NOT NULL, \
previous_topic_version_id INTEGER, \
characters_changed INTEGER, \
version_params VARCHAR(500), \
CONSTRAINT jam_p_topic_ver PRIMARY KEY (topic_version_id), \
CONSTRAINT jam_f_topicv_topic FOREIGN KEY (topic_id) REFERENCES jam_topic(topic_id), \
CONSTRAINT jam_f_topicv_wuser FOREIGN KEY (wiki_user_id) REFERENCES jam_wiki_user(wiki_user_id), \
CONSTRAINT jam_f_topicv_pver FOREIGN KEY (previous_topic_version_id) REFERENCES jam_topic_version(topic_version_id) \
)
STATEMENT_CREATE_TOPIC_VERSION_TOPIC_INDEX = \
CREATE INDEX jam_i_topicv_topic on jam_topic_version (topic_id)
STATEMENT_CREATE_TOPIC_VERSION_PREVIOUS_INDEX = \
CREATE INDEX jam_i_topicv_prv on jam_topic_version (previous_topic_version_id)
STATEMENT_CREATE_TOPIC_VERSION_USER_DISPLAY_INDEX = \
CREATE INDEX jam_i_topicv_udisp on jam_topic_version (wiki_user_display)
STATEMENT_CREATE_TOPIC_VERSION_USER_ID_INDEX = \
CREATE INDEX jam_i_topicv_uid on jam_topic_version (wiki_user_id)
STATEMENT_CREATE_USER_BLOCK_TABLE = \
CREATE TABLE jam_user_block ( \
user_block_id INTEGER NOT NULL, \
wiki_user_id INTEGER, \
ip_address VARCHAR(39), \
block_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, \
block_end_date TIMESTAMP, \
block_reason VARCHAR(200), \
blocked_by_user_id INTEGER NOT NULL, \
unblock_date TIMESTAMP, \
unblock_reason VARCHAR(200), \
unblocked_by_user_id INTEGER, \
CONSTRAINT jam_u_ublock PRIMARY KEY (user_block_id), \
CONSTRAINT jam_f_ublock_userid FOREIGN KEY (wiki_user_id) REFERENCES jam_wiki_user(wiki_user_id), \
CONSTRAINT jam_f_ublock_blkid FOREIGN KEY (blocked_by_user_id) REFERENCES jam_wiki_user(wiki_user_id), \
CONSTRAINT jam_f_ublock_unblkid FOREIGN KEY (unblocked_by_user_id) REFERENCES jam_wiki_user(wiki_user_id) \
)
STATEMENT_CREATE_USERS_TABLE = \
CREATE TABLE jam_users ( \
username varchar(100) NOT NULL, \
password varchar(150) NOT NULL, \
enabled INTEGER DEFAULT 1 NOT NULL, \
challenge_value varchar(100), \
challenge_date timestamp, \
challenge_ip varchar(39), \
challenge_tries integer DEFAULT 0 NOT NULL, \
CONSTRAINT jam_p_users PRIMARY KEY (username) \
)
STATEMENT_CREATE_VIRTUAL_WIKI_TABLE = \
CREATE TABLE jam_virtual_wiki ( \
virtual_wiki_id INTEGER NOT NULL, \
virtual_wiki_name VARCHAR(100) NOT NULL, \
default_topic_name VARCHAR(200), \
create_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, \
logo_image_url VARCHAR(200), \
site_name VARCHAR(200), \
meta_description VARCHAR(500), \
CONSTRAINT jam_p_vwiki PRIMARY KEY (virtual_wiki_id), \
CONSTRAINT jam_u_vwiki_name UNIQUE (virtual_wiki_name) \
)
STATEMENT_CREATE_WATCHLIST_TABLE = \
CREATE TABLE jam_watchlist ( \
wiki_user_id INTEGER NOT NULL, \
topic_name VARCHAR(200), \
virtual_wiki_id INTEGER NOT NULL, \
CONSTRAINT jam_p_watchlist PRIMARY KEY (wiki_user_id, topic_name, virtual_wiki_id), \
CONSTRAINT jam_f_wlist_userid FOREIGN KEY (wiki_user_id) REFERENCES jam_wiki_user(wiki_user_id), \
CONSTRAINT jam_f_wlist_vwiki FOREIGN KEY (virtual_wiki_id) REFERENCES jam_virtual_wiki(virtual_wiki_id) \
)
STATEMENT_CREATE_WIKI_FILE_TABLE = \
CREATE TABLE jam_file ( \
file_id INTEGER NOT NULL, \
virtual_wiki_id INTEGER NOT NULL, \
file_name VARCHAR(200) NOT NULL, \
delete_date TIMESTAMP, \
file_read_only INTEGER DEFAULT 0 NOT NULL, \
file_admin_only INTEGER DEFAULT 0 NOT NULL, \
file_url VARCHAR(200) NOT NULL, \
mime_type VARCHAR(100) NOT NULL, \
topic_id INTEGER NOT NULL, \
file_size INTEGER NOT NULL, \
CONSTRAINT jam_p_file PRIMARY KEY (file_id), \
CONSTRAINT jam_f_file_vwiki FOREIGN KEY (virtual_wiki_id) REFERENCES jam_virtual_wiki(virtual_wiki_id), \
CONSTRAINT jam_f_file_topic FOREIGN KEY (topic_id) REFERENCES jam_topic(topic_id), \
CONSTRAINT jam_u_file_url UNIQUE (file_url), \
CONSTRAINT jam_u_file_topic UNIQUE (virtual_wiki_id, topic_id) \
)
STATEMENT_CREATE_WIKI_FILE_VERSION_TABLE = \
CREATE TABLE jam_file_version ( \
file_version_id INTEGER NOT NULL, \
file_id INTEGER NOT NULL, \
upload_comment VARCHAR(200), \
file_url VARCHAR(200) NOT NULL, \
wiki_user_id INTEGER, \
wiki_user_display VARCHAR(100) NOT NULL, \
upload_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, \
mime_type VARCHAR(100) NOT NULL, \
file_size INTEGER NOT NULL, \
CONSTRAINT jam_p_file_ver PRIMARY KEY (file_version_id), \
CONSTRAINT jam_f_filev_file FOREIGN KEY (file_id) REFERENCES jam_file(file_id), \
CONSTRAINT jam_f_filev_wuser FOREIGN KEY (wiki_user_id) REFERENCES jam_wiki_user(wiki_user_id), \
CONSTRAINT jam_u_filev_url UNIQUE (file_url), \
CONSTRAINT jam_u_filev_f_id_fv_id UNIQUE (file_id, file_version_id) \
)
STATEMENT_CREATE_WIKI_USER_TABLE = \
CREATE TABLE jam_wiki_user ( \
wiki_user_id INTEGER NOT NULL, \
login VARCHAR(100) NOT NULL, \
display_name VARCHAR(100), \
create_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, \
last_login_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, \
create_ip_address VARCHAR(39) NOT NULL, \
last_login_ip_address VARCHAR(39) NOT NULL, \
email VARCHAR(100), \
CONSTRAINT jam_p_wuser PRIMARY KEY (wiki_user_id), \
CONSTRAINT jam_f_wuser_users FOREIGN KEY (login) REFERENCES jam_users(username) \
)
STATEMENT_CREATE_WIKI_USER_LOGIN_INDEX = \
CREATE UNIQUE INDEX jam_u_wuser_login on jam_wiki_user (lower(login))
STATEMENT_CREATE_USER_PREFERENCES_DEFAULTS_TABLE = \
CREATE TABLE jam_user_preferences_defaults ( \
pref_key VARCHAR(100), \
pref_value VARCHAR(250), \
pref_group_key VARCHAR(100), \
seq_nr INTEGER, \
CONSTRAINT jam_p_uprefdef PRIMARY KEY (pref_key) \
)
STATEMENT_CREATE_USER_PREFERENCES_TABLE = \
CREATE TABLE jam_user_preferences ( \
wiki_user_id INTEGER, \
pref_key VARCHAR(100), \
pref_value VARCHAR(250), \
CONSTRAINT jam_p_upref PRIMARY KEY (wiki_user_id, pref_key), \
CONSTRAINT jam_f_upref_uwiki FOREIGN KEY (wiki_user_id) REFERENCES jam_wiki_user (wiki_user_id), \
CONSTRAINT jam_f_upref_uprefdef FOREIGN KEY (pref_key) REFERENCES jam_user_preferences_defaults (pref_key) \
)
STATEMENT_CREATE_USER_PREFERENCES_WIKI_USER_INDEX = \
CREATE INDEX jam_u_upref ON jam_user_preferences(wiki_user_id)
STATEMENT_CREATE_FILE_DATA_TABLE = \
CREATE TABLE jam_file_data ( \
file_version_id INTEGER NOT NULL, \
resized INTEGER NOT NULL, \
image_width INTEGER NOT NULL, \
image_height INTEGER NOT NULL, \
file_data BLOB NOT NULL, \
CONSTRAINT jam_p_file_data PRIMARY KEY (file_version_id, resized), \
CONSTRAINT jam_f_file_data_file_version FOREIGN KEY (file_version_id) REFERENCES jam_file_version(file_version_id) \
)
STATEMENT_CREATE_SEQUENCES =
STATEMENT_DELETE_AUTHORITIES = \
delete from jam_authorities \
where username = ?
STATEMENT_DELETE_CONFIGURATION = \
delete from jam_configuration
STATEMENT_DELETE_GROUP_MAP_GROUP = \
delete from jam_group_members \
where groupId = ?
STATEMENT_DELETE_GROUP_MAP_USER = \
delete from jam_group_members \
where username = ? \
and group_id > 2
STATEMENT_DELETE_GROUP_AUTHORITIES = \
delete from jam_group_authorities \
where group_id = ?
STATEMENT_DELETE_INTERWIKI = \
delete from jam_interwiki \
where interwiki_prefix = ?
STATEMENT_DELETE_LOG_ITEMS = \
DELETE from jam_log \
where virtual_wiki_id = ?
STATEMENT_DELETE_LOG_ITEMS_BY_TOPIC_VERSION = \
DELETE from jam_log \
where topic_version_id = ?
STATEMENT_DELETE_NAMESPACE_TRANSLATIONS = \
delete from jam_namespace_translation \
where virtual_wiki_id = ?
STATEMENT_DELETE_RECENT_CHANGES = \
DELETE from jam_recent_change
STATEMENT_DELETE_RECENT_CHANGES_TOPIC = \
DELETE from jam_recent_change \
where topic_id = ? \
and edit_type != 5
STATEMENT_DELETE_RECENT_CHANGES_TOPIC_VERSION = \
DELETE from jam_recent_change \
where topic_version_id = ?
STATEMENT_DELETE_TOPIC_CATEGORIES = \
delete from jam_category \
where child_topic_id = ?
STATEMENT_DELETE_TOPIC_LINKS = \
delete from jam_topic_links \
where topic_id = ?
STATEMENT_DELETE_TOPIC_VERSION = \
delete from jam_topic_version \
where topic_version_id = ?
STATEMENT_DELETE_WATCHLIST_ENTRY = \
delete from jam_watchlist \
where virtual_wiki_id = ? \
and topic_name = ? \
and wiki_user_id = ?
STATEMENT_DELETE_RESIZED_IMAGES = \
delete from jam_file_data \
where file_version_id in (select file_version_id from jam_file_version where file_id = ?) \
and resized != 0
STATEMENT_DELETE_USER_PREFERENCES = \
delete from jam_user_preferences \
where wiki_user_id = ?
STATEMENT_DROP_SEQUENCES =
STATEMENT_DROP_AUTHORITIES_TABLE = \
DROP TABLE jam_authorities
STATEMENT_DROP_CATEGORY_TABLE = \
DROP TABLE jam_category
STATEMENT_DROP_CONFIGURATION_TABLE = \
DROP TABLE jam_configuration
STATEMENT_DROP_GROUP_AUTHORITIES_TABLE = \
DROP TABLE jam_group_authorities
STATEMENT_DROP_GROUP_MEMBERS_TABLE = \
DROP TABLE jam_group_members
STATEMENT_DROP_GROUP_TABLE = \
DROP TABLE jam_group
STATEMENT_DROP_INTERWIKI_TABLE = \
DROP TABLE jam_interwiki
STATEMENT_DROP_LOG_TABLE = \
DROP TABLE jam_log
STATEMENT_DROP_NAMESPACE_TABLE = \
DROP TABLE jam_namespace
STATEMENT_DROP_NAMESPACE_TRANSLATION_TABLE = \
DROP TABLE jam_namespace_translation
STATEMENT_DROP_RECENT_CHANGE_TABLE = \
DROP TABLE jam_recent_change
STATEMENT_DROP_ROLE_TABLE = \
DROP TABLE jam_role
STATEMENT_DROP_TOPIC_CURRENT_VERSION_CONSTRAINT = \
ALTER TABLE jam_topic drop constraint jam_f_topic_topicv
STATEMENT_DROP_TOPIC_TABLE = \
DROP TABLE jam_topic
STATEMENT_DROP_TOPIC_LINKS_TABLE = \
DROP TABLE jam_topic_links
STATEMENT_DROP_TOPIC_VERSION_TABLE = \
DROP TABLE jam_topic_version
STATEMENT_DROP_USER_BLOCK_TABLE = \
DROP TABLE jam_user_block
STATEMENT_DROP_USERS_TABLE = \
DROP TABLE jam_users
STATEMENT_DROP_VIRTUAL_WIKI_TABLE = \
DROP TABLE jam_virtual_wiki
STATEMENT_DROP_WATCHLIST_TABLE = \
DROP TABLE jam_watchlist
STATEMENT_DROP_WIKI_FILE_TABLE = \
DROP TABLE jam_file
STATEMENT_DROP_WIKI_FILE_VERSION_TABLE = \
DROP TABLE jam_file_version
STATEMENT_DROP_WIKI_USER_TABLE = \
DROP TABLE jam_wiki_user
STATEMENT_DROP_FILE_DATA_TABLE = \
DROP TABLE jam_file_data
STATEMENT_INSERT_AUTHORITY = \
insert into jam_authorities ( \
username, authority \
) values ( \
?, ? \
)
STATEMENT_INSERT_CATEGORY = \
insert into jam_category ( \
child_topic_id, category_name, sort_key \
) values ( \
?, ?, ? \
)
STATEMENT_INSERT_CONFIGURATION = \
insert into jam_configuration ( \
config_key, config_value \
) values ( \
?, ? \
)
STATEMENT_INSERT_GROUP = \
insert into jam_group ( \
group_id, group_name, group_description \
) values ( \
?, ?, ? \
)
STATEMENT_INSERT_GROUP_AUTO_INCREMENT = \
insert into jam_group ( \
group_name, group_description \
) values ( \
?, ? \
)
STATEMENT_INSERT_GROUP_AUTHORITY = \
insert into jam_group_authorities ( \
group_id, authority \
) values ( \
?, ? \
)
STATEMENT_INSERT_GROUP_MEMBER = \
insert into jam_group_members ( \
id, username, group_id \
) values ( \
?, ?, ? \
)
STATEMENT_INSERT_GROUP_MEMBER_AUTO_INCREMENT = \
insert into jam_group_members ( \
username, group_id \
) values ( \
?, ? \
)
STATEMENT_INSERT_INTERWIKI = \
insert into jam_interwiki ( \
interwiki_prefix, interwiki_pattern, interwiki_display, interwiki_type \
) values ( \
?, ?, ?, ? \
)
STATEMENT_INSERT_LOG_ITEM = \
insert into jam_log ( \
log_date, virtual_wiki_id, wiki_user_id, \
display_name, log_type, log_sub_type, log_comment, \
log_params, topic_id, topic_version_id \
) values ( \
?, ?, ?, ?, ?, ?, ?, ?, ?, ? \
)
STATEMENT_INSERT_LOG_ITEMS_BLOCK = \
INSERT INTO jam_log ( \
log_date, virtual_wiki_id, wiki_user_id, \
display_name, log_type, log_comment, log_params, \
log_sub_type, topic_id, topic_version_id \
) \
SELECT \
block_date, ?, blocked_by_user_id, \
jam_wiki_user_2.login, ?, block_reason, \
coalesce(jam_wiki_user.login, jam_user_block.ip_address) || '|' || block_end_date, \
?, null, null \
FROM jam_wiki_user jam_wiki_user_2, jam_user_block \
LEFT OUTER JOIN jam_wiki_user ON ( \
jam_wiki_user.wiki_user_id = jam_user_block.wiki_user_id \
) \
WHERE jam_user_block.blocked_by_user_id = jam_wiki_user_2.wiki_user_id \
AND jam_user_block.unblocked_by_user_id is null
STATEMENT_INSERT_LOG_ITEMS_BY_TOPIC_VERSION_TYPE = \
INSERT INTO jam_log ( \
log_date, virtual_wiki_id, wiki_user_id, \
display_name, log_type, log_comment, log_params, \
topic_id, topic_version_id \
) \
SELECT \
jam_topic_version.edit_date, jam_topic.virtual_wiki_id, \
jam_topic_version.wiki_user_id, \
coalesce(jam_wiki_user.login, jam_topic_version.wiki_user_display), \
?, jam_topic_version.edit_comment, jam_topic.topic_name || ?, \
jam_topic.topic_id, jam_topic_version.topic_version_id \
FROM jam_topic, jam_topic_version \
LEFT OUTER JOIN jam_wiki_user ON ( \
jam_wiki_user.wiki_user_id = jam_topic_version.wiki_user_id \
) \
WHERE jam_topic.topic_id = jam_topic_version.topic_id \
AND jam_topic.virtual_wiki_id = ? \
AND jam_topic_version.edit_type = ?
STATEMENT_INSERT_LOG_ITEMS_IMPORT = \
INSERT INTO jam_log ( \
log_date, virtual_wiki_id, wiki_user_id, \
display_name, log_type, log_comment, log_params, \
topic_id, topic_version_id \
) \
SELECT \
jam_topic_version.edit_date, jam_topic.virtual_wiki_id, \
jam_topic_version.wiki_user_id, \
coalesce(jam_wiki_user.login, jam_topic_version.wiki_user_display), \
?, jam_topic_version.edit_comment, jam_topic.topic_name, \
jam_topic.topic_id, jam_topic_version.topic_version_id \
FROM jam_topic, jam_topic_version \
LEFT OUTER JOIN jam_wiki_user ON ( \
jam_wiki_user.wiki_user_id = jam_topic_version.wiki_user_id \
) \
WHERE jam_topic.topic_id = jam_topic_version.topic_id \
AND jam_topic_version.edit_type = ? \
AND jam_topic.virtual_wiki_id = ? \
AND jam_topic_version.topic_version_id in ( \
select max(topic_version_id) from jam_topic_version \
where edit_type = ? \
group by topic_id \
)
STATEMENT_INSERT_LOG_ITEMS_MOVE = \
INSERT INTO jam_log ( \
log_date, virtual_wiki_id, wiki_user_id, \
display_name, log_type, log_comment, log_params, \
topic_id, topic_version_id \
) \
SELECT \
jam_topic_version.edit_date, jam_topic.virtual_wiki_id, \
jam_topic_version.wiki_user_id, \
coalesce(jam_wiki_user.login, jam_topic_version.wiki_user_display), \
?, jam_topic_version.edit_comment, jam_topic.topic_name || '|' || jam_topic.redirect_to, \
jam_topic.topic_id, jam_topic_version.topic_version_id \
FROM jam_topic, jam_topic_version \
LEFT OUTER JOIN jam_wiki_user ON ( \
jam_wiki_user.wiki_user_id = jam_topic_version.wiki_user_id \
) \
WHERE jam_topic.topic_id = jam_topic_version.topic_id \
AND jam_topic.virtual_wiki_id = ? \
AND jam_topic.redirect_to is not null \
AND jam_topic_version.edit_type = ?
STATEMENT_INSERT_LOG_ITEMS_UNBLOCK = \
INSERT INTO jam_log ( \
log_date, virtual_wiki_id, wiki_user_id, \
display_name, log_type, log_comment, log_params, \
log_sub_type, topic_id, topic_version_id \
) \
SELECT \
unblock_date, ?, unblocked_by_user_id, \
jam_wiki_user_2.login, ?, unblock_reason, \
coalesce(jam_wiki_user.login, jam_user_block.ip_address), \
?, null, null \
FROM jam_wiki_user jam_wiki_user_2, jam_user_block \
LEFT OUTER JOIN jam_wiki_user ON ( \
jam_wiki_user.wiki_user_id = jam_user_block.wiki_user_id \
) \
WHERE jam_user_block.unblocked_by_user_id = jam_wiki_user_2.wiki_user_id \
AND jam_user_block.unblocked_by_user_id is not null
STATEMENT_INSERT_LOG_ITEMS_UPLOAD = \
INSERT INTO jam_log ( \
log_date, virtual_wiki_id, wiki_user_id, \
display_name, log_type, log_comment, log_params, \
topic_id, topic_version_id \
) \
SELECT \
jam_topic_version.edit_date, jam_topic.virtual_wiki_id, \
jam_topic_version.wiki_user_id, \
coalesce(jam_wiki_user.login, jam_topic_version.wiki_user_display), \
?, jam_topic_version.edit_comment, jam_topic.topic_name, \
jam_topic.topic_id, jam_topic_version.topic_version_id \
FROM jam_topic, jam_topic_version \
LEFT OUTER JOIN jam_wiki_user ON ( \
jam_wiki_user.wiki_user_id = jam_topic_version.wiki_user_id \
) \
WHERE jam_topic.topic_id = jam_topic_version.topic_id \
AND jam_topic.virtual_wiki_id = ? \
AND jam_topic_version.edit_type = ? \
AND jam_topic.topic_type in (4, 6)
STATEMENT_INSERT_LOG_ITEMS_USER = \
INSERT INTO jam_log ( \
log_date, virtual_wiki_id, wiki_user_id, \
display_name, log_type, log_comment, log_params, \
topic_id, topic_version_id \
) \
SELECT \
create_date, ?, wiki_user_id, \
login, ?, null, null, null, null \
FROM jam_wiki_user
STATEMENT_INSERT_NAMESPACE = \
insert into jam_namespace ( \
namespace, main_namespace_id, namespace_id \
) values ( \
?, ?, ? \
)
STATEMENT_INSERT_NAMESPACE_TRANSLATION = \
insert into jam_namespace_translation ( \
namespace_id, virtual_wiki_id, namespace \
) values ( \
?, ?, ? \
)
STATEMENT_INSERT_RECENT_CHANGE = \
insert into jam_recent_change ( \
topic_version_id, previous_topic_version_id, topic_id, \
topic_name, change_date, change_comment, wiki_user_id, \
display_name, edit_type, virtual_wiki_id, virtual_wiki_name, \
characters_changed, log_type, log_sub_type, log_params \
) values ( \
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? \
)
STATEMENT_INSERT_RECENT_CHANGES_VERSIONS = \
INSERT INTO jam_recent_change ( \
topic_version_id, topic_id, \
topic_name, change_date, wiki_user_id, display_name, \
edit_type, virtual_wiki_id, virtual_wiki_name, change_comment, \
previous_topic_version_id, characters_changed, log_type, log_params \
) \
SELECT \
jam_topic_version.topic_version_id, jam_topic.topic_id, \
jam_topic.topic_name, jam_topic_version.edit_date, \
jam_topic_version.wiki_user_id, \
coalesce(jam_wiki_user.login, jam_topic_version.wiki_user_display), \
jam_topic_version.edit_type, jam_virtual_wiki.virtual_wiki_id, \
jam_virtual_wiki.virtual_wiki_name, jam_topic_version.edit_comment, \
jam_topic_version.previous_topic_version_id, \
jam_topic_version.characters_changed, null, jam_topic_version.version_params \
FROM jam_topic, jam_virtual_wiki, jam_topic_version \
LEFT OUTER JOIN jam_wiki_user ON ( \
jam_wiki_user.wiki_user_id = jam_topic_version.wiki_user_id \
) \
WHERE jam_topic.topic_id = jam_topic_version.topic_id \
AND jam_topic.virtual_wiki_id = jam_virtual_wiki.virtual_wiki_id \
AND jam_topic.delete_date is null \
AND ( \
jam_topic_version.edit_type in (1, 2, 3) \
OR (jam_topic_version.edit_type = 8 AND jam_topic.current_version_id != jam_topic_version.topic_version_id) \
) \
order by jam_topic_version.edit_date desc \
limit ?
STATEMENT_INSERT_RECENT_CHANGES_LOGS = \
INSERT INTO jam_recent_change ( \
topic_version_id, topic_id, \
topic_name, change_date, wiki_user_id, display_name, \
edit_type, virtual_wiki_id, virtual_wiki_name, change_comment, \
previous_topic_version_id, characters_changed, log_type, \
log_sub_type, log_params \
) \
SELECT \
jam_log.topic_version_id, jam_log.topic_id, null, jam_log.log_date, \
jam_log.wiki_user_id, coalesce(jam_wiki_user.login, jam_log.display_name), \
null, jam_virtual_wiki.virtual_wiki_id, \
jam_virtual_wiki.virtual_wiki_name, jam_log.log_comment, \
null, null, jam_log.log_type, jam_log.log_sub_type, jam_log.log_params \
FROM jam_virtual_wiki, jam_log \
LEFT OUTER JOIN jam_wiki_user ON ( \
jam_wiki_user.wiki_user_id = jam_log.wiki_user_id \
) \
WHERE jam_log.virtual_wiki_id = jam_virtual_wiki.virtual_wiki_id
STATEMENT_INSERT_ROLE = \
insert into jam_role ( \
role_name, role_description \
) values ( \
?, ? \
)
STATEMENT_INSERT_TOPIC = \
insert into jam_topic ( \
topic_id, virtual_wiki_id, topic_name, topic_type, \
topic_read_only, current_version_id, delete_date, \
topic_admin_only, redirect_to, namespace_id, \
page_name, page_name_lower \
) values ( \
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? \
)
STATEMENT_INSERT_TOPIC_AUTO_INCREMENT = \
insert into jam_topic ( \
virtual_wiki_id, topic_name, topic_type, \
topic_read_only, current_version_id, delete_date, \
topic_admin_only, redirect_to, namespace_id, \
page_name, page_name_lower \
) values ( \
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? \
)
STATEMENT_INSERT_TOPIC_LINKS = \
insert into jam_topic_links ( \
topic_id, link_topic_namespace_id, link_topic_page_name \
) values ( \
?, ?, ? \
)
STATEMENT_INSERT_TOPIC_VERSION = \
insert into jam_topic_version ( \
topic_version_id, topic_id, edit_comment, version_content, \
wiki_user_id, edit_type, wiki_user_display, edit_date, \
previous_topic_version_id, characters_changed, version_params \
) values ( \
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? \
)
STATEMENT_INSERT_TOPIC_VERSION_AUTO_INCREMENT = \
insert into jam_topic_version ( \
topic_id, edit_comment, version_content, \
wiki_user_id, edit_type, wiki_user_display, edit_date, \
previous_topic_version_id, characters_changed, version_params \
) values ( \
?, ?, ?, ?, ?, ?, ?, ?, ?, ? \
)
STATEMENT_INSERT_USER = \
insert into jam_users ( \
username, password \
) values ( \
?, ? \
)
STATEMENT_INSERT_USER_BLOCK = \
insert into jam_user_block ( \
user_block_id, wiki_user_id, ip_address, \
block_date, block_end_date, block_reason, \
blocked_by_user_id, unblock_date, unblock_reason, \
unblocked_by_user_id \
) values ( \
?, ?, ?, ?, ?, ?, ?, ?, ?, ? \
)
STATEMENT_INSERT_USER_BLOCK_AUTO_INCREMENT = \
insert into jam_user_block ( \
wiki_user_id, ip_address, \
block_date, block_end_date, block_reason, \
blocked_by_user_id, unblock_date, unblock_reason, \
unblocked_by_user_id \
) values ( \
?, ?, ?, ?, ?, ?, ?, ?, ? \
)
STATEMENT_INSERT_VIRTUAL_WIKI = \
insert into jam_virtual_wiki ( \
virtual_wiki_id, virtual_wiki_name, default_topic_name, \
logo_image_url, meta_description, site_name \
) values ( \
?, ?, ?, ?, ?, ? \
)
STATEMENT_INSERT_VIRTUAL_WIKI_AUTO_INCREMENT = \
insert into jam_virtual_wiki ( \
virtual_wiki_name, default_topic_name, \
logo_image_url, meta_description, site_name \
) values ( \
?, ?, ?, ?, ? \
)
STATEMENT_INSERT_WATCHLIST_ENTRY = \
insert into jam_watchlist ( \
virtual_wiki_id, topic_name, wiki_user_id \
) values ( \
?, ?, ? \
)
STATEMENT_INSERT_WIKI_FILE = \
insert into jam_file ( \
file_id, virtual_wiki_id, file_name, \
file_url, mime_type, topic_id, \
delete_date, file_read_only, file_admin_only, \
file_size \
) values ( \
?, ?, ?, ?, ?, ?, ?, ?, ?, ? \
)
STATEMENT_INSERT_WIKI_FILE_AUTO_INCREMENT = \
insert into jam_file ( \
virtual_wiki_id, file_name, \
file_url, mime_type, topic_id, \
delete_date, file_read_only, file_admin_only, \
file_size \
) values ( \
?, ?, ?, ?, ?, ?, ?, ?, ? \
)
STATEMENT_INSERT_WIKI_FILE_VERSION = \
insert into jam_file_version ( \
file_version_id, file_id, upload_comment, \
file_url, wiki_user_id, wiki_user_display, \
upload_date, mime_type, file_size \
) values ( \
?, ?, ?, ?, ?, ?, ?, ?, ? \
)
STATEMENT_INSERT_WIKI_FILE_VERSION_AUTO_INCREMENT = \
insert into jam_file_version ( \
file_id, upload_comment, \
file_url, wiki_user_id, wiki_user_display, \
upload_date, mime_type, file_size \
) values ( \
?, ?, ?, ?, ?, ?, ?, ? \
)
STATEMENT_INSERT_WIKI_USER = \
insert into jam_wiki_user ( \
wiki_user_id, login, display_name, create_date, \
last_login_date, create_ip_address, last_login_ip_address, \
email \
) values ( \
?, ?, ?, ?, ?, ?, ?, ? \
)
STATEMENT_INSERT_WIKI_USER_AUTO_INCREMENT = \
insert into jam_wiki_user ( \
login, display_name, create_date, \
last_login_date, create_ip_address, last_login_ip_address, \
email \
) values ( \
?, ?, ?, ?, ?, ?, ? \
)
STATEMENT_INSERT_USER_PREFERENCE_DEFAULTS = \
insert into jam_user_preferences_defaults ( \
pref_key, pref_value, pref_group_key, seq_nr \
) values ( \
?, ?, ?, ? \
)
STATEMENT_INSERT_USER_PREFERENCE = \
insert into jam_user_preferences ( \
wiki_user_id, pref_key, pref_value \
) values ( \
?, ?, ? \
)
STATEMENT_INSERT_FILE_DATA = \
INSERT INTO jam_file_data ( \
file_version_id, resized, image_width, image_height, file_data \
) VALUES ( \
?, ?, ?, ?, ? \
)
STATEMENT_SELECT_AUTHORITIES_AUTHORITY = \
( \
select jam_group_authorities.group_id as group_id, \
null as wiki_user_id, \
jam_group_authorities.authority as authority, \
jam_group.group_name as group_name, \
null as username \
from jam_group_authorities, jam_group \
where jam_group_authorities.group_id = jam_group.group_id \
and jam_group.group_id in ( \
select group_id from jam_group_authorities where authority = ? \
) \
) union ( \
select null as group_id, \
jam_wiki_user.wiki_user_id as wiki_user_id, \
jam_authorities.authority as authority, \
null as group_name, \
jam_authorities.username as username \
from jam_authorities, jam_users, jam_wiki_user \
where jam_authorities.username = jam_users.username \
and jam_wiki_user.login = jam_users.username \
and jam_users.username in ( \
select username from jam_authorities where authority = ? \
) \
) \
order by group_name, username
STATEMENT_SELECT_AUTHORITIES_AUTHORITY_ALL = \
( \
select jam_group_authorities.group_id as group_id, \
null as wiki_user_id, \
jam_group_authorities.authority as authority, \
jam_group.group_name as group_name, \
null as username \
from jam_group_authorities, jam_group \
where jam_group_authorities.group_id = jam_group.group_id \
and jam_group.group_id in ( \
select group_id from jam_group_authorities where authority = ? \
) \
) union ( \
select null as group_id, \
jam_wiki_user.wiki_user_id as wiki_user_id, \
jam_authorities.authority as authority, \
null as group_name, \
jam_authorities.username as username \
from jam_authorities, jam_users, jam_wiki_user \
where jam_authorities.username = jam_users.username \
and jam_wiki_user.login = jam_users.username \
and jam_users.username in ( \
select username from jam_authorities where authority = ? \
) \
) union ( \
select null as group_id, \
jam_wiki_user.wiki_user_id as wiki_user_id, \
jam_authorities.authority as authority, \
null as group_name, \
jam_authorities.username as username \
from jam_authorities, jam_group_authorities, jam_users, jam_wiki_user, jam_group_members \
where jam_group_authorities.authority = ? \
and jam_wiki_user.login = jam_users.username \
and jam_group_members.group_id = jam_group_authorities.group_id \
and jam_users.username = jam_group_members.username \
and jam_authorities.username = jam_users.username \
) union ( \
select null as group_id, \
jam_wiki_user.wiki_user_id as wiki_user_id, \
null as authority, \
null as group_name,\
jam_group_members.username as username \
from jam_group_authorities, jam_users, jam_wiki_user, jam_group_members \
where jam_group_authorities.authority = ? \
and jam_wiki_user.login = jam_users.username \
and jam_group_members.group_id = jam_group_authorities.group_id \
and jam_users.username = jam_group_members.username \
) \
order by group_name, username
STATEMENT_SELECT_AUTHORITIES_LOGIN = \
select jam_wiki_user.wiki_user_id, jam_users.username, \
jam_authorities.authority \
from jam_wiki_user, jam_users \
left outer join jam_authorities on ( \
jam_users.username = jam_authorities.username \
) \
where jam_users.username = jam_wiki_user.login \
and lower(jam_users.username) like ? \
order by jam_users.username
STATEMENT_SELECT_AUTHORITIES_USER = \
select role_name, role_description \
from jam_role \
where role_name in ( \
select authority from jam_authorities \
where username = ? \
union \
select jam_group_authorities.authority \
from jam_group_authorities, jam_group_members \
where jam_group_authorities.group_id = jam_group_members.group_id \
and jam_group_members.username = ? \
)
STATEMENT_SELECT_CATEGORIES = \
select distinct jam_category.category_name, jam_category.sort_key \
from jam_topic, jam_category \
where jam_topic.topic_id = jam_category.child_topic_id \
and jam_topic.virtual_wiki_id = ? \
order by jam_category.sort_key \
limit ? offset ?
STATEMENT_SELECT_CATEGORY_TOPICS = \
select jam_topic.topic_name, coalesce(jam_category.sort_key, jam_topic.topic_name) as sort_key, \
jam_topic.topic_type, jam_category.category_name \
from jam_topic, jam_category \
where jam_topic.topic_id = jam_category.child_topic_id \
and jam_topic.virtual_wiki_id = ? \
and lower(jam_category.category_name) = ? \
and delete_date is null \
order by sort_key
STATEMENT_SELECT_CONFIGURATION = \
select * from jam_configuration
STATEMENT_SELECT_GROUPS = \
select group_id, group_name, group_description \
from jam_group \
where group_id > 2 \
order by group_name
STATEMENT_SELECT_GROUP = \
select group_id, group_name, group_description \
from jam_group \
where group_name = ?
STATEMENT_SELECT_GROUP_BY_ID = \
select group_id, group_name, group_description \
from jam_group \
where group_id = ?
STATEMENT_SELECT_GROUP_AUTHORITIES = \
select role_name, role_description \
from jam_role \
where role_name in ( \
select authority \
from jam_group_authorities, jam_group \
where jam_group_authorities.group_id = jam_group.group_id \
and jam_group.group_name = ? \
)
STATEMENT_SELECT_GROUP_MAP_AUTHORITIES = \
select jam_group_authorities.authority \
from jam_group_authorities, jam_group_members \
where jam_group_authorities.group_id = jam_group_members.group_id \
and jam_group_members.username = ?
STATEMENT_SELECT_GROUPS_AUTHORITIES = \
select jam_group.group_id, jam_group.group_name, \
jam_group_authorities.authority \
from jam_group \
left outer join jam_group_authorities on ( \
jam_group.group_id = jam_group_authorities.group_id \
) \
order by jam_group.group_name
STATEMENT_SELECT_GROUP_MAP_GROUP = \
select username \
from jam_group_members \
where group_id = ? \
order by username
STATEMENT_SELECT_GROUP_MAP_USER = \
select group_id \
from jam_group_members \
where username = ? \
order by group_id
STATEMENT_SELECT_GROUP_SEQUENCE = \
select max(group_id) as group_id from jam_group
STATEMENT_SELECT_GROUP_MEMBERS_SEQUENCE = \
select max(id) as id from jam_group_members
STATEMENT_SELECT_INTERWIKIS = \
select * from jam_interwiki
STATEMENT_SELECT_LOG_ITEMS = \
select * from jam_log \
where virtual_wiki_id = ? \
order by log_date desc \
limit ? offset ?
STATEMENT_SELECT_LOG_ITEMS_BY_TYPE = \
select * from jam_log \
where log_type = ? \
and virtual_wiki_id = ? \
order by log_date desc \
limit ? offset ?
STATEMENT_SELECT_NAMESPACE_SEQUENCE = \
select max(namespace_id) as namespace_id from jam_namespace
STATEMENT_SELECT_NAMESPACES = \
select jam_namespace.namespace_id, jam_namespace.namespace, \
main_namespace_id, virtual_wiki_name, \
jam_namespace_translation.namespace as namespace_translation \
from jam_namespace \
left outer join ( \
select namespace_id, namespace, virtual_wiki_name \
from jam_namespace_translation, jam_virtual_wiki \
where jam_namespace_translation.virtual_wiki_id = jam_virtual_wiki.virtual_wiki_id \
) jam_namespace_translation on ( \
jam_namespace.namespace_id = jam_namespace_translation.namespace_id \
)
STATEMENT_SELECT_PW_RESET_CHALLENGE_DATA = \
select challenge_value, challenge_date, challenge_ip, challenge_tries \
from jam_users \
where username = ?
STATEMENT_SELECT_RECENT_CHANGES = \
select * from jam_recent_change \
where virtual_wiki_name = ? \
order by change_date desc \
limit ? offset ?
STATEMENT_SELECT_ROLES = \
select * from jam_role \
order by role_name
STATEMENT_SELECT_TOPIC_BY_ID = \
select jam_topic.*, jam_topic_version.version_content, \
jam_virtual_wiki.virtual_wiki_name \
from jam_topic, jam_topic_version, jam_virtual_wiki \
where jam_topic.current_version_id = jam_topic_version.topic_version_id \
and jam_topic.virtual_wiki_id = jam_virtual_wiki.virtual_wiki_id \
and jam_topic.topic_id = ?
STATEMENT_SELECT_TOPIC_BY_TYPE = \
select topic_name, topic_id from jam_topic \
where jam_topic.virtual_wiki_id = ? \
and jam_topic.topic_type in (?, ?) \
and jam_topic.namespace_id >= ? \
and jam_topic.namespace_id <= ? \
and jam_topic.delete_date is null \
order by jam_topic.topic_name \
limit ? offset ?
STATEMENT_SELECT_TOPIC_COUNT = \
select count(topic_id) as topic_count from jam_topic \
where virtual_wiki_id = ? \
and namespace_id >= ? \
and namespace_id <= ? \
and topic_type != ? \
and delete_date is null
STATEMENT_SELECT_TOPIC = \
select jam_topic.*, jam_topic_version.version_content, \
jam_virtual_wiki.virtual_wiki_name \
from jam_topic, jam_topic_version, jam_virtual_wiki \
where jam_topic.current_version_id = jam_topic_version.topic_version_id \
and jam_topic.virtual_wiki_id = jam_virtual_wiki.virtual_wiki_id \
and jam_topic.page_name = ? \
and jam_topic.virtual_wiki_id = ? \
and jam_topic.namespace_id = ? \
order by jam_topic.delete_date
STATEMENT_SELECT_TOPIC_HISTORY = \
SELECT \
jam_topic_version.topic_version_id, jam_topic.topic_id, \
jam_topic.topic_name, jam_topic_version.edit_date as change_date, \
jam_topic_version.wiki_user_id, \
coalesce(jam_wiki_user.login, jam_topic_version.wiki_user_display) as display_name, \
jam_topic_version.edit_type, jam_virtual_wiki.virtual_wiki_id, \
jam_virtual_wiki.virtual_wiki_name, jam_topic_version.edit_comment as change_comment, \
jam_topic_version.previous_topic_version_id, \
jam_topic_version.characters_changed, null as log_type, \
null as log_sub_type, \
jam_topic_version.version_params as log_params \
FROM jam_topic, jam_virtual_wiki, jam_topic_version \
LEFT OUTER JOIN jam_wiki_user ON ( \
jam_wiki_user.wiki_user_id = jam_topic_version.wiki_user_id \
) \
WHERE jam_topic.topic_id = ? \
AND jam_topic.topic_id = jam_topic_version.topic_id \
AND jam_topic.virtual_wiki_id = jam_virtual_wiki.virtual_wiki_id \
AND jam_topic.delete_date is {0} null \
order by change_date desc \
limit ? offset ?
STATEMENT_SELECT_TOPIC_NAME = \
select topic_name from jam_topic \
where page_name = ? \
and virtual_wiki_id = ? \
and namespace_id = ? \
and delete_date is null
STATEMENT_SELECT_TOPIC_NAME_LOWER = \
select topic_name from jam_topic \
where page_name_lower = ? \
and virtual_wiki_id = ? \
and namespace_id = ? \
and delete_date is null
STATEMENT_SELECT_TOPIC_LINKS = \
( \
select jam_topic.topic_name, null as child_topic_name \
from jam_topic, jam_topic_links \
where jam_topic.topic_id = jam_topic_links.topic_id \
and jam_topic.virtual_wiki_id = ? \
and jam_topic_links.link_topic_namespace_id = ? \
and jam_topic_links.link_topic_page_name = ? \
and jam_topic.redirect_to is null \
) union ( \
select parent.topic_name, child.topic_name as child_topic_name \
from jam_topic parent, jam_topic child, jam_topic_links \
where child.topic_id = jam_topic_links.topic_id \
and child.virtual_wiki_id = parent.virtual_wiki_id \
and parent.virtual_wiki_id = ? \
and parent.redirect_to = ? \
and jam_topic_links.link_topic_namespace_id = parent.namespace_id \
and jam_topic_links.link_topic_page_name = parent.page_name \
) \
order by topic_name, child_topic_name
STATEMENT_SELECT_TOPIC_LINK_ORPHANS = \
select jam_topic.topic_name \
from jam_topic \
left outer join jam_topic_links on ( \
jam_topic.namespace_id = jam_topic_links.link_topic_namespace_id \
and jam_topic.page_name = jam_topic_links.link_topic_page_name \
) \
left outer join jam_category on ( \
jam_topic.topic_id = jam_category.child_topic_id \
) \
where jam_topic.virtual_wiki_id = ? \
and jam_topic.namespace_id = ? \
and jam_topic.topic_type != ? \
and jam_topic.delete_date is null \
and jam_topic_links.link_topic_page_name is null \
and jam_category.child_topic_id is null
STATEMENT_SELECT_TOPIC_LOWER = \
select jam_topic.*, jam_topic_version.version_content, \
jam_virtual_wiki.virtual_wiki_name \
from jam_topic, jam_topic_version, jam_virtual_wiki \
where jam_topic.current_version_id = jam_topic_version.topic_version_id \
and jam_topic.virtual_wiki_id = jam_virtual_wiki.virtual_wiki_id \
and jam_topic.page_name_lower = ? \
and jam_topic.virtual_wiki_id = ? \
and jam_topic.namespace_id = ? \
order by jam_topic.delete_date
STATEMENT_SELECT_TOPIC_NAMES = \
select topic_name, topic_id, delete_date from jam_topic \
where virtual_wiki_id = ?
STATEMENT_SELECT_TOPIC_SEQUENCE = \
select max(topic_id) as topic_id from jam_topic
STATEMENT_SELECT_TOPIC_VERSION = \
select * from jam_topic_version \
where topic_version_id = ?
STATEMENT_SELECT_TOPIC_VERSION_NEXT_ID = \
select topic_version_id from jam_topic_version \
where previous_topic_version_id = ?
STATEMENT_SELECT_TOPIC_VERSION_SEQUENCE = \
select max(topic_version_id) as topic_version_id from jam_topic_version
STATEMENT_SELECT_TOPICS_ADMIN = \
select topic_name from jam_topic \
where virtual_wiki_id = ? \
and topic_admin_only = 1 \
and delete_date is null \
order by topic_name \
limit ? offset ?
STATEMENT_SELECT_USER_BLOCKS = \
select * from jam_user_block \
where (block_end_date > ? or block_end_date is null) \
and unblock_date is null \
order by block_date desc
STATEMENT_SELECT_USER_BLOCK_SEQUENCE = \
select max(user_block_id) as user_block_id from jam_user_block
STATEMENT_SELECT_USERS_AUTHENTICATION = \
select username from jam_users \
where username = ? \
and password = ?
STATEMENT_SELECT_USERS_ENCRYPTED_PASSWORD = \
select password from jam_users \
where username = ?
STATEMENT_SELECT_VIRTUAL_WIKI_SEQUENCE = \
select max(virtual_wiki_id) as virtual_wiki_id from jam_virtual_wiki
STATEMENT_SELECT_VIRTUAL_WIKIS = \
select * from jam_virtual_wiki \
order by virtual_wiki_name
STATEMENT_SELECT_WATCHLIST = \
select topic_name from jam_watchlist \
where virtual_wiki_id = ? \
and wiki_user_id = ?
STATEMENT_SELECT_WATCHLIST_CHANGES = \
select \
jam_topic_version.topic_version_id, jam_topic_version.topic_id, \
jam_topic_version.previous_topic_version_id, jam_topic.topic_name, \
jam_topic_version.edit_date as change_date, jam_topic_version.edit_comment as change_comment, \
jam_topic_version.wiki_user_id, jam_topic_version.edit_type, \
jam_wiki_user.login as display_name, jam_topic.virtual_wiki_id, \
jam_virtual_wiki.virtual_wiki_name, \
jam_topic_version.characters_changed, \
null as log_type, null as log_sub_type, \
jam_topic_version.version_params as log_params \
from jam_topic, jam_virtual_wiki, jam_topic_version, \
jam_wiki_user, jam_watchlist \
where jam_virtual_wiki.virtual_wiki_id = jam_topic.virtual_wiki_id \
and jam_wiki_user.wiki_user_id = jam_topic_version.wiki_user_id \
and jam_topic.current_version_id = jam_topic_version.topic_version_id \
and jam_topic.topic_name = jam_watchlist.topic_name \
and jam_virtual_wiki.virtual_wiki_id = ? \
and jam_watchlist.wiki_user_id = ? \
and (jam_topic.delete_date is null or jam_topic_version.edit_type = 5) \
order by edit_date desc \
limit ? offset ?
STATEMENT_SELECT_WIKI_FILE = \
select * from jam_file \
where virtual_wiki_id = ? \
and topic_id = ?
STATEMENT_SELECT_WIKI_FILE_COUNT = \
select count(file_id) as file_count from jam_file \
where virtual_wiki_id = ? \
and delete_date is null
STATEMENT_SELECT_WIKI_FILE_SEQUENCE = \
select max(file_id) as file_id from jam_file
STATEMENT_SELECT_WIKI_FILE_VERSION_SEQUENCE = \
select max(file_version_id) as file_version_id from jam_file_version
STATEMENT_SELECT_WIKI_FILE_VERSIONS = \
select * from jam_file_version \
where file_id = ? \
order by file_version_id desc
STATEMENT_SELECT_WIKI_USER = \
select * from jam_wiki_user \
where wiki_user_id = ?
STATEMENT_SELECT_WIKI_USER_CHANGES_ANONYMOUS = \
select \
jam_topic_version.topic_version_id, jam_topic_version.topic_id, \
jam_topic_version.previous_topic_version_id, jam_topic.topic_name, \
jam_topic_version.edit_date as change_date, jam_topic_version.edit_comment as change_comment, \
jam_topic_version.wiki_user_id, jam_topic_version.edit_type, \
jam_topic_version.wiki_user_display as display_name, \
jam_topic.virtual_wiki_id, jam_virtual_wiki.virtual_wiki_name, \
jam_topic_version.characters_changed, \
null as log_type, null as log_sub_type, \
jam_topic_version.version_params as log_params \
from jam_topic, jam_virtual_wiki, jam_topic_version \
where jam_virtual_wiki.virtual_wiki_id = jam_topic.virtual_wiki_id \
and jam_topic.topic_id = jam_topic_version.topic_id \
and jam_virtual_wiki.virtual_wiki_name = ? \
and jam_topic_version.wiki_user_display = ? \
and jam_topic_version.wiki_user_id is null \
and (jam_topic.delete_date is null or jam_topic_version.edit_type = 5) \
order by edit_date desc \
limit ? offset ?
STATEMENT_SELECT_WIKI_USER_CHANGES_LOGIN = \
select \
jam_topic_version.topic_version_id, jam_topic_version.topic_id, \
jam_topic_version.previous_topic_version_id, jam_topic.topic_name, \
jam_topic_version.edit_date as change_date, jam_topic_version.edit_comment as change_comment, \
jam_topic_version.wiki_user_id, jam_topic_version.edit_type, \
jam_wiki_user.login as display_name, jam_topic.virtual_wiki_id, \
jam_virtual_wiki.virtual_wiki_name, \
jam_topic_version.characters_changed, \
null as log_type, null as log_sub_type, \
jam_topic_version.version_params as log_params \
from jam_topic, jam_virtual_wiki, jam_topic_version, jam_wiki_user \
where jam_virtual_wiki.virtual_wiki_id = jam_topic.virtual_wiki_id \
and jam_wiki_user.wiki_user_id = jam_topic_version.wiki_user_id \
and jam_topic.topic_id = jam_topic_version.topic_id \
and jam_virtual_wiki.virtual_wiki_name = ? \
and jam_wiki_user.login = ? \
and (jam_topic.delete_date is null or jam_topic_version.edit_type = 5) \
order by edit_date desc \
limit ? offset ?
STATEMENT_SELECT_WIKI_USER_COUNT = \
select count(wiki_user_id) as user_count from jam_wiki_user
STATEMENT_SELECT_WIKI_USER_DETAILS_PASSWORD = \
select password from jam_users \
where username = ?
STATEMENT_SELECT_WIKI_USER_LOGIN = \
select wiki_user_id from jam_wiki_user \
where login = ?
STATEMENT_SELECT_WIKI_USER_SEQUENCE = \
select max(wiki_user_id) as wiki_user_id from jam_wiki_user
STATEMENT_SELECT_WIKI_USERS = \
select login from jam_wiki_user \
order by login \
limit ? offset ?
STATEMENT_SELECT_USER_PREFERENCES_DEFAULTS = \
select pref_key, pref_value, pref_group_key, seq_nr \
from jam_user_preferences_defaults \
order by pref_group_key, seq_nr, pref_key
STATEMENT_SELECT_USER_PREFERENCES_DEFAULTS_BY_GROUP = \
select pref_key, pref_value, pref_group_key, seq_nr \
from jam_user_preferences_defaults \
order by seq_nr, pref_key \
where pref_group_key = ?
STATEMENT_SELECT_USER_PREFERENCES = \
select pref_key, pref_value \
from jam_user_preferences \
where wiki_user_id = ? \
order by pref_key
STATEMENT_SELECT_FILE_INFO = \
SELECT v.mime_type, d.image_width, d.image_height \
FROM jam_file_data d, jam_file_version v \
WHERE d.file_version_id = (select max(file_version_id) from jam_file_version where file_id = ?) and \
d.resized = ? and v.file_version_id = d.file_version_id
STATEMENT_SELECT_FILE_DATA = \
SELECT v.file_version_id, v.mime_type, d.image_width, d.image_height, d.file_data \
FROM jam_file_data d, jam_file_version v \
WHERE d.file_version_id = (select max(file_version_id) from jam_file_version where file_id = ?) and \
d.resized = ? and v.file_version_id = d.file_version_id
STATEMENT_SELECT_FILE_VERSION_DATA = \
SELECT v.file_version_id, v.mime_type, d.image_width, d.image_height, d.file_data \
FROM jam_file_data d, jam_file_version v \
WHERE d.file_version_id = ? and \
d.resized = ? and v.file_version_id = d.file_version_id
STATEMENT_UPDATE_GROUP = \
update jam_group \
set group_name = ?, \
group_description = ? \
where group_id = ?
STATEMENT_UPDATE_NAMESPACE = \
update jam_namespace \
set namespace = ?, \
main_namespace_id = ? \
where namespace_id = ?
STATEMENT_UPDATE_PW_RESET_CHALLENGE_DATA = \
update jam_users \
set challenge_value = ?, \
challenge_date = ?, \
challenge_ip = ?, \
challenge_tries = ? \
where username = ?
STATEMENT_UPDATE_RECENT_CHANGES_PREVIOUS_VERSION_ID = \
update jam_recent_change set \
previous_topic_version_id = ? \
where previous_topic_version_id = ?
STATEMENT_UPDATE_ROLE = \
update jam_role \
set role_description = ? \
where role_name = ?
STATEMENT_UPDATE_TOPIC = \
update jam_topic set \
virtual_wiki_id = ?, \
topic_name = ?, \
topic_type = ?, \
topic_read_only = ?, \
current_version_id = ?, \
delete_date = ?, \
topic_admin_only = ?, \
redirect_to = ?, \
namespace_id = ?, \
page_name = ?, \
page_name_lower = ? \
where topic_id = ?
STATEMENT_UPDATE_TOPIC_NAMESPACE = \
update jam_topic set \
namespace_id = ?, \
page_name = ?, \
page_name_lower = ? \
where topic_id = ?
STATEMENT_UPDATE_TOPIC_VERSION = \
update jam_topic_version set \
topic_id = ?, \
edit_comment = ?, \
version_content = ?, \
wiki_user_id = ?, \
edit_type = ?, \
wiki_user_display = ?, \
edit_date = ?, \
previous_topic_version_id = ?, \
characters_changed = ?, \
version_params = ? \
where topic_version_id = ?
STATEMENT_UPDATE_TOPIC_VERSION_PREVIOUS_VERSION_ID = \
update jam_topic_version set \
previous_topic_version_id = ? \
where topic_version_id = ?
STATEMENT_UPDATE_USER = \
update jam_users set \
password = ?, \
enabled = ? \
where username = ?
STATEMENT_UPDATE_USER_BLOCK = \
update jam_user_block set \
wiki_user_id = ?, \
ip_address = ?, \
block_date = ?, \
block_end_date = ?, \
block_reason = ?, \
blocked_by_user_id = ?, \
unblock_date = ?, \
unblock_reason = ?, \
unblocked_by_user_id = ? \
where user_block_id = ?
STATEMENT_UPDATE_VIRTUAL_WIKI = \
update jam_virtual_wiki set \
default_topic_name = ?, \
logo_image_url = ?, \
meta_description = ?, \
site_name = ? \
where virtual_wiki_id = ?
STATEMENT_UPDATE_WIKI_FILE = \
update jam_file set \
virtual_wiki_id = ?, \
file_name = ?, \
file_url = ?, \
mime_type = ?, \
topic_id = ?, \
delete_date = ?, \
file_read_only = ?, \
file_admin_only = ?, \
file_size = ? \
where file_id = ?
STATEMENT_UPDATE_WIKI_USER = \
update jam_wiki_user set \
login = ?, \
display_name = ?, \
last_login_date = ?, \
last_login_ip_address = ?, \
email = ? \
where wiki_user_id = ?
STATEMENT_UPDATE_USER_PREFERENCE_DEFAULTS = \
UPDATE jam_user_preferences_defaults SET \
pref_value = ?, \
pref_group_key = ?, \
seq_nr = ? \
WHERE pref_key = ?
UPGRADE_130_MIGRATE_USER_PREFERENCES_DEFAULT_LOCALE = \
INSERT INTO jam_user_preferences (wiki_user_id, pref_key, pref_value) \
SELECT wiki_user_id, 'user.default.locale', default_locale \
FROM jam_wiki_user \
WHERE default_locale IS NOT NULL
UPGRADE_130_MIGRATE_USER_PREFERENCES_EDITOR = \
INSERT INTO jam_user_preferences (wiki_user_id, pref_key, pref_value) \
SELECT wiki_user_id, 'user.preferred.editor', editor \
FROM jam_wiki_user \
WHERE editor IS NOT NULL
UPGRADE_130_MIGRATE_USER_PREFERENCES_SIGNATURE = \
INSERT INTO jam_user_preferences (wiki_user_id, pref_key, pref_value) \
SELECT wiki_user_id, 'user.signature', signature \
FROM jam_wiki_user \
WHERE signature IS NOT NULL
UPGRADE_130_REMOVE_WIKI_USER_TABLE_COLUMN_DEFAULT_LOCALE = \
ALTER TABLE jam_wiki_user DROP COLUMN default_locale
UPGRADE_130_REMOVE_WIKI_USER_TABLE_COLUMN_EDITOR = \
ALTER TABLE jam_wiki_user DROP COLUMN editor
UPGRADE_130_REMOVE_WIKI_USER_TABLE_COLUMN_SIGNATURE = \
ALTER TABLE jam_wiki_user DROP COLUMN signature
UPGRADE_130_ADD_USER_TABLE_COLUMN_CHALLENGE_VALUE = \
ALTER TABLE jam_users ADD COLUMN challenge_value varchar(100)
UPGRADE_130_ADD_USER_TABLE_COLUMN_CHALLENGE_DATE = \
ALTER TABLE jam_users ADD COLUMN challenge_date timestamp
UPGRADE_130_ADD_USER_TABLE_COLUMN_CHALLENGE_IP = \
ALTER TABLE jam_users ADD COLUMN challenge_ip varchar(39)
UPGRADE_130_ADD_USER_TABLE_COLUMN_CHALLENGE_TRIES = \
ALTER TABLE jam_users ADD COLUMN challenge_tries integer default 0 not null