From 2cd81ab055d428220f6adf5d0afc871597aee312 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Wed, 15 Feb 2023 16:58:53 +0800 Subject: [PATCH] chore: add upgrader for #42 --- web/app/upgrade/42_acm_team_account/up.sql | 8 ++++++ .../upgrade/42_acm_team_account/upgrade.php | 27 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 web/app/upgrade/42_acm_team_account/up.sql create mode 100644 web/app/upgrade/42_acm_team_account/upgrade.php diff --git a/web/app/upgrade/42_acm_team_account/up.sql b/web/app/upgrade/42_acm_team_account/up.sql new file mode 100644 index 0000000..d1a286e --- /dev/null +++ b/web/app/upgrade/42_acm_team_account/up.sql @@ -0,0 +1,8 @@ +ALTER TABLE + `user_info` +MODIFY + `usertype` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'student', +MODIFY + `last_login_time` datetime DEFAULT NULL, +MODIFY + `last_visit_time` datetime DEFAULT NULL; diff --git a/web/app/upgrade/42_acm_team_account/upgrade.php b/web/app/upgrade/42_acm_team_account/upgrade.php new file mode 100644 index 0000000..2a58a2f --- /dev/null +++ b/web/app/upgrade/42_acm_team_account/upgrade.php @@ -0,0 +1,27 @@ + json_encode($extra, JSON_UNESCAPED_UNICODE) + ], + "where", [ + "username" => $user['username'] + ] + ]); + + echo "Updated user {$user['username']}. \n"; + } + } +};