Created script to populate inventory table for products that have 0 inventory. Issue: - Products had 0 available_inventory because inventory table was empty - available_inventory is calculated from inventory_entries relationship - Empty inventory table = 0 inventory for all products - Add to cart fails when inventory is 0 Solution: - Create inventory entries for all products - Each product gets 100 units in 'Main Warehouse' - Script can be run multiple times (only creates missing entries) Usage: python scripts/create_inventory.py 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2.2 KiB
Executable File
2.2 KiB
Executable File