43 lines
1.5 KiB
PHP
43 lines
1.5 KiB
PHP
<?php
|
||
|
||
use Illuminate\Support\Facades\Schema;
|
||
use Illuminate\Database\Schema\Blueprint;
|
||
use Illuminate\Database\Migrations\Migration;
|
||
|
||
class CreateFilesTable extends Migration
|
||
{
|
||
/**
|
||
* Run the migrations.
|
||
*
|
||
* @return void
|
||
*/
|
||
public function up()
|
||
{
|
||
Schema::create('files', function (Blueprint $table) {
|
||
$table->increments('id');
|
||
$table->string('tmp',255)->default('')->comment('原始名字');
|
||
$table->string('type',60)->default('image')->comment('文件类型:image,vedio,pdf,office,zip,rar,other');
|
||
$table->string('filename',255)->comment('新文件名');
|
||
$table->string('screen_type',50)->nullable()->comment('使用场景');
|
||
$table->integer('size')->default(0)->comment('文件大小');
|
||
$table->string('path',255)->comment('文件路径');
|
||
$table->string('oss_type',60)->default('local')->comment('存储位置');
|
||
$table->string('user_type',60)->comment('上传用户类型:平台|用户');
|
||
$table->integer('user_id')->unsigned()->comment('所属用户id');
|
||
$table->string('create_type',30)->nullable()->comment('创建类型shop为商家,personal为个人开店');
|
||
$table->timestamps();
|
||
$table->index(['user_type','user_id']);
|
||
});
|
||
}
|
||
|
||
/**
|
||
* Reverse the migrations.
|
||
*
|
||
* @return void
|
||
*/
|
||
public function down()
|
||
{
|
||
Schema::dropIfExists('files');
|
||
}
|
||
}
|