diff --git a/README.en.md b/README.en.md index 77081c6..591c52b 100644 --- a/README.en.md +++ b/README.en.md @@ -14,41 +14,5 @@ Currently, the tutorial for deploying is only available in Chinese. It's [部署 Join QQ group [565280992](https://jq.qq.com/?_wv=1027&k=5JQZWwd) or Telegram group [@lojdev](https://t.me/lojdev) for help. # Upgrading -Because of updates to the database structure, users who upgrade from a commit BEFORE [d5bcbe8fb79e80f9d603b764ac787295cceffa34](https://github.com/syzoj/syzoj/commit/d5bcbe8fb79e80f9d603b764ac787295cceffa34) (Feb 21, 2018) **MUST** perform the following SQL on the database. +Currently, the tutorial for upgrading is only available in Chinese. It's [更新指南](https://github.com/syzoj/syzoj/wiki/%E6%9B%B4%E6%96%B0%E6%8C%87%E5%8D%97) in this project's wiki. -```sql -ALTER TABLE `judge_state` ADD `is_public` TINYINT(1) NOT NULL AFTER `compilation`; -UPDATE `judge_state` JOIN `problem` ON `problem`.`id` = `judge_state`.`problem_id` SET `judge_state`.`is_public` = `problem`.`is_public`; -ALTER TABLE `syzoj`.`judge_state` ADD INDEX `judge_state_is_public` (`id`, `is_public`, `type_info`, `type`); -``` - -Who upgrade from a commit BEFORE [26d66ceef24fbb35481317453bcb89ead6c69076](https://github.com/syzoj/syzoj/commit/26d66ceef24fbb35481317453bcb89ead6c69076) (Nov 5, 2018) **MUST** perform the following SQL on the database. - -```sql -ALTER TABLE `contest_player` CHANGE `score_details` `score_details` JSON NOT NULL; -ALTER TABLE `contest_ranklist` CHANGE `ranking_params` `ranking_params` JSON NOT NULL; -ALTER TABLE `contest_ranklist` CHANGE `ranklist` `ranklist` JSON NOT NULL; -ALTER TABLE `custom_test` CHANGE `result` `result` JSON NOT NULL; -ALTER TABLE `judge_state` CHANGE `compilation` `compilation` JSON NOT NULL; -ALTER TABLE `judge_state` CHANGE `result` `result` JSON NOT NULL; -``` - -Who upgraded from a commit BEFORE [84b9e2d7b51e4ed3ab426621b66cf5ae9e1e1c23](https://github.com/syzoj/syzoj/commit/84b9e2d7b51e4ed3ab426621b66cf5ae9e1e1c23) (Nov 6, 2018) **MUST** perform the following SQL on the database. - -```sql -ALTER TABLE `problem` ADD `publicize_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `type`; -``` - -Who upgraded from a commit BEFORE [d8be150fc6b8c43af61c5e4aca4fc0fe0445aef3](https://github.com/syzoj/syzoj/commit/d8be150fc6b8c43af61c5e4aca4fc0fe0445aef3) (Dec 7, 2018) **MUST** perform the following SQL on the database. - -```sql -ALTER TABLE `user` ADD `prefer_formatted_code` TINYINT(1) NOT NULL DEFAULT 1 AFTER `public_email`; -``` - -To make code formatting work, `clang-format` needs to be installed. [migrates/format-old-codes.js](migrates/format-old-codes.js) may help formating old submissions' codes. - -Who upgraded from a commit BEFORE [c192e8001ac81cab132ae033b39f09a094587633](https://github.com/syzoj/syzoj/commit/c192e8001ac81cab132ae033b39f09a094587633) (Mar 23, 2019) **MUST** install `redis-server` and [pygments](http://pygments.org/) on the web server. Markdown contents may be broken by switching to new renderer, [migrates/html-table-merge-cell-to-md.js](migrates/html-table-merge-cell-to-md.js) may help the migration。 - -Who upgraded from a commit BEFORE [7b03706821c604f59fe8263286203d57d634c421](https://github.com/syzoj/syzoj/commit/7b03706821c604f59fe8263286203d57d634c421) (Mar 27, 2019) **MUST** add `RemainAfterExit=yes` to the systemd config file `syzoj-web.service`'s `[Service]` section to make sure that restart service can work properly. - -Who upgraded from a commit BEFORE [d1d019383e5cb0c96ed2191f900970654e4055c0](https://github.com/syzoj/syzoj/commit/d1d019383e5cb0c96ed2191f900970654e4055c0) (Mar 30, 2019) **MUST** upgrade web server's Redis to at least version 5, and fill web config's `judge_token` with random key. Judge server must be upgraded together, and `daemon-config.json`'s `ServerUrl` and `ServerToken` (= `judge_token`) must be filled. If judge and web run on different server, it's recommend to move RabbitMQ to judge server. diff --git a/README.md b/README.md index 8c12001..27b4db7 100644 --- a/README.md +++ b/README.md @@ -14,41 +14,4 @@ 加入 QQ 群 [565280992](https://jq.qq.com/?_wv=1027&k=5JQZWwd) 或 Telegram 群 [@lojdev](https://t.me/lojdev) 以取得帮助。 # 升级须知 -因为一些数据库结构的更新,从该 commit [d5bcbe8fb79e80f9d603b764ac787295cceffa34](https://github.com/syzoj/syzoj/commit/d5bcbe8fb79e80f9d603b764ac787295cceffa34)(2018 年 4 月 21 日)前更新的用户**必须**在其数据库上执行以下 SQL 语句。 - -```sql -ALTER TABLE `judge_state` ADD `is_public` TINYINT(1) NOT NULL AFTER `compilation`; -UPDATE `judge_state` JOIN `problem` ON `problem`.`id` = `judge_state`.`problem_id` SET `judge_state`.`is_public` = `problem`.`is_public`; -ALTER TABLE `syzoj`.`judge_state` ADD INDEX `judge_state_is_public` (`id`, `is_public`, `type_info`, `type`); -``` - -从该 commit [26d66ceef24fbb35481317453bcb89ead6c69076](https://github.com/syzoj/syzoj/commit/26d66ceef24fbb35481317453bcb89ead6c69076)(2018 年 11 月 5 日)前更新的用户**必须**在其数据库上执行以下 SQL 语句。 - -```sql -ALTER TABLE `contest_player` CHANGE `score_details` `score_details` JSON NOT NULL; -ALTER TABLE `contest_ranklist` CHANGE `ranking_params` `ranking_params` JSON NOT NULL; -ALTER TABLE `contest_ranklist` CHANGE `ranklist` `ranklist` JSON NOT NULL; -ALTER TABLE `custom_test` CHANGE `result` `result` JSON NOT NULL; -ALTER TABLE `judge_state` CHANGE `compilation` `compilation` JSON NOT NULL; -ALTER TABLE `judge_state` CHANGE `result` `result` JSON NOT NULL; -``` - -从该 commit [84b9e2d7b51e4ed3ab426621b66cf5ae9e1e1c23](https://github.com/syzoj/syzoj/commit/84b9e2d7b51e4ed3ab426621b66cf5ae9e1e1c23)(2018 年 11 月 6 日)前更新的用户**必须**在其数据库上执行以下 SQL 语句。 - -```sql -ALTER TABLE `problem` ADD `publicize_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `type`; -``` - -从该 commit [d8be150fc6b8c43af61c5e4aca4fc0fe0445aef3](https://github.com/syzoj/syzoj/commit/d8be150fc6b8c43af61c5e4aca4fc0fe0445aef3)(2018 年 12 月 7 日)前更新的用户**必须**在其数据库上执行以下 SQL 语句。 - -```sql -ALTER TABLE `user` ADD `prefer_formatted_code` TINYINT(1) NOT NULL DEFAULT 1 AFTER `public_email`; -``` - -为使代码格式化功能正常工作,`clang-format` 需要被安装。[migrates/format-old-codes.js](migrates/format-old-codes.js) 可能对格式化旧提交记录的代码有帮助。 - -从该 commit [c192e8001ac81cab132ae033b39f09a094587633](https://github.com/syzoj/syzoj/commit/c192e8001ac81cab132ae033b39f09a094587633)(2019 年 3 月 23 日)前更新的用户**必须**在网站服务器上安装 `redis-server` 与 [pygments](http://pygments.org/)。旧的 Markdown 内容可能因切换到新渲染器被破坏,[migrates/html-table-merge-cell-to-md.js](migrates/html-table-merge-cell-to-md.js) 可能对迁移有所帮助。 - -从该 commit [7b03706821c604f59fe8263286203d57d634c421](https://github.com/syzoj/syzoj/commit/7b03706821c604f59fe8263286203d57d634c421)(2019 年 3 月 27 日)前更新的用户**必须**在其 systemd 配置文件 `syzoj-web.service` 中的 `[Service]` 中加入一行 `RemainAfterExit=yes`,以使得重启服务功能正常工作。 - -从该 commit [d1d019383e5cb0c96ed2191f900970654e4055c0](https://github.com/syzoj/syzoj/commit/d1d019383e5cb0c96ed2191f900970654e4055c0)(2019 年 3 月 30 日)前更新的用户**必须**将网站服务器上的 Redis 更新到 5 或更高版本,并填写网站配置中的 `judge_token` 为随机密钥。评测端需要被同步更新,并填写 `daemon-config.json` 中的 `ServerUrl` 和 `ServerToken`(需要与 `judge_token` 相同)。如果评测端与网站在不同的服务器上,建议迁移 RabbitMQ 到评测服务器上。 +见本项目 Wiki 中的 [更新指南](https://github.com/syzoj/syzoj/wiki/%E6%9B%B4%E6%96%B0%E6%8C%87%E5%8D%97)。