Template
Extract always-on public/portal/UTM plus optional email_sms, directmail, blog, payments, social, and social_ai so new client sites can be bootstrapped from this seed. Refs #1 Refs #2 Co-authored-by: Cursor <cursoragent@cursor.com>
67 lines
2.9 KiB
Python
67 lines
2.9 KiB
Python
# Generated by Django 6.1 on 2026-08-26 11:38
|
|
|
|
import django.db.models.deletion
|
|
import uuid
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
('leads', '0001_initial'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='UTMVisit',
|
|
fields=[
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('correlation_id', models.CharField(db_index=True, max_length=64)),
|
|
('path', models.CharField(blank=True, max_length=512)),
|
|
('referrer', models.URLField(blank=True, max_length=1024)),
|
|
('utm_source', models.CharField(blank=True, max_length=128)),
|
|
('utm_medium', models.CharField(blank=True, max_length=128)),
|
|
('utm_campaign', models.CharField(blank=True, max_length=128)),
|
|
('utm_term', models.CharField(blank=True, max_length=128)),
|
|
('utm_content', models.CharField(blank=True, max_length=128)),
|
|
('user_agent', models.CharField(blank=True, max_length=512)),
|
|
],
|
|
options={
|
|
'ordering': ['-created_at'],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='PageView',
|
|
fields=[
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('path', models.CharField(db_index=True, max_length=512)),
|
|
],
|
|
options={
|
|
'ordering': ['-created_at'],
|
|
'indexes': [models.Index(fields=['created_at', 'path'], name='analytics_p_created_9e8b64_idx')],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='Attribution',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('utm_source', models.CharField(blank=True, max_length=128)),
|
|
('utm_medium', models.CharField(blank=True, max_length=128)),
|
|
('utm_campaign', models.CharField(blank=True, max_length=128)),
|
|
('lead', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='attribution', to='leads.lead')),
|
|
('visit', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='analytics.utmvisit')),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
]
|