You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.3 KiB
45 lines
1.3 KiB
<?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->id();
|
|
$table->unsignedBigInteger('user_id');
|
|
$table->unsignedBigInteger('business_id');
|
|
$table->unsignedBigInteger('project_id');
|
|
$table->unsignedBigInteger('attached_to_id')->nullable();
|
|
$table->integer('attached_to_table')->nullable();
|
|
$table->char('disk',191);
|
|
$table->char('original_name',191);
|
|
$table->char('name',191);
|
|
$table->char('extension',4);
|
|
$table->string('mime');
|
|
$table->string('group',255);
|
|
$table->char('size',191);
|
|
$table->text('description')->nullable();
|
|
$table->timestamp('created_at')->nullable();
|
|
$table->timestamp('updated_at')->useCurrent();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('files');
|
|
}
|
|
}
|