# Generated by Django 5.0.6 on 2026-05-01 14:08

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='DownloadableForm',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('description', models.TextField(blank=True)),
                ('file', models.FileField(upload_to='forms/files/')),
                ('cover', models.ImageField(blank=True, null=True, upload_to='forms/covers/')),
                ('require_email', models.BooleanField(default=True, help_text='Capture email before download (gates lead)')),
                ('is_active', models.BooleanField(default=True)),
                ('download_count', models.PositiveIntegerField(default=0)),
                ('order', models.PositiveIntegerField(default=0)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ['order', '-created_at'],
            },
        ),
        migrations.CreateModel(
            name='FormDownload',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=120)),
                ('email', models.EmailField(blank=True, max_length=254)),
                ('phone', models.CharField(blank=True, max_length=30)),
                ('ip_address', models.GenericIPAddressField(blank=True, null=True)),
                ('downloaded_at', models.DateTimeField(auto_now_add=True)),
                ('form', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='downloads', to='forms.downloadableform')),
            ],
            options={
                'ordering': ['-downloaded_at'],
            },
        ),
    ]
