cafeg/database/migrations/2025_01_08_025433_create_member_table.php
2025-01-09 16:56:00 +08:00

45 lines
1.6 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('members', function (Blueprint $table) {
$table->id();
$table->string('name')->default('客戶')->nullable(); // 使用者名稱
$table->string('email')->nullable()->unique(); // 電子郵件
$table->string('password'); // 密碼
$table->string('avatar')->nullable(); // 頭像
$table->string('phone')->nullable(); // 電話
$table->string('source')->comment('來源'); // 來源
$table->string('line_id')->nullable()->unique(); // Line ID
$table->string('facebook_id')->nullable()->unique(); // Facebook ID
$table->string('google_id')->nullable()->unique(); // Google ID
$table->integer('level')->default(0)->comment('會員等級 0 一般,1.銀會員,2金會員,9.測試人員'); // 會員等級
$table->string('reset_token')->nullable(); // 密碼重置 Token
$table->timestamp('email_verified_at')->nullable(); // 電子郵件驗證時間
$table->rememberToken(); // 記住登入 Token
$table->timestamps(); // 建立與更新時間
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('members');
}
};