Coverage for apps / recipes / migrations / 0001_initial.py: 100%
6 statements
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-11 00:40 +0000
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-11 00:40 +0000
1# Generated by Django 5.2.10 on 2026-01-07 14:40
3import django.db.models.deletion
4from django.db import migrations, models
7class Migration(migrations.Migration):
9 initial = True
11 dependencies = [
12 ('profiles', '0001_initial'),
13 ]
15 operations = [
16 migrations.CreateModel(
17 name='SearchSource',
18 fields=[
19 ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
20 ('host', models.CharField(max_length=255, unique=True)),
21 ('name', models.CharField(max_length=255)),
22 ('is_enabled', models.BooleanField(default=True)),
23 ('search_url_template', models.CharField(max_length=500)),
24 ('result_selector', models.CharField(blank=True, max_length=255)),
25 ('logo_url', models.URLField(blank=True)),
26 ('last_validated_at', models.DateTimeField(blank=True, null=True)),
27 ('consecutive_failures', models.PositiveIntegerField(default=0)),
28 ('needs_attention', models.BooleanField(default=False)),
29 ],
30 options={
31 'ordering': ['name'],
32 },
33 ),
34 migrations.CreateModel(
35 name='Recipe',
36 fields=[
37 ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
38 ('source_url', models.URLField(blank=True, db_index=True, max_length=2000, null=True)),
39 ('canonical_url', models.URLField(blank=True, max_length=2000)),
40 ('host', models.CharField(max_length=255)),
41 ('site_name', models.CharField(blank=True, max_length=255)),
42 ('title', models.CharField(max_length=500)),
43 ('author', models.CharField(blank=True, max_length=255)),
44 ('description', models.TextField(blank=True)),
45 ('image', models.ImageField(blank=True, upload_to='recipe_images/')),
46 ('image_url', models.URLField(blank=True, max_length=2000)),
47 ('ingredients', models.JSONField(default=list)),
48 ('ingredient_groups', models.JSONField(default=list)),
49 ('instructions', models.JSONField(default=list)),
50 ('instructions_text', models.TextField(blank=True)),
51 ('prep_time', models.PositiveIntegerField(blank=True, null=True)),
52 ('cook_time', models.PositiveIntegerField(blank=True, null=True)),
53 ('total_time', models.PositiveIntegerField(blank=True, null=True)),
54 ('yields', models.CharField(blank=True, max_length=100)),
55 ('servings', models.PositiveIntegerField(blank=True, null=True)),
56 ('category', models.CharField(blank=True, max_length=100)),
57 ('cuisine', models.CharField(blank=True, max_length=100)),
58 ('cooking_method', models.CharField(blank=True, max_length=100)),
59 ('keywords', models.JSONField(default=list)),
60 ('dietary_restrictions', models.JSONField(default=list)),
61 ('equipment', models.JSONField(default=list)),
62 ('nutrition', models.JSONField(default=dict)),
63 ('rating', models.FloatField(blank=True, null=True)),
64 ('rating_count', models.PositiveIntegerField(blank=True, null=True)),
65 ('language', models.CharField(blank=True, max_length=10)),
66 ('links', models.JSONField(default=list)),
67 ('ai_tips', models.JSONField(blank=True, default=list)),
68 ('is_remix', models.BooleanField(default=False)),
69 ('scraped_at', models.DateTimeField(auto_now_add=True)),
70 ('updated_at', models.DateTimeField(auto_now=True)),
71 ('remix_profile', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='remixes', to='profiles.profile')),
72 ],
73 options={
74 'indexes': [models.Index(fields=['host'], name='recipes_rec_host_5552ca_idx'), models.Index(fields=['is_remix'], name='recipes_rec_is_remi_f9e83c_idx'), models.Index(fields=['scraped_at'], name='recipes_rec_scraped_1431f9_idx')],
75 },
76 ),
77 ]