summaryrefslogtreecommitdiff
path: root/workbench/database
diff options
context:
space:
mode:
authorSam Light <samlight1994@gmail.com>2025-01-18 23:23:30 +0000
committerSam Light <samlight1994@gmail.com>2025-01-18 23:23:30 +0000
commit2c8fdd1d6f07ab5d757395e6a9e8ff4de3f6ec53 (patch)
treec1663b9c4f70c731442432c9f887571f521c9694 /workbench/database
parentb49d12a5c2536075a1b23289c291d8dda56940e1 (diff)
More testing setup
Diffstat (limited to 'workbench/database')
-rw-r--r--workbench/database/factories/ProductFactory.php5
-rw-r--r--workbench/database/migrations/2025_01_18_201725_create_products_table.php3
2 files changed, 6 insertions, 2 deletions
diff --git a/workbench/database/factories/ProductFactory.php b/workbench/database/factories/ProductFactory.php
index 4131cb2..081e196 100644
--- a/workbench/database/factories/ProductFactory.php
+++ b/workbench/database/factories/ProductFactory.php
@@ -27,7 +27,10 @@ class ProductFactory extends Factory
public function definition(): array
{
return [
- //
+ 'name' => fake()->text(30),
+ 'description' => fake()->text(100),
+ 'price' => fake()->randomFloat(2, 1, 300),
+ 'stock' => fake()->numberBetween(0, 30),
];
}
}
diff --git a/workbench/database/migrations/2025_01_18_201725_create_products_table.php b/workbench/database/migrations/2025_01_18_201725_create_products_table.php
index 7ee7127..4396485 100644
--- a/workbench/database/migrations/2025_01_18_201725_create_products_table.php
+++ b/workbench/database/migrations/2025_01_18_201725_create_products_table.php
@@ -14,8 +14,9 @@ return new class extends Migration
Schema::create('products', function (Blueprint $table) {
$table->id();
$table->string('name');
- $table->string('descripton');
+ $table->string('description');
$table->decimal('price', total: 8, places: 2);
+ $table->unsignedInteger('stock');
$table->timestamps();
$table->softDeletes();
});