This commit is contained in:
dimon8
2026-01-07 06:44:07 +00:00
parent 368ad0a220
commit 31b79d70c5
6 changed files with 144 additions and 7 deletions

View File

@@ -13,14 +13,16 @@ return new class extends Migration
{
Schema::create('components', function (Blueprint $table) {
$table->id();
$table->string('name'); // Например: "Intel Core i5-12400F"
$table->foreignId('component_type_id')->constrained()->onDelete('cascade');
$table->decimal('price', 10, 2);
$table->json('specifications')->nullable(); // Для хранения характеристик
$table->boolean('is_official')->default(true); // true = админ, false = пользователь
$table->foreignId('created_by_user_id')->nullable()->constrained('users')->onDelete('set null');
$table->timestamps();
$table->text('name');
$table->text('type');
$table->text('brand');
$table->text('model');
$table->integer('price');
});
}
/**
* Reverse the migrations.