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.

50 lines
1.5 KiB

  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateBusinessesTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('businesses', function (Blueprint $table) {
  15. $table->id();
  16. $table->string('name');
  17. $table->string('slug')->unique();
  18. $table->integer('wallet')->default(0);
  19. $table->unsignedInteger('files_volume')->default(0);
  20. $table->string('color')->nullable();
  21. $table->string('description')->nullable();
  22. $table->json('cache')->nullable();
  23. $table->boolean('has_avatar')->default(false);
  24. $table->timestamp('calculated_at')->nullable()->index();
  25. $table->timestamp('created_at')->nullable();
  26. $table->timestamp('updated_at')->nullable();
  27. $table->timestamp('suspended_at')->nullable();
  28. $table->timestamp('deleted_at')->nullable();
  29. });
  30. Schema::create('business_user', function (Blueprint $table) {
  31. $table->unsignedBigInteger('business_id');
  32. $table->unsignedBigInteger('user_id');
  33. $table->tinyInteger('level')->default(0);
  34. });
  35. }
  36. /**
  37. * Reverse the migrations.
  38. *
  39. * @return void
  40. */
  41. public function down()
  42. {
  43. Schema::dropIfExists('businesses');
  44. Schema::dropIfExists('businesses_user');
  45. }
  46. }