You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
solarai/database/migrations/2022_08_22_100001_create_us...

54 lines
2.4 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUserTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('user', function (Blueprint $table) {
$table->unsignedInteger('id', true)->comment('회원번호');
$table->string('uid', 100)->default('')->comment('회원 UID');
$table->enum('type', ['User','Admin'])->default('User')->comment('회원그룹[일반회원,관리자]');
$table->string('email', 255)->default('')->comment('이메일');
$table->tinyInteger('email_verify')->default(0)->comment('이메일 인증여부');
$table->string('phone', 255)->default('')->comment('전화번호');
$table->tinyInteger('phone_verify')->default(0)->comment('전화번호 인증여부');
$table->string('password', 255)->default('')->comment('비밀번호');
$table->string('name', 255)->default('')->comment('회원이름');
$table->text('cryptable')->nullable()->comment('');
$table->rememberToken()->comment('로그인 유지 토큰');
$table->text('memo')->nullable()->comment('회원메모');
$table->string('agree_service', 100)->default('')->comment('서비스 이용약관 동의');
$table->string('agree_private', 100)->default('')->comment('개인정보 수집 및 제3자 제공동의');
$table->string('agree_marketing', 100)->default('')->comment('마케팅 정보 수신 동의');
$table->enum('status', ['Waiting','Registered','SignOut'])->default('Waiting')->comment('가입상태[대기,승인,탈퇴]');
$table->datetime('created_at')->nullable()->comment('가입일시');
$table->datetime('updated_at')->nullable()->comment('수정일시');
$table->dateTime('deleted_at')->nullable()->comment('탈퇴일시');
// 인덱스
$table->unique('uid', 'uk_tbl_user_uid');
$table->unique(['type','email'], 'uk_tbl_user_email');
$table->index('created_at', 'ik_tbl_user_created_at');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('user');
}
}