From 6489f8d8d45f2177ab12a8cfb55a38b4e13c76cf Mon Sep 17 00:00:00 2001 From: liyinglin Date: Tue, 21 Mar 2023 10:16:37 +0800 Subject: [PATCH] 1 --- .../2022_05_09_133612_alert_users_table.php | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 database/migrations/2022_05_09_133612_alert_users_table.php diff --git a/database/migrations/2022_05_09_133612_alert_users_table.php b/database/migrations/2022_05_09_133612_alert_users_table.php new file mode 100644 index 0000000..c1fb031 --- /dev/null +++ b/database/migrations/2022_05_09_133612_alert_users_table.php @@ -0,0 +1,54 @@ +dropColumn('name'); + $table->dropColumn('email'); + $table->dropColumn('email_verified_at'); + $table->dropColumn('password'); + $table->string('openid', 200)->nullable()->default(''); + $table->string('sex', 20)->nullable()->default('未知')->comment('性别 未知 男 女'); + $table->string('nickname', 191)->nullable(); + $table->string('mobile', 100)->nullable()->default('')->comment('手机号'); + $table->string('country', 100)->nullable()->default(''); + $table->string('province', 100)->nullable()->default(''); + $table->string('city', 200)->nullable()->default(''); + $table->string('headimgurl')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function (Blueprint $table) { + $table->string('name'); + $table->string('email')->unique(); + $table->timestamp('email_verified_at')->nullable(); + $table->string('password'); + $table->dropColumn('openid'); + $table->dropColumn('sex'); + $table->dropColumn('nickname'); + $table->dropColumn('mobile'); + $table->dropColumn('country'); + $table->dropColumn('province'); + $table->dropColumn('city'); + $table->dropColumn('headimgurl'); + }); + } +};