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_100007_create_pa...

54 lines
2.0 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePartnerTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('partner', function (Blueprint $table) {
$table->unsignedInteger('id', true)->comment('업체번호');
$table->string('uid', 100)->default('')->comment('업체 UID');
$table->tinyInteger('category')->default(1)->comment('카테고리');
$table->string('title', 100)->default('')->comment('업체명');
$table->string('link', 255)->default('')->comment('링크주소');
$table->string('image', 100)->nullable()->comment('이미지 UID');
$table->smallInteger('width')->default(0)->comment('이미지 가로사이즈');
$table->smallInteger('height')->default(0)->comment('이미지 세로사이즈');
$table->tinyInteger('status')->default(0)->comment('노출여부[1:노출,0:미노출]');
$table->unsignedInteger('created_id')->nullable()->comment('등록 회원번호');
$table->datetime('created_at')->nullable()->comment('등록일시');
$table->datetime('updated_at')->nullable()->comment('수정일시');
$table->dateTime('deleted_at')->nullable()->comment('삭제일시');
// 인덱스
$table->unique('uid', 'uk_tbl_partner_uid');
$table->index('category', 'ik_tbl_partner_category');
$table->index('created_at', 'ik_tbl_partner_created_at');
// 외래키
$table->foreign('image', 'fk_tbl_partner_image')
->references('uid')->on('asset')
->onUpdate('cascade')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('partner');
}
}