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.

49 lines
1.5 KiB

  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  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('deleted_at')->nullable();
  28. });
  29. Schema::create('business_user', function (Blueprint $table) {
  30. $table->unsignedBigInteger('business_id');
  31. $table->unsignedBigInteger('user_id');
  32. $table->tinyInteger('level')->default(0);
  33. });
  34. }
  35. /**
  36. * Reverse the migrations.
  37. *
  38. * @return void
  39. */
  40. public function down()
  41. {
  42. Schema::dropIfExists('businesses');
  43. Schema::dropIfExists('businesses_user');
  44. }
  45. }