use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProductsTable extends Migration
{
public function up()
{
Schema::create('products', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->decimal('price', 8, 2);
$table->timestamps();
});
\DB::table('products')->insert([
['name' => 'Default Product 1', 'price' => 10.00, 'created_at' => now(), 'updated_at' => now()],
['name' => 'Default Product 2', 'price' => 20.00, 'created_at' => now(), 'updated_at' => now()],
]);
}
public function down()
{
Schema::dropIfExists('products');
}
}