#!/usr/bin/env python3
"""Script to add Hoodie category to the database"""

from app import app, db
from models import Category

def add_hoodie_category():
    with app.app_context():
        # Check if Hoodie category already exists
        existing = Category.query.filter_by(name='Hoodies').first()
        if existing:
            print("Hoodie category already exists!")
            return
        
        # Create new Hoodie category
        hoodie_category = Category(name='Hoodies')
        db.session.add(hoodie_category)
        db.session.commit()
        
        print("Hoodie category added successfully!")
        print(f"Category ID: {hoodie_category.id}")

if __name__ == "__main__":
    add_hoodie_category()
