#!/usr/bin/env python3
"""Script to update variant stock to make colors visible"""

from app import app, db
from models import ProductVariant

def update_variant_stock():
    with app.app_context():
        # Update all variants to have stock
        variants = ProductVariant.query.all()
        for variant in variants:
            if variant.stock_quantity == 0:
                variant.stock_quantity = 10  # Set to 10 for visibility
                print(f"Updated {variant.color} stock to 10")
        
        db.session.commit()
        print("All variant stocks updated successfully!")

if __name__ == "__main__":
    update_variant_stock()
