Browse Source

Drop SQLite support

master
Menci 6 years ago
parent
commit
6336e281f9
  1. 4
      README.en.md
  2. 4
      README.md
  3. 3
      app.js
  4. 8
      config-example.json
  5. 1
      package.json

4
README.en.md

@ -16,7 +16,7 @@ UPDATE `judge_state` JOIN `problem` ON `problem`.`id` = `judge_state`.`problem_i
ALTER TABLE `syzoj`.`judge_state` ADD INDEX `judge_state_is_public` (`id`, `is_public`, `type_info`, `type`); 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) and not using SQLite **MUST** perform the following SQL on the database. 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 ```sql
ALTER TABLE contest_player CHANGE score_details score_details JSON NOT NULL; ALTER TABLE contest_player CHANGE score_details score_details JSON NOT NULL;
@ -27,7 +27,7 @@ ALTER TABLE judge_state CHANGE compilation compilation JSON NOT NULL;
ALTER TABLE judge_state CHANGE result result 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. **Notice**: This SQL haven't been tested on a non-MySQL database. 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 ```sql
ALTER TABLE `problem` ADD `publicize_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `type`; ALTER TABLE `problem` ADD `publicize_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `type`;

4
README.md

@ -16,7 +16,7 @@ UPDATE `judge_state` JOIN `problem` ON `problem`.`id` = `judge_state`.`problem_i
ALTER TABLE `syzoj`.`judge_state` ADD INDEX `judge_state_is_public` (`id`, `is_public`, `type_info`, `type`); 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 日)前更新且使用除 SQLite 外数据库软件的用户**必须**在其数据库上执行以下 SQL 语句。 从该 commit [26d66ceef24fbb35481317453bcb89ead6c69076](https://github.com/syzoj/syzoj/commit/26d66ceef24fbb35481317453bcb89ead6c69076)(2018 年 11 月 5 日)前更新的用户**必须**在其数据库上执行以下 SQL 语句。
```sql ```sql
ALTER TABLE contest_player CHANGE score_details score_details JSON NOT NULL; ALTER TABLE contest_player CHANGE score_details score_details JSON NOT NULL;
@ -27,7 +27,7 @@ ALTER TABLE judge_state CHANGE compilation compilation JSON NOT NULL;
ALTER TABLE judge_state CHANGE result result 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 语句。**注意**:此语句尚未在除 MySQL 外的数据库系统中测试。 从该 commit [84b9e2d7b51e4ed3ab426621b66cf5ae9e1e1c23](https://github.com/syzoj/syzoj/commit/84b9e2d7b51e4ed3ab426621b66cf5ae9e1e1c23)(2018 年 11 月 6 日)前更新的用户**必须**在其数据库上执行以下 SQL 语句。
```sql ```sql
ALTER TABLE `problem` ADD `publicize_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `type`; ALTER TABLE `problem` ADD `publicize_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `type`;

3
app.js

@ -128,8 +128,7 @@ global.syzoj = {
this.db = new Sequelize(this.config.db.database, this.config.db.username, this.config.db.password, { this.db = new Sequelize(this.config.db.database, this.config.db.username, this.config.db.password, {
host: this.config.db.host, host: this.config.db.host,
dialect: this.config.db.dialect, dialect: 'mysql',
storage: this.config.db.storage ? this.utils.resolvePath(this.config.db.storage) : null,
logging: syzoj.production ? false : syzoj.log, logging: syzoj.production ? false : syzoj.log,
timezone: require('moment')().format('Z'), timezone: require('moment')().format('Z'),
operatorsAliases: operatorsAliases operatorsAliases: operatorsAliases

8
config-example.json

@ -3,12 +3,10 @@
"hostname": "127.0.0.1", "hostname": "127.0.0.1",
"port": "5283", "port": "5283",
"db": { "db": {
"database": null, "database": "syzoj",
"username": null, "username": "syzoj",
"password": null, "password": null,
"host": null, "host": "127.0.0.1"
"dialect": "sqlite",
"storage": "syzoj.db"
}, },
"register_mail": false, "register_mail": false,
"email": { "email": {

1
package.json

@ -60,7 +60,6 @@
"sequelize": "^4.41.0", "sequelize": "^4.41.0",
"session-file-store": "^1.0.0", "session-file-store": "^1.0.0",
"socket.io": "^2.0.3", "socket.io": "^2.0.3",
"sqlite3": "^4.0.3",
"syzoj-divine": "^1.0.2", "syzoj-divine": "^1.0.2",
"tmp-promise": "^1.0.3", "tmp-promise": "^1.0.3",
"waliyun": "^3.1.1", "waliyun": "^3.1.1",

Loading…
Cancel
Save