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
49 lines
1.5 KiB
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateBusinessesTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('businesses', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('name');
|
|
$table->string('slug')->unique();
|
|
$table->integer('wallet')->default(0);
|
|
$table->unsignedInteger('files_volume')->default(0);
|
|
$table->string('color')->nullable();
|
|
$table->string('description')->nullable();
|
|
$table->json('cache')->nullable();
|
|
$table->boolean('has_avatar')->default(false);
|
|
$table->timestamp('calculated_at')->nullable();
|
|
$table->timestamp('created_at')->nullable();
|
|
$table->timestamp('updated_at')->nullable();
|
|
$table->timestamp('deleted_at')->nullable();
|
|
});
|
|
|
|
Schema::create('business_user', function (Blueprint $table) {
|
|
$table->unsignedBigInteger('business_id');
|
|
$table->unsignedBigInteger('user_id');
|
|
$table->tinyInteger('level')->default(0);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('businesses');
|
|
Schema::dropIfExists('businesses_user');
|
|
}
|
|
}
|