32 lines
955 B
PHP
32 lines
955 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
Schema::create('suppliers', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('name');
|
|
$table->string('url')->nullable();
|
|
$table->string('contact_person')->nullable();
|
|
$table->string('email')->nullable();
|
|
$table->string('phone', 100)->nullable();
|
|
$table->unsignedInteger('country_id');
|
|
$table->text('notes')->nullable();
|
|
$table->boolean('active')->default(true);
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
|
|
$table->foreign('country_id')->references('id')->on('countries');
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('suppliers');
|
|
}
|
|
};
|