OneBoard
Laonboard 분석 - 사용자 계정 users table
OneBoard
2021. 1. 26. 22:32
php를 이용해서 만들어진 그누보드의 사용자 계정의 필드들은 과도한 개인정보를 필요로 하기에
2020년 이후의 현실과는 차이가 많이 있으며
테이블을 g4_ g5_와 같이 prefix를 이용해서 테이블을 구분하는 것도 부적절 한 것 같습니다.
라라벨의 기본 사용자 Table은 이름, 이메일(unique), 이메일 인증날짜, password를 주요한 필드로 가지고 있는데
라온보드는 그누보드처럼 users 테이블에 모든 사용자들에 대한 정보를 가지고 있습니다.
- nickname : 닉네임은 이름이라는 개인정보를 위장하는 정보 입니다. 그런데, 이름이 필요한 것일까요? 쇼핑몰이라는 영역에서도 개인정보를 노출하는 것은 바람직하지 않기 때문에 name을 nickname으로 쓰는 것이 더 바람직 하므로, 추가하지 않습니다.
- 전화번호, 성별 등의 개인정보는 별도의 table로 분리를 해서 필요하면 사용하도록 하는 것이 더 바람직 합니다.
- 회원 정보의 create, update 시점을 나타내는 created_at, updated_at은 추가를 하는 것이 필요 합니다.
사용자 id, 이름(닉네임), 이메일, 비밀번호 - 4가지 항목으로 이루어진 라라벨의 users 테이블은
개인정보를 최소화 하는 최근의 시스템 구성을 생각할 때 좋은 선택인 것 같습니다.
users -> usersDetail (상세 개인정보) ... 1:1 match
라라벨의 기본 사용자 테이블
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
라온보드의 기본 사용자 테이블
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if(!Schema::hasTable('users')) {
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->nullable();
$table->string('email', 50)->unique();
$table->string('password', 60)->nullable();
$table->string('nick');
$table->date('nick_date')->nullable();
$table->string('homepage')->nullable();
$table->tinyInteger('level')->nullable()->default(0);
$table->char('sex', 1)->nullable();
$table->string('birth')->nullable();
$table->string('tel')->nullable();
$table->string('hp')->nullable();
$table->string('certify', 20)->nullable();
$table->tinyInteger('adult')->nullable()->default(0);
$table->string('dupinfo')->nullable();
$table->char('zip', 5)->nullable();
$table->string('addr1')->nullable();
$table->string('addr2')->nullable();
$table->string('addr_jibeon')->nullable();
$table->text('signature')->nullable();
$table->integer('recommend', false, true)->nullable();
$table->integer('point')->nullable()->default(0);
$table->timestamp('today_login')->dafault(Carbon::now())->index();
$table->string('login_ip')->nullable();
$table->string('ip')->nullable();
$table->string('leave_date', 8)->nullable();
$table->string('intercept_date', 8)->nullable();
$table->timestamp('email_certify')->nullable();
$table->string('email_certify2')->nullable();
$table->text('memo')->nullable();
$table->string('lost_certify')->nullable();
$table->tinyInteger('mailing')->nullable()->default(0);
$table->tinyInteger('sms')->nullable()->default(0);
$table->tinyInteger('open')->nullable()->default(0);
$table->date('open_date')->nullable();
$table->text('profile')->nullable();
$table->string('memo_call')->nullable();
$table->string('id_hashkey')->nullable();
$table->rememberToken();
$table->timestamps();
$table->string('extra_1')->nullable();
$table->string('extra_2')->nullable();
$table->string('extra_3')->nullable();
$table->string('extra_4')->nullable();
$table->string('extra_5')->nullable();
$table->string('extra_6')->nullable();
$table->string('extra_7')->nullable();
$table->string('extra_8')->nullable();
$table->string('extra_9')->nullable();
$table->string('extra_10')->nullable();
$table->timestamp('updated_at')->default(Carbon::now())->index()->change();
});
}
}
반응형