-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathupgrade_2-0_mysql.sql
3125 lines (2793 loc) · 103 KB
/
upgrade_2-0_mysql.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* ATTENTION: You don't need to run or use this file! The upgrade.php script does everything for you! */
/******************************************************************************/
--- Changing column names.
/******************************************************************************/
---# Renaming table columns.
---{
// The array holding all the changes.
$nameChanges = array(
'admin_info_files' => array(
'ID_FILE' => 'ID_FILE id_file tinyint(4) unsigned NOT NULL auto_increment',
),
'approval_queue' => array(
'ID_MSG' => 'ID_MSG id_msg int(10) unsigned NOT NULL default \'0\'',
'ID_ATTACH' => 'ID_ATTACH id_attach int(10) unsigned NOT NULL default \'0\'',
'ID_EVENT' => 'ID_EVENT id_event smallint(5) unsigned NOT NULL default \'0\'',
'attachmentType' => 'attachmentType attachment_type tinyint(3) unsigned NOT NULL default \'0\'',
),
'attachments' => array(
'ID_ATTACH' => 'ID_ATTACH id_attach int(10) unsigned NOT NULL auto_increment',
'ID_THUMB' => 'ID_THUMB id_thumb int(10) unsigned NOT NULL default \'0\'',
'ID_MSG' => 'ID_MSG id_msg int(10) unsigned NOT NULL default \'0\'',
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
'attachmentType' => 'attachmentType attachment_type tinyint(3) unsigned NOT NULL default \'0\'',
),
'ban_groups' => array(
'ID_BAN_GROUP' => 'ID_BAN_GROUP id_ban_group mediumint(8) unsigned NOT NULL auto_increment',
),
'ban_items' => array(
'ID_BAN' => 'ID_BAN id_ban mediumint(8) unsigned NOT NULL auto_increment',
'ID_BAN_GROUP' => 'ID_BAN_GROUP id_ban_group smallint(5) unsigned NOT NULL default \'0\'',
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
),
'board_permissions' => array(
'ID_GROUP' => 'ID_GROUP id_group smallint(5) NOT NULL default \'0\'',
'ID_PROFILE' => 'ID_PROFILE id_profile smallint(5) NOT NULL default \'0\'',
'addDeny' => 'addDeny add_deny tinyint(4) NOT NULL default \'1\'',
),
'boards' => array(
'ID_BOARD' => 'ID_BOARD id_board smallint(5) unsigned NOT NULL auto_increment',
'ID_CAT' => 'ID_CAT id_cat tinyint(4) unsigned NOT NULL default \'0\'',
'childLevel' => 'childLevel child_level tinyint(4) unsigned NOT NULL default \'0\'',
'ID_PARENT' => 'ID_PARENT id_parent smallint(5) unsigned NOT NULL default \'0\'',
'boardOrder' => 'boardOrder board_order smallint(5) NOT NULL default \'0\'',
'ID_LAST_MSG' => 'ID_LAST_MSG id_last_msg int(10) unsigned NOT NULL default \'0\'',
'ID_MSG_UPDATED' => 'ID_MSG_UPDATED id_msg_updated int(10) unsigned NOT NULL default \'0\'',
'memberGroups' => 'memberGroups member_groups varchar(255) NOT NULL default \'-1,0\'',
'ID_PROFILE' => 'ID_PROFILE id_profile smallint(5) unsigned NOT NULL default \'1\'',
'numTopics' => 'numTopics num_topics mediumint(8) unsigned NOT NULL default \'0\'',
'numPosts' => 'numPosts num_posts mediumint(8) unsigned NOT NULL default \'0\'',
'countPosts' => 'countPosts count_posts tinyint(4) NOT NULL default \'0\'',
'ID_THEME' => 'ID_THEME id_theme tinyint(4) unsigned NOT NULL default \'0\'',
'unapprovedPosts' => 'unapprovedPosts unapproved_posts smallint(5) NOT NULL default \'0\'',
'unapprovedTopics' => 'unapprovedTopics unapproved_topics smallint(5) NOT NULL default \'0\'',
),
'calendar' => array(
'ID_EVENT' => 'ID_EVENT id_event smallint(5) unsigned NOT NULL auto_increment',
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
'ID_BOARD' => 'ID_BOARD id_board smallint(5) unsigned NOT NULL default \'0\'',
'ID_TOPIC' => 'ID_TOPIC id_topic mediumint(8) unsigned NOT NULL default \'0\'',
'startDate' => 'startDate start_date date NOT NULL default \'0001-01-01\'',
'endDate' => 'endDate end_date date NOT NULL default \'0001-01-01\'',
),
'calendar_holidays' => array(
'ID_HOLIDAY' => 'ID_HOLIDAY id_holiday smallint(5) unsigned NOT NULL auto_increment',
'eventDate' => 'eventDate event_date date NOT NULL default \'0001-01-01\'',
),
'categories' => array(
'ID_CAT' => 'ID_CAT id_cat tinyint(4) unsigned NOT NULL auto_increment',
'catOrder' => 'catOrder cat_order tinyint(4) NOT NULL default \'0\'',
'canCollapse' => 'canCollapse can_collapse tinyint(1) NOT NULL default \'1\'',
),
'collapsed_categories' => array(
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
'ID_CAT' => 'ID_CAT id_cat tinyint(4) unsigned NOT NULL',
),
'custom_fields' => array(
'ID_FIELD' => 'ID_FIELD id_field smallint(5) NOT NULL auto_increment',
'colName' => 'colName col_name varchar(12) NOT NULL default \'\'',
'fieldName' => 'fieldName field_name varchar(40) NOT NULL default \'\'',
'fieldDesc' => 'fieldDesc field_desc varchar(255) NOT NULL default \'\'',
'fieldType' => 'fieldType field_type varchar(8) NOT NULL default \'text\'',
'fieldLength' => 'fieldLength field_length smallint(5) NOT NULL default \'255\'',
'fieldOptions' => 'fieldOptions field_options text NOT NULL',
'showReg' => 'showReg show_reg tinyint(3) NOT NULL default \'0\'',
'showDisplay' => 'showDisplay show_display tinyint(3) NOT NULL default \'0\'',
'showProfile' => 'showProfile show_profile varchar(20) NOT NULL default \'forumprofile\'',
'defaultValue' => 'defaultValue default_value varchar(8) NOT NULL default \'0\'',
),
'group_moderators' => array(
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
'ID_GROUP' => 'ID_GROUP id_group smallint(5) unsigned NOT NULL default \'0\'',
),
'log_actions' => array(
'ID_ACTION' => 'ID_ACTION id_action int(10) unsigned NOT NULL auto_increment',
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
'logTime' => 'logTime log_time int(10) unsigned NOT NULL default \'0\'',
'ID_MSG' => 'ID_MSG id_msg int(10) unsigned NOT NULL default \'0\'',
'ID_TOPIC' => 'ID_TOPIC id_topic mediumint(8) unsigned NOT NULL default \'0\'',
'ID_BOARD' => 'ID_BOARD id_board smallint(5) unsigned NOT NULL default \'0\'',
),
'log_activity' => array(
'mostOn' => 'mostOn most_on smallint(5) unsigned NOT NULL default \'0\'',
),
'log_banned' => array(
'ID_BAN_LOG' => 'ID_BAN_LOG id_ban_log mediumint(8) unsigned NOT NULL auto_increment',
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
'logTime' => 'logTime log_time int(10) unsigned NOT NULL default \'0\'',
),
'log_boards' => array(
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
'ID_MSG' => 'ID_MSG id_msg int(10) unsigned NOT NULL default \'0\'',
'ID_BOARD' => 'ID_BOARD id_board smallint(5) unsigned NOT NULL default \'0\'',
),
'log_digest' => array(
'ID_TOPIC' => 'ID_TOPIC id_topic mediumint(8) unsigned NOT NULL default \'0\'',
'ID_MSG' => 'ID_MSG id_msg int(10) unsigned NOT NULL default \'0\'',
),
'log_errors' => array(
'ID_ERROR' => 'ID_ERROR id_error mediumint(8) unsigned NOT NULL auto_increment',
'logTime' => 'logTime log_time int(10) unsigned NOT NULL default \'0\'',
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
'errorType' => 'errorType error_type char(15) NOT NULL default \'general\'',
),
'log_floodcontrol' => array(
'logTime' => 'logTime log_time int(10) unsigned NOT NULL default \'0\'',
),
'log_group_requests' => array(
'ID_REQUEST' => 'ID_REQUEST id_request mediumint(8) unsigned NOT NULL auto_increment',
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
'ID_GROUP' => 'ID_GROUP id_group smallint(5) unsigned NOT NULL default \'0\'',
),
'log_mark_read' => array(
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
'ID_MSG' => 'ID_MSG id_msg int(10) unsigned NOT NULL default \'0\'',
'ID_BOARD' => 'ID_BOARD id_board smallint(5) unsigned NOT NULL default \'0\'',
),
'log_notify' => array(
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
'ID_TOPIC' => 'ID_TOPIC id_topic mediumint(8) unsigned NOT NULL default \'0\'',
'ID_BOARD' => 'ID_BOARD id_board smallint(5) unsigned NOT NULL default \'0\'',
),
'log_packages' => array(
'ID_INSTALL' => 'ID_INSTALL id_install int(10) NOT NULL auto_increment',
'ID_MEMBER_INSTALLED' => 'ID_MEMBER_INSTALLED id_member_installed mediumint(8) NOT NULL default \'0\'',
'ID_MEMBER_REMOVED' => 'ID_MEMBER_REMOVED id_member_removed mediumint(8) NOT NULL default \'0\'',
),
'log_polls' => array(
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
'ID_CHOICE' => 'ID_CHOICE id_choice tinyint(3) unsigned NOT NULL default \'0\'',
'ID_POLL' => 'ID_POLL id_poll mediumint(8) unsigned NOT NULL default \'0\'',
),
'log_reported' => array(
'ID_REPORT' => 'ID_REPORT id_report mediumint(8) unsigned NOT NULL auto_increment',
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
'ID_MSG' => 'ID_MSG id_msg int(10) unsigned NOT NULL default \'0\'',
'ID_TOPIC' => 'ID_TOPIC id_topic mediumint(8) unsigned NOT NULL default \'0\'',
'ID_BOARD' => 'ID_BOARD id_board smallint(5) unsigned NOT NULL default \'0\'',
),
'log_reported_comments' => array(
'ID_COMMENT' => 'ID_COMMENT id_comment mediumint(8) unsigned NOT NULL auto_increment',
'ID_REPORT' => 'ID_REPORT id_report mediumint(8) NOT NULL default \'0\'',
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
),
'log_scheduled_tasks' => array(
'ID_LOG' => 'ID_LOG id_log mediumint(8) NOT NULL auto_increment',
'ID_TASK' => 'ID_TASK id_task smallint(5) NOT NULL default \'0\'',
'timeRun' => 'timeRun time_run int(10) NOT NULL default \'0\'',
'timeTaken' => 'timeTaken time_taken float NOT NULL default \'0\'',
),
'log_search_results' => array(
'ID_TOPIC' => 'ID_TOPIC id_topic mediumint(8) unsigned NOT NULL default \'0\'',
'ID_MSG' => 'ID_MSG id_msg int(10) unsigned NOT NULL default \'0\'',
),
'log_search_messages' => array(
'ID_SEARCH' => 'ID_SEARCH id_search tinyint(3) unsigned NOT NULL default \'0\'',
'ID_MSG' => 'ID_MSG id_msg int(10) unsigned NOT NULL default \'0\'',
),
'log_search_results' => array(
'ID_SEARCH' => 'ID_SEARCH id_search tinyint(3) unsigned NOT NULL default \'0\'',
),
'log_search_subjects' => array(
'ID_TOPIC' => 'ID_TOPIC id_topic mediumint(8) unsigned NOT NULL default \'0\'',
),
'log_search_topics' => array(
'ID_SEARCH' => 'ID_SEARCH id_search tinyint(3) unsigned NOT NULL default \'0\'',
'ID_TOPIC' => 'ID_TOPIC id_topic mediumint(8) unsigned NOT NULL default \'0\'',
),
'log_subscribed' => array(
'ID_SUBLOG' => 'ID_SUBLOG id_sublog int(10) unsigned NOT NULL auto_increment',
'ID_SUBSCRIBE' => 'ID_SUBSCRIBE id_subscribe mediumint(8) unsigned NOT NULL default \'0\'',
'OLD_ID_GROUP' => 'OLD_ID_GROUP old_id_group smallint(5) NOT NULL default \'0\'',
'startTime' => 'startTime start_time int(10) NOT NULL default \'0\'',
'endTime' => 'endTime end_time int(10) NOT NULL default \'0\'',
),
'log_topics' => array(
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
'ID_MSG' => 'ID_MSG id_msg int(10) unsigned NOT NULL default \'0\'',
'ID_TOPIC' => 'ID_TOPIC id_topic mediumint(8) unsigned NOT NULL default \'0\'',
),
'mail_queue' => array(
'ID_MAIL' => 'ID_MAIL id_mail int(10) unsigned NOT NULL auto_increment',
),
'members' => array(
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL auto_increment',
'memberName' => 'memberName member_name varchar(80) NOT NULL default \'\'',
'dateRegistered' => 'dateRegistered date_registered int(10) unsigned NOT NULL default \'0\'',
'ID_GROUP' => 'ID_GROUP id_group smallint(5) unsigned NOT NULL default \'0\'',
'lastLogin' => 'lastLogin last_login int(10) unsigned NOT NULL default \'0\'',
'realName' => 'realName real_name varchar(255) NOT NULL default \'\'',
'instantMessages' => 'instantMessages instant_messages smallint(5) NOT NULL default \'0\'',
'unreadMessages' => 'unreadMessages unread_messages smallint(5) NOT NULL default \'0\'',
'messageLabels' => 'messageLabels message_labels text NOT NULL',
'emailAddress' => 'emailAddress email_address varchar(255) NOT NULL default \'\'',
'personalText' => 'personalText personal_text varchar(255) NOT NULL default \'\'',
'ICQ' => 'ICQ icq varchar(255) NOT NULL default \'\'',
'AIM' => 'AIM aim varchar(255) NOT NULL default \'\'',
'YIM' => 'YIM yim varchar(32) NOT NULL default \'\'',
'MSN' => 'MSN msn varchar(255) NOT NULL default \'\'',
'hideEmail' => 'hideEmail hide_email tinyint(4) NOT NULL default \'0\'',
'showOnline' => 'showOnline show_online tinyint(4) NOT NULL default \'1\'',
'timeFormat' => 'timeFormat time_format varchar(80) NOT NULL default \'\'',
'timeOffset' => 'timeOffset time_offset float NOT NULL default \'0\'',
'notifyAnnouncements' => 'notifyAnnouncements notify_announcements tinyint(4) NOT NULL default \'1\'',
'notifyRegularity' => 'notifyRegularity notify_regularity tinyint(4) NOT NULL default \'1\'',
'notifySendBody' => 'notifySendBody notify_send_body tinyint(4) NOT NULL default \'0\'',
'notifyTypes' => 'notifyTypes notify_types tinyint(4) NOT NULL default \'2\'',
'memberIP' => 'memberIP member_ip varchar(255) NOT NULL default \'\'',
'secretQuestion' => 'secretQuestion secret_question varchar(255) NOT NULL default \'\'',
'secretAnswer' => 'secretAnswer secret_answer varchar(64) NOT NULL default \'\'',
'ID_THEME' => 'ID_THEME id_theme tinyint(4) unsigned NOT NULL default \'0\'',
'ID_MSG_LAST_VISIT' => 'ID_MSG_LAST_VISIT id_msg_last_visit int(10) unsigned NOT NULL default \'0\'',
'additionalGroups' => 'additionalGroups additional_groups varchar(255) NOT NULL default \'\'',
'smileySet' => 'smileySet smiley_set varchar(48) NOT NULL default \'\'',
'ID_POST_GROUP' => 'ID_POST_GROUP id_post_group smallint(5) unsigned NOT NULL default \'0\'',
'totalTimeLoggedIn' => 'totalTimeLoggedIn total_time_logged_in int(10) unsigned NOT NULL default \'0\'',
'passwordSalt' => 'passwordSalt password_salt varchar(255) NOT NULL default \'\'',
'ignoreBoards' => 'ignoreBoards ignore_boards text NOT NULL',
'memberIP2' => 'memberIP2 member_ip2 varchar(255) NOT NULL default \'\'',
),
'messages' => array(
'ID_MSG' => 'ID_MSG id_msg int(10) unsigned NOT NULL auto_increment',
'ID_TOPIC' => 'ID_TOPIC id_topic mediumint(8) unsigned NOT NULL default \'0\'',
'ID_BOARD' => 'ID_BOARD id_board smallint(5) unsigned NOT NULL default \'0\'',
'posterTime' => 'posterTime poster_time int(10) unsigned NOT NULL default \'0\'',
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
'ID_MSG_MODIFIED' => 'ID_MSG_MODIFIED id_msg_modified int(10) unsigned NOT NULL default \'0\'',
'posterName' => 'posterName poster_name varchar(255) NOT NULL default \'\'',
'posterEmail' => 'posterEmail poster_email varchar(255) NOT NULL default \'\'',
'posterIP' => 'posterIP poster_ip varchar(255) NOT NULL default \'\'',
'smileysEnabled' => 'smileysEnabled smileys_enabled tinyint(4) NOT NULL default \'1\'',
'modifiedTime' => 'modifiedTime modified_time int(10) unsigned NOT NULL default \'0\'',
'modifiedName' => 'modifiedName modified_name varchar(255) NOT NULL default \'\'',
),
'membergroups' => array(
'ID_GROUP' => 'ID_GROUP id_group smallint(5) unsigned NOT NULL auto_increment',
'ID_PARENT' => 'ID_PARENT id_parent smallint(5) NOT NULL default \'-2\'',
'groupName' => 'groupName group_name varchar(80) NOT NULL default \'\'',
'onlineColor' => 'onlineColor online_color varchar(20) NOT NULL default \'\'',
'minPosts' => 'minPosts min_posts mediumint(9) NOT NULL default \'-1\'',
'maxMessages' => 'maxMessages max_messages smallint(5) unsigned NOT NULL default \'0\'',
'groupType' => 'groupType group_type tinyint(3) NOT NULL default \'0\'',
),
'message_icons' => array(
'ID_ICON' => 'ID_ICON id_icon smallint(5) unsigned NOT NULL auto_increment',
'iconOrder' => 'iconOrder icon_order smallint(5) unsigned NOT NULL default \'0\'',
'ID_BOARD' => 'ID_BOARD id_board smallint(5) unsigned NOT NULL default \'0\'',
),
'moderators' => array(
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
'ID_BOARD' => 'ID_BOARD id_board smallint(5) unsigned NOT NULL default \'0\'',
),
'package_servers' => array(
'ID_SERVER' => 'ID_SERVER id_server smallint(5) unsigned NOT NULL auto_increment',
),
'personal_messages' => array(
'ID_PM' => 'ID_PM id_pm int(10) unsigned NOT NULL auto_increment',
'ID_MEMBER_FROM' => 'ID_MEMBER_FROM id_member_from mediumint(8) unsigned NOT NULL default \'0\'',
'deletedBySender' => 'deletedBySender deleted_by_sender tinyint(3) unsigned NOT NULL default \'0\'',
'fromName' => 'fromName from_name varchar(255) NOT NULL default \'\'',
),
'permission_profiles' => array(
'ID_PROFILE' => 'ID_PROFILE id_profile smallint(5) NOT NULL auto_increment',
),
'permissions' => array(
'ID_GROUP' => 'ID_GROUP id_group smallint(5) NOT NULL default \'0\'',
'addDeny' => 'addDeny add_deny tinyint(4) NOT NULL default \'1\'',
),
'pm_recipients' => array(
'ID_PM' => 'ID_PM id_pm int(10) unsigned NOT NULL default \'0\'',
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
),
'polls' => array(
'ID_POLL' => 'ID_POLL id_poll mediumint(8) unsigned NOT NULL auto_increment',
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) unsigned NOT NULL default \'0\'',
'votingLocked' => 'votingLocked voting_locked tinyint(1) NOT NULL default \'0\'',
'maxVotes' => 'maxVotes max_votes tinyint(3) unsigned NOT NULL default \'1\'',
'expireTime' => 'expireTime expire_time int(10) unsigned NOT NULL default \'0\'',
'hideResults' => 'hideResults hide_results tinyint(3) unsigned NOT NULL default \'0\'',
'changeVote' => 'changeVote change_vote tinyint(3) unsigned NOT NULL default \'0\'',
'posterName' => 'posterName poster_name varchar(255) NOT NULL default \'\'',
),
'poll_choices' => array(
'ID_CHOICE' => 'ID_CHOICE id_choice tinyint(3) unsigned NOT NULL default \'0\'',
'ID_POLL' => 'ID_POLL id_poll mediumint(8) unsigned NOT NULL default \'0\'',
),
'scheduled_tasks' => array(
'ID_TASK' => 'ID_TASK id_task smallint(5) NOT NULL auto_increment',
'nextTime' => 'nextTime next_time int(10) NOT NULL default \'0\'',
'timeRegularity' => 'timeRegularity time_regularity smallint(5) NOT NULL default \'0\'',
'timeOffset' => 'timeOffset time_offset int(10) NOT NULL default \'0\'',
'timeUnit' => 'timeUnit time_unit varchar(1) NOT NULL default \'h\'',
),
'smileys' => array(
'ID_SMILEY' => 'ID_SMILEY id_smiley smallint(5) unsigned NOT NULL auto_increment',
'smileyRow' => 'smileyRow smiley_row tinyint(4) unsigned NOT NULL default \'0\'',
'smileyOrder' => 'smileyOrder smiley_order smallint(5) unsigned NOT NULL default \'0\'',
),
'subscriptions' => array(
'ID_SUBSCRIBE' => 'ID_SUBSCRIBE id_subscribe mediumint(8) unsigned NOT NULL auto_increment',
'ID_GROUP' => 'ID_GROUP id_group smallint(5) NOT NULL default \'0\'',
'addGroups' => 'addGroups add_groups varchar(40) NOT NULL default \'\'',
'allowPartial' => 'allowPartial allow_partial tinyint(3) NOT NULL default \'0\'',
),
'themes' => array(
'ID_MEMBER' => 'ID_MEMBER id_member mediumint(8) NOT NULL default \'0\'',
'ID_THEME' => 'ID_THEME id_theme tinyint(4) unsigned NOT NULL default \'1\'',
),
'topics' => array(
'ID_TOPIC' => 'ID_TOPIC id_topic mediumint(8) unsigned NOT NULL auto_increment',
'isSticky' => 'isSticky is_sticky tinyint(4) NOT NULL default \'0\'',
'ID_BOARD' => 'ID_BOARD id_board smallint(5) unsigned NOT NULL default \'0\'',
'ID_FIRST_MSG' => 'ID_FIRST_MSG id_first_msg int(10) unsigned NOT NULL default \'0\'',
'ID_LAST_MSG' => 'ID_LAST_MSG id_last_msg int(10) unsigned NOT NULL default \'0\'',
'ID_MEMBER_STARTED' => 'ID_MEMBER_STARTED id_member_started mediumint(8) unsigned NOT NULL default \'0\'',
'ID_MEMBER_UPDATED' => 'ID_MEMBER_UPDATED id_member_updated mediumint(8) unsigned NOT NULL default \'0\'',
'ID_POLL' => 'ID_POLL id_poll mediumint(8) unsigned NOT NULL default \'0\'',
'numReplies' => 'numReplies num_replies int(10) unsigned NOT NULL default \'0\'',
'numViews' => 'numViews num_views int(10) unsigned NOT NULL default \'0\'',
'unapprovedPosts' => 'unapprovedPosts unapproved_posts smallint(5) NOT NULL default \'0\'',
),
);
$_GET['ren_col'] = isset($_GET['ren_col']) ? (int) $_GET['ren_col'] : 0;
$step_progress['name'] = 'Renaming columns';
$step_progress['current'] = $_GET['ren_col'];
$step_progress['total'] = count($nameChanges);
$count = 0;
// Now do every table...
foreach ($nameChanges as $table_name => $table)
{
// Already done this?
$count++;
if ($_GET['ren_col'] > $count)
continue;
$_GET['ren_col'] = $count;
// Check the table exists!
$request = upgrade_query("
SHOW TABLES
LIKE '{$db_prefix}$table_name'");
if (mysql_num_rows($request) == 0)
{
mysql_free_result($request);
continue;
}
mysql_free_result($request);
// Check each column!
$actualChanges = array();
foreach ($table as $colname => $coldef)
{
$change = array(
'table' => $table_name,
'name' => $colname,
'type' => 'column',
'method' => 'change_remove',
'text' => 'CHANGE ' . $coldef,
);
// Check if this change may need a special edit.
checkChange($change);
if (protected_alter($change, $substep, true) == false)
$actualChanges[] = ' CHANGE COLUMN ' . $coldef;
}
// Do the query - if it needs doing.
if (!empty($actualChanges))
{
$change = array(
'table' => $table_name,
'name' => 'na',
'type' => 'table',
'method' => 'full_change',
'text' => implode(', ', $actualChanges),
);
// Here we go - hold on!
protected_alter($change, $substep);
}
// Update where we are!
$step_progress['current'] = $_GET['ren_col'];
}
// All done!
unset($_GET['ren_col']);
---}
---#
---# Converting "log_online".
DROP TABLE IF EXISTS {$db_prefix}log_online;
CREATE TABLE {$db_prefix}log_online (
session varchar(32) NOT NULL default '',
log_time int(10) NOT NULL default '0',
id_member mediumint(8) unsigned NOT NULL default '0',
id_spider smallint(5) unsigned NOT NULL default '0',
ip int(10) unsigned NOT NULL default '0',
url text NOT NULL,
PRIMARY KEY (session),
KEY log_time (log_time),
KEY id_member (id_member)
) ENGINE=MyISAM{$db_collation};
---#
/******************************************************************************/
--- Adding new board specific features.
/******************************************************************************/
---# Implementing board redirects.
ALTER TABLE {$db_prefix}boards
ADD COLUMN redirect varchar(255) NOT NULL default '';
---#
/******************************************************************************/
--- Adding search engine tracking.
/******************************************************************************/
---# Creating spider table.
CREATE TABLE IF NOT EXISTS {$db_prefix}spiders (
id_spider smallint(5) unsigned NOT NULL auto_increment,
spider_name varchar(255) NOT NULL default '',
user_agent varchar(255) NOT NULL default '',
ip_info varchar(255) NOT NULL default '',
PRIMARY KEY id_spider(id_spider)
) ENGINE=MyISAM{$db_collation};
INSERT IGNORE INTO {$db_prefix}spiders
(id_spider, spider_name, user_agent, ip_info)
VALUES
(1, 'Google', 'googlebot', ''),
(2, 'Yahoo!', 'slurp', ''),
(3, 'MSN', 'msnbot', ''),
(4, 'Google (Mobile)', 'Googlebot-Mobile', ''),
(5, 'Google (Image)', 'Googlebot-Image', ''),
(6, 'Google (AdSense)', 'Mediapartners-Google', ''),
(7, 'Google (Adwords)', 'AdsBot-Google', ''),
(8, 'Yahoo! (Mobile)', 'YahooSeeker/M1A1-R2D2', ''),
(9, 'Yahoo! (Image)', 'Yahoo-MMCrawler', ''),
(10, 'MSN (Mobile)', 'MSNBOT_Mobile', ''),
(11, 'MSN (Media)', 'msnbot-media', ''),
(12, 'Cuil', 'twiceler', ''),
(13, 'Ask', 'Teoma', ''),
(14, 'Baidu', 'Baiduspider', ''),
(15, 'Gigablast', 'Gigabot', ''),
(16, 'InternetArchive', 'ia_archiver-web.archive.org', ''),
(17, 'Alexa', 'ia_archiver', ''),
(18, 'Omgili', 'omgilibot', ''),
(19, 'EntireWeb', 'Speedy Spider', '');
---#
---# Removing a spider.
---{
upgrade_query("
DELETE FROM {$db_prefix}spiders
WHERE user_agent = 'yahoo'
AND spider_name = 'Yahoo! (Publisher)'
");
---}
---#
---# Creating spider hit tracking table.
CREATE TABLE IF NOT EXISTS {$db_prefix}log_spider_hits (
id_hit int(10) unsigned NOT NULL auto_increment,
id_spider smallint(5) unsigned NOT NULL default '0',
log_time int(10) unsigned NOT NULL default '0',
url varchar(255) NOT NULL default '',
processed tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (id_hit),
KEY id_spider(id_spider),
KEY log_time(log_time),
KEY processed (processed)
) ENGINE=MyISAM{$db_collation};
---#
---# Making some changes to spider hit table...
ALTER TABLE {$db_prefix}log_spider_hits
ADD COLUMN id_hit int(10) unsigned NOT NULL auto_increment,
ADD PRIMARY KEY (id_hit);
---#
---# Creating spider statistic table.
CREATE TABLE IF NOT EXISTS {$db_prefix}log_spider_stats (
id_spider smallint(5) unsigned NOT NULL default '0',
page_hits smallint(5) unsigned NOT NULL default '0',
last_seen int(10) unsigned NOT NULL default '0',
stat_date date NOT NULL default '0001-01-01',
PRIMARY KEY (stat_date, id_spider)
) ENGINE=MyISAM{$db_collation};
---#
/******************************************************************************/
--- Adding new forum settings.
/******************************************************************************/
---# Resetting settings_updated.
REPLACE INTO {$db_prefix}settings
(variable, value)
VALUES
('settings_updated', '0'),
('last_mod_report_action', '0'),
('search_floodcontrol_time', '5'),
('next_task_time', UNIX_TIMESTAMP());
---#
---# Changing stats settings.
---{
$request = upgrade_query("
SELECT value
FROM {$db_prefix}themes
WHERE variable = 'show_sp1_info'");
if (mysql_num_rows($request) != 0)
{
upgrade_query("
DELETE FROM {$db_prefix}themes
WHERE variable = 'show_stats_index'");
upgrade_query("
UPDATE {$db_prefix}themes
SET variable = 'show_stats_index'
WHERE variable = 'show_sp1_info'");
}
upgrade_query("
DELETE FROM {$db_prefix}themes
WHERE variable = 'show_sp1_info'");
---}
---#
---# Enable cache if upgrading from 1.1 and lower.
---{
if (isset($modSettings['smfVersion']) && $modSettings['smfVersion'] <= '2.0 Beta 1')
{
$request = upgrade_query("
SELECT value
FROM {$db_prefix}settings
WHERE variable = 'cache_enable'");
list ($cache_enable) = $smcFunc['db_fetch_row']($request);
// No cache before 1.1.
if ($smcFunc['db_num_rows']($request) == 0)
upgrade_query("
INSERT INTO {$db_prefix}settings
(variable, value)
VALUES ('cache_enable', '1')");
elseif (empty($cache_enable))
upgrade_query("
UPDATE {$db_prefix}settings
SET value = '1'
WHERE variable = 'cache_enable'");
}
---}
---#
---# Changing visual verification setting.
---{
$request = upgrade_query("
SELECT value
FROM {$db_prefix}settings
WHERE variable = 'disable_visual_verification'");
if (mysql_num_rows($request) != 0)
{
list ($oldValue) = mysql_fetch_row($request);
if ($oldValue != 0)
{
// We have changed the medium setting from SMF 1.1.2.
if ($oldValue == 4)
$oldValue = 5;
upgrade_query("
UPDATE {$db_prefix}settings
SET variable = 'visual_verification_type', value = $oldValue
WHERE variable = 'disable_visual_verification'");
}
}
upgrade_query("
DELETE FROM {$db_prefix}settings
WHERE variable = 'disable_visual_verification'");
---}
---#
---# Changing visual verification setting, again.
---{
$request = upgrade_query("
SELECT value
FROM {$db_prefix}settings
WHERE variable = 'reg_verification'");
if (mysql_num_rows($request) == 0)
{
// Upgrade visual verification again!
if (!empty($modSettings['visual_verification_type']))
{
upgrade_query("
UPDATE {$db_prefix}settings
SET value = value - 1
WHERE variable = 'visual_verification_type'");
$modSettings['visual_verification_type']--;
}
// Never set?
elseif (!isset($modSettings['visual_verification_type']))
{
upgrade_query("
INSERT INTO {$db_prefix}settings
(variable, value)
VALUES
('visual_verification_type', '3')");
$modSettings['visual_verification_type'] = 3;
}
upgrade_query("
INSERT INTO {$db_prefix}settings
(variable, value)
VALUES
('reg_verification', '" . (!empty($modSettings['visual_verification_type']) ? 1 : 0) . "')");
}
---}
---#
---# Changing default personal text setting.
UPDATE {$db_prefix}settings
SET variable = 'default_personal_text'
WHERE variable = 'default_personalText';
DELETE FROM {$db_prefix}settings
WHERE variable = 'default_personalText';
---#
---# Removing allow hide email setting.
DELETE FROM {$db_prefix}settings
WHERE variable = 'allow_hideEmail'
OR variable = 'allow_hide_email';
---#
---# Ensuring stats index setting present...
INSERT IGNORE INTO {$db_prefix}themes
(id_theme, variable, value)
VALUES
(1, 'show_stats_index', '0');
---#
---# Ensuring forum width setting present...
INSERT IGNORE INTO {$db_prefix}themes
(id_theme, variable, value)
VALUES
(1, 'forum_width', '90%');
---#
---# Replacing old calendar settings...
---{
// Only try it if one of the "new" settings doesn't yet exist.
if (!isset($modSettings['cal_showholidays']) || !isset($modSettings['cal_showbdays']) || !isset($modSettings['cal_showevents']))
{
// Default to just the calendar setting.
$modSettings['cal_showholidays'] = empty($modSettings['cal_showholidaysoncalendar']) ? 0 : 1;
$modSettings['cal_showbdays'] = empty($modSettings['cal_showbdaysoncalendar']) ? 0 : 1;
$modSettings['cal_showevents'] = empty($modSettings['cal_showeventsoncalendar']) ? 0 : 1;
// Then take into account board index.
if (!empty($modSettings['cal_showholidaysonindex']))
$modSettings['cal_showholidays'] = $modSettings['cal_showholidays'] === 1 ? 2 : 3;
if (!empty($modSettings['cal_showbdaysonindex']))
$modSettings['cal_showbdays'] = $modSettings['cal_showbdays'] === 1 ? 2 : 3;
if (!empty($modSettings['cal_showeventsonindex']))
$modSettings['cal_showevents'] = $modSettings['cal_showevents'] === 1 ? 2 : 3;
// Actually save the settings.
upgrade_query("
INSERT IGNORE INTO {$db_prefix}settings
(variable, value)
VALUES
('cal_showholidays', $modSettings[cal_showholidays]),
('cal_showbdays', $modSettings[cal_showbdays]),
('cal_showevents', $modSettings[cal_showevents])");
}
---}
---#
---# Deleting old calendar settings...
DELETE FROM {$db_prefix}settings
WHERE VARIABLE IN ('cal_showholidaysonindex', 'cal_showbdaysonindex', 'cal_showeventsonindex',
'cal_showholidaysoncalendar', 'cal_showbdaysoncalendar', 'cal_showeventsoncalendar',
'cal_holidaycolor', 'cal_bdaycolor', 'cal_eventcolor');
---#
---# Adjusting calendar maximum year...
---{
if (!isset($modSettings['cal_maxyear']) || $modSettings['cal_maxyear'] == '2010')
{
upgrade_query("
REPLACE INTO {$db_prefix}settings
(variable, value)
VALUES
('cal_maxyear', '2020')");
}
---}
---#
---# Adding advanced signature settings...
---{
if (empty($modSettings['signature_settings']))
{
if (isset($modSettings['max_signatureLength']))
$modSettings['signature_settings'] = '1,' . $modSettings['max_signatureLength'] . ',0,0,0,0,0,0:';
else
$modSettings['signature_settings'] = '1,300,0,0,0,0,0,0:';
upgrade_query("
INSERT IGNORE INTO {$db_prefix}settings
(variable, value)
VALUES
('signature_settings', '$modSettings[signature_settings]')");
upgrade_query("
DELETE FROM {$db_prefix}settings
WHERE variable = 'max_signatureLength'");
}
---}
---#
---# Updating spam protection settings.
---{
if (empty($modSettings['pm_spam_settings']))
{
if (isset($modSettings['max_pm_recipients']))
$modSettings['pm_spam_settings'] = $modSettings['max_pm_recipients'] . ',5,20';
else
$modSettings['pm_spam_settings'] = '10,5,20';
}
elseif (substr_count($modSettings['pm_spam_settings'], ',') == 1)
{
$modSettings['pm_spam_settings'] .= ',20';
}
upgrade_query("
INSERT IGNORE INTO {$db_prefix}settings
(variable, value)
VALUES
('pm_spam_settings', '$modSettings[pm_spam_settings]')");
upgrade_query("
DELETE FROM {$db_prefix}settings
WHERE variable = 'max_pm_recipients'");
---}
---#
---# Adjusting timezone settings...
---{
if (!isset($modSettings['default_timezone']) && function_exists('date_default_timezone_set'))
{
$server_offset = mktime(0, 0, 0, 1, 1, 1970);
$timezone_id = 'Etc/GMT' . ($server_offset > 0 ? '+' : '') . ($server_offset / 3600);
if (date_default_timezone_set($timezone_id))
upgrade_query("
REPLACE INTO {$db_prefix}settings
(variable, value)
VALUES
('default_timezone', '$timezone_id')");
}
---}
---#
---# Checking theme layers are correct for default themes.
---{
$request = upgrade_query("
SELECT id_theme, value, variable
FROM {$db_prefix}themes
WHERE variable = 'theme_layers'
OR variable = 'theme_dir'");
$themeLayerChanges = array();
while ($row = mysql_fetch_assoc($request))
{
$themeLayerChanges[$row['id_theme']][$row['variable']] = $row['value'];
}
mysql_free_result($request);
foreach ($themeLayerChanges as $id_theme => $data)
{
// Has to be a SMF provided theme and have custom layers defined.
if (!isset($data['theme_layers']) || !isset($data['theme_dir']) || !in_array(substr($data['theme_dir'], -7), array('default', 'babylon', 'classic')))
continue;
$layers = explode(',', $data['theme_layers']);
foreach ($layers as $k => $v)
if ($v == 'main')
{
$layers[$k] = 'html,body';
upgrade_query("
UPDATE {$db_prefix}themes
SET value = '" . implode(',', $layers) . "'
WHERE id_theme = $id_theme
AND variable = 'theme_layers'");
break;
}
}
---}
---#
---# Adding index to log_notify table...
ALTER TABLE {$db_prefix}log_notify
ADD INDEX id_topic (id_topic, id_member);
---#
/******************************************************************************/
--- Adding custom profile fields.
/******************************************************************************/
---# Creating "custom_fields" table...
CREATE TABLE IF NOT EXISTS {$db_prefix}custom_fields (
id_field smallint(5) NOT NULL auto_increment,
col_name varchar(12) NOT NULL default '',
field_name varchar(40) NOT NULL default '',
field_desc varchar(255) NOT NULL default '',
field_type varchar(8) NOT NULL default 'text',
field_length smallint(5) NOT NULL default '255',
field_options text NOT NULL,
mask varchar(255) NOT NULL default '',
show_reg tinyint(3) NOT NULL default '0',
show_display tinyint(3) NOT NULL default '0',
show_profile varchar(20) NOT NULL default 'forumprofile',
private tinyint(3) NOT NULL default '0',
active tinyint(3) NOT NULL default '1',
bbc tinyint(3) NOT NULL default '0',
default_value varchar(255) NOT NULL default '',
PRIMARY KEY (id_field),
UNIQUE col_name (col_name)
) ENGINE=MyISAM{$db_collation};
---#
---# Adding search ability to custom fields.
ALTER TABLE {$db_prefix}custom_fields
ADD COLUMN can_search tinyint(3) NOT NULL default '0' AFTER bbc;
---#
---# Fixing default value field length.
ALTER TABLE {$db_prefix}custom_fields
CHANGE COLUMN default_value default_value varchar(255) NOT NULL default '';
---#
---# Enhancing privacy settings for custom fields.
---{
if (isset($modSettings['smfVersion']) && $modSettings['smfVersion'] <= '2.0 Beta 1')
{
upgrade_query("
UPDATE {$db_prefix}custom_fields
SET private = 2
WHERE private = 1");
}
if (isset($modSettings['smfVersion']) && $modSettings['smfVersion'] < '2.0 Beta 4')
{
upgrade_query("
UPDATE {$db_prefix}custom_fields
SET private = 3
WHERE private = 2");
}
---}
---#
---# Checking display fields setup correctly..
---{
if (isset($modSettings['smfVersion']) && $modSettings['smfVersion'] <= '2.0 Beta 1' && isset($modSettings['displayFields']) && @unserialize($modSettings['displayFields']) == false)
{
$request = upgrade_query("
SELECT col_name, field_name, bbc
FROM {$db_prefix}custom_fields
WHERE show_display = 1
AND active = 1
AND private != 2");
$fields = array();
while ($row = mysql_fetch_assoc($request))
{
$fields[] = array(
'c' => strtr($row['col_name'], array('|' => '', ';' => '')),
'f' => strtr($row['field_name'], array('|' => '', ';' => '')),
'b' => ($row['bbc'] ? '1' : '0')
);
}
mysql_free_result($request);
upgrade_query("
UPDATE {$db_prefix}settings
SET value = '" . mysql_real_escape_string(serialize($fields)) . "'
WHERE variable = 'displayFields'");
}
---}
---#
---# Adding new custom fields columns.
ALTER TABLE {$db_prefix}custom_fields
ADD enclose text NOT NULL;
ALTER TABLE {$db_prefix}custom_fields
ADD placement tinyint(3) NOT NULL default '0';
---#
/******************************************************************************/
--- Adding email digest functionality.
/******************************************************************************/
---# Creating "log_digest" table...
CREATE TABLE IF NOT EXISTS {$db_prefix}log_digest (
id_topic mediumint(8) unsigned NOT NULL default '0',
id_msg int(10) unsigned NOT NULL default '0',
note_type varchar(10) NOT NULL default 'post',
daily tinyint(3) unsigned NOT NULL default '0',
exclude mediumint(8) unsigned NOT NULL default '0'
) ENGINE=MyISAM{$db_collation};
---#
---# Adding digest option to "members" table...
ALTER TABLE {$db_prefix}members
CHANGE COLUMN notifyOnce notify_regularity tinyint(4) unsigned NOT NULL default '1';
---#
/******************************************************************************/
--- Making changes to the package manager.
/******************************************************************************/
---# Creating "log_packages" table...
CREATE TABLE IF NOT EXISTS {$db_prefix}log_packages (
id_install int(10) NOT NULL auto_increment,
filename varchar(255) NOT NULL default '',
package_id varchar(255) NOT NULL default '',
name varchar(255) NOT NULL default '',
version varchar(255) NOT NULL default '',
id_member_installed mediumint(8) NOT NULL default '0',
member_installed varchar(255) NOT NULL default '',
time_installed int(10) NOT NULL default '0',
id_member_removed mediumint(8) NOT NULL default '0',
member_removed varchar(255) NOT NULL default '',
time_removed int(10) NOT NULL default '0',
install_state tinyint(3) NOT NULL default '1',
failed_steps text NOT NULL,
themes_installed varchar(255) NOT NULL default '',
db_changes text NOT NULL,
PRIMARY KEY (id_install),
KEY filename (filename(15))
) ENGINE=MyISAM{$db_collation};
---#
---# Adding extra "log_packages" columns...
ALTER TABLE {$db_prefix}log_packages
ADD db_changes text NOT NULL AFTER themes_installed;
---#
---# Changing URL to SMF package server...
UPDATE {$db_prefix}package_servers
SET url = 'http://custom.simplemachines.org/packages/mods'
WHERE url = 'http://mods.simplemachines.org';
---#
/******************************************************************************/
--- Creating mail queue functionality.
/******************************************************************************/
---# Creating "mail_queue" table...
CREATE TABLE IF NOT EXISTS {$db_prefix}mail_queue (
id_mail int(10) unsigned NOT NULL auto_increment,
time_sent int(10) NOT NULL default '0',
recipient varchar(255) NOT NULL default '',
body text NOT NULL,
subject varchar(255) NOT NULL default '',
headers text NOT NULL,
send_html tinyint(3) NOT NULL default '0',
priority tinyint(3) NOT NULL default '1',
PRIMARY KEY (id_mail),
KEY time_sent (time_sent),
KEY mail_priority (priority, id_mail)
) ENGINE=MyISAM{$db_collation};
---#
---# Adding new mail queue settings...
---{
if (!isset($modSettings['mail_next_send']))
{
upgrade_query("
INSERT INTO {$db_prefix}settings
(variable, value)