30 lines
982 B
PHP
30 lines
982 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('articles', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('reference')->nullable();
|
|
$table->string('designation');
|
|
$table->text('description')->nullable();
|
|
$table->foreignId('categorie_id')->nullable()->constrained('categories')->nullOnDelete();
|
|
$table->foreignId('fournisseur_id')->nullable()->constrained('fournisseurs')->nullOnDelete();
|
|
$table->decimal('prix_unitaire_ht', 10, 2)->nullable();
|
|
$table->string('unite', 30)->default('unité');
|
|
$table->boolean('active')->default(true);
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('articles');
|
|
}
|
|
};
|