diff --git a/README.en.md b/README.en.md index b1f0bf8..55a216e 100644 --- a/README.en.md +++ b/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`); ``` -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 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; ``` -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 ALTER TABLE `problem` ADD `publicize_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `type`; diff --git a/README.md b/README.md index 17dce38..647353a 100644 --- a/README.md +++ b/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`); ``` -从该 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 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; ``` -从该 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 ALTER TABLE `problem` ADD `publicize_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `type`; diff --git a/app.js b/app.js index 6a57197..28778e1 100644 --- a/app.js +++ b/app.js @@ -128,8 +128,7 @@ global.syzoj = { this.db = new Sequelize(this.config.db.database, this.config.db.username, this.config.db.password, { host: this.config.db.host, - dialect: this.config.db.dialect, - storage: this.config.db.storage ? this.utils.resolvePath(this.config.db.storage) : null, + dialect: 'mysql', logging: syzoj.production ? false : syzoj.log, timezone: require('moment')().format('Z'), operatorsAliases: operatorsAliases diff --git a/config-example.json b/config-example.json index 276cfa7..5b3d980 100644 --- a/config-example.json +++ b/config-example.json @@ -3,12 +3,10 @@ "hostname": "127.0.0.1", "port": "5283", "db": { - "database": null, - "username": null, + "database": "syzoj", + "username": "syzoj", "password": null, - "host": null, - "dialect": "sqlite", - "storage": "syzoj.db" + "host": "127.0.0.1" }, "register_mail": false, "email": { diff --git a/package.json b/package.json index cedbfb8..2c870f6 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,6 @@ "sequelize": "^4.41.0", "session-file-store": "^1.0.0", "socket.io": "^2.0.3", - "sqlite3": "^4.0.3", "syzoj-divine": "^1.0.2", "tmp-promise": "^1.0.3", "waliyun": "^3.1.1",