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

  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateFilesTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('files', function (Blueprint $table) {
  15. $table->id();
  16. $table->unsignedBigInteger('user_id');
  17. $table->unsignedBigInteger('business_id');
  18. $table->unsignedBigInteger('project_id');
  19. $table->unsignedBigInteger('attached_to_id')->nullable();
  20. $table->integer('attached_to_table')->nullable();
  21. $table->char('disk',191);
  22. $table->char('original_name',191);
  23. $table->char('name',191);
  24. $table->char('extension',4);
  25. $table->string('mime');
  26. $table->string('group',255);
  27. $table->char('size',191);
  28. $table->text('description')->nullable();
  29. $table->timestamp('created_at')->nullable();
  30. $table->timestamp('updated_at')->useCurrent();
  31. });
  32. }
  33. /**
  34. * Reverse the migrations.
  35. *
  36. * @return void
  37. */
  38. public function down()
  39. {
  40. Schema::dropIfExists('files');
  41. }
  42. }