|
Server : Apache/2.4.41 (Ubuntu) System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64 User : www-data ( 33) PHP Version : 8.2.12 Disable Function : NONE Directory : /var/www/account.appointkrypt.com/database/migrations/ |
Upload File : |
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('customers', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->unsignedBigInteger('user_id');
$table->string('gender');
$table->string('dob')->nullable();
$table->string('description')->nullable();
$table->unsignedBigInteger('business_id');
$table->unsignedBigInteger('created_by')->default(0);
$table->timestamps();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->foreign('business_id')->references('id')->on('businesses')->onDelete('cascade');
$table->foreign('created_by')->references('id')->on('users')->onDelete('cascade');
// $table->unsignedBigInteger('billable_id');
// $table->string('billable_type');
// $table->timestamp('trial_ends_at')->nullable();
// $table->index(['billable_id', 'billable_type']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('customers');
}
};