-
Notifications
You must be signed in to change notification settings - Fork 9
/
update.php
47 lines (38 loc) · 2.76 KB
/
update.php
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
<?php
include_once '/sys/boot.php';
include '/sys/settings/acl_rules.php';
// convert section tables
$Register['DB']->query("RENAME TABLE `news_sections` TO `news_categories`");
$Register['DB']->query("RENAME TABLE `foto_sections` TO `foto_categories`");
$Register['DB']->query("RENAME TABLE `loads_sections` TO `loads_categories`");
$Register['DB']->query("RENAME TABLE `stat_sections` TO `stat_categories`");
// Add cyrillic support
$Register['DB']->query("ALTER TABLE news ADD clean_url_title VARCHAR(255) DEFAULT '' NOT NULL");
$Register['DB']->query("ALTER TABLE stat ADD clean_url_title VARCHAR(255) DEFAULT '' NOT NULL");
$Register['DB']->query("ALTER TABLE loads ADD clean_url_title VARCHAR(255) DEFAULT '' NOT NULL");
$Register['DB']->query("ALTER TABLE themes ADD clean_url_title VARCHAR(255) DEFAULT '' NOT NULL");
$Register['DB']->query("ALTER TABLE foto ADD clean_url_title VARCHAR(255) DEFAULT '' NOT NULL");
// Update users
$Register['DB']->query("ALTER TABLE `users` ADD `first_name` VARCHAR(32) character set utf8 NOT NULL default ''");
$Register['DB']->query("ALTER TABLE `users` ADD `last_name` VARCHAR(32) character set utf8 NOT NULL default ''");
// Add indexes
$Register['DB']->query("ALTER TABLE `forums` ADD INDEX (`in_cat`)");
$Register['DB']->query("ALTER TABLE `loads` ADD INDEX (`category_id`, `author_id`)");
$Register['DB']->query("ALTER TABLE `foto` ADD INDEX (`category_id`, `author_id`)");
$Register['DB']->query("ALTER TABLE `news` ADD INDEX (`category_id`, `author_id`)");
$Register['DB']->query("ALTER TABLE `stat` ADD INDEX (`category_id`, `author_id`)");
$Register['DB']->query("ALTER TABLE `comments` ADD INDEX (`entity_id`, `user_id`)");
$Register['DB']->query("ALTER TABLE `messages` ADD INDEX (`to_user`, `from_user`)");
$Register['DB']->query("ALTER TABLE `posts` ADD INDEX (`id_theme`)");
$Register['DB']->query("ALTER TABLE `themes` ADD INDEX (`id_forum`)");
$Register['DB']->query("ALTER TABLE `users_votes` ADD INDEX (`from_user`, `to_user`)");
$Register['DB']->query("ALTER TABLE `loads_add_content` ADD INDEX (`field_id`, `entity_id`)");
$Register['DB']->query("ALTER TABLE `news_add_content` ADD INDEX (`field_id`, `entity_id`)");
$Register['DB']->query("ALTER TABLE `stat_add_content` ADD INDEX (`field_id`, `entity_id`)");
$Register['DB']->query("ALTER TABLE `users_add_content` ADD INDEX (`field_id`, `entity_id`)");
$Register['DB']->query("ALTER TABLE `users_warnings` ADD INDEX (`user_id`, `admin_id`)");
$Register['DB']->query("ALTER TABLE `loads_attaches` ADD INDEX (`user_id`)");
$Register['DB']->query("ALTER TABLE `news_attaches` ADD INDEX (`user_id`)");
$Register['DB']->query("ALTER TABLE `stat_attaches` ADD INDEX (`user_id`)");
$Register['DB']->query("ALTER TABLE `forum_attaches` ADD INDEX (`post_id`, `user_id`)");
die(__('Operation is successful'));