unsignedInteger('id', true)->comment('파일번호'); $table->string('uid', 100)->default('')->comment('파일 UID'); $table->string('orgin_name', 255)->default('')->comment('원본파일명'); $table->string('name', 255)->default('')->comment('업로드 파일명'); $table->string('path', 255)->default('')->comment('서버 파일명'); $table->string('type', 50)->default('')->comment('파일종류'); $table->bigInteger('size')->default(0)->comment('파일용량'); $table->smallInteger('width')->default(0)->comment('이미지 가로사이즈'); $table->smallInteger('height')->default(0)->comment('이미지 세로사이즈'); $table->string('ext', 20)->default('')->comment('파일확장자'); $table->integer('count')->default(0)->comment('다운로드수'); $table->unsignedInteger('created_id')->nullable()->comment('등록 회원번호'); $table->unsignedInteger('updated_id')->nullable()->comment('수정 회원번호'); $table->unsignedInteger('deleted_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_asset_uid'); $table->index('created_at', 'ik_tbl_asset_created_at'); // 외래키 $table->foreign('created_id', 'fk_tbl_asset_created_id') ->references('id')->on('user') ->onUpdate('cascade') ->onDelete('cascade'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::drop('asset'); } }