# Generated by Django 5.0.6 on 2024-09-06 21:00

from django.db import migrations
import random

def populate_random_prices(apps, schema_editor):
    """
    Populate existing books with a random price between 10.00 and 150.00.
    """
    Book = apps.get_model('catalog_app', 'Book')
    for book in Book.objects.all():
        book.price_usd = round(random.uniform(10.00, 150.00), 2)
        book.save()

class Migration(migrations.Migration):

    dependencies = [
        ('catalog_app', '0002_remove_book_cover_url_book_cover'), # Adjust if your previous migration has a different name
    ]

    operations = [
        migrations.RunPython(populate_random_prices),
    ]