Files
GNX-WEB/backEnd/case_studies/migrations/0001_initial.py
Iliyan Angelov 366f28677a update
2025-11-24 03:52:08 +02:00

145 lines
7.6 KiB
Python

# Generated by Django 4.2.7 on 2025-10-08 10:24
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='CaseStudy',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=300)),
('slug', models.SlugField(max_length=300, unique=True)),
('subtitle', models.CharField(blank=True, max_length=300)),
('description', models.TextField()),
('excerpt', models.TextField(blank=True, help_text='Short excerpt for preview')),
('thumbnail', models.ImageField(blank=True, null=True, upload_to='case_studies/thumbnails/')),
('thumbnail_url', models.CharField(blank=True, help_text='External thumbnail URL', max_length=500)),
('featured_image', models.ImageField(blank=True, null=True, upload_to='case_studies/featured/')),
('featured_image_url', models.CharField(blank=True, help_text='External featured image URL', max_length=500)),
('poster_image', models.ImageField(blank=True, null=True, upload_to='case_studies/posters/')),
('poster_image_url', models.CharField(blank=True, help_text='External poster image URL', max_length=500)),
('project_image', models.ImageField(blank=True, null=True, upload_to='case_studies/projects/')),
('project_image_url', models.CharField(blank=True, help_text='External project image URL', max_length=500)),
('project_overview', models.TextField(blank=True, help_text='Project overview content')),
('site_map_content', models.TextField(blank=True, help_text='Site map / process content')),
('meta_description', models.CharField(blank=True, max_length=160)),
('meta_keywords', models.CharField(blank=True, max_length=255)),
('published', models.BooleanField(default=True)),
('featured', models.BooleanField(default=False, help_text='Featured case study')),
('views_count', models.PositiveIntegerField(default=0)),
('display_order', models.PositiveIntegerField(default=0)),
('published_at', models.DateTimeField(default=django.utils.timezone.now)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
],
options={
'verbose_name': 'Case Study',
'verbose_name_plural': 'Case Studies',
'ordering': ['display_order', '-published_at', '-created_at'],
},
),
migrations.CreateModel(
name='CaseStudyCategory',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('slug', models.SlugField(max_length=100, unique=True)),
('description', models.TextField(blank=True)),
('display_order', models.PositiveIntegerField(default=0)),
('is_active', models.BooleanField(default=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
],
options={
'verbose_name': 'Case Study Category',
'verbose_name_plural': 'Case Study Categories',
'ordering': ['display_order', 'name'],
},
),
migrations.CreateModel(
name='Client',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200)),
('slug', models.SlugField(max_length=200, unique=True)),
('logo', models.ImageField(blank=True, null=True, upload_to='case_studies/clients/')),
('logo_url', models.CharField(blank=True, help_text='External logo URL', max_length=500)),
('description', models.TextField(blank=True)),
('website', models.URLField(blank=True)),
('is_active', models.BooleanField(default=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
],
options={
'verbose_name': 'Client',
'verbose_name_plural': 'Clients',
'ordering': ['name'],
},
),
migrations.CreateModel(
name='CaseStudyProcess',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=200)),
('description', models.TextField()),
('step_number', models.PositiveIntegerField()),
('created_at', models.DateTimeField(auto_now_add=True)),
('case_study', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='process_steps', to='case_studies.casestudy')),
],
options={
'verbose_name': 'Case Study Process',
'verbose_name_plural': 'Case Study Processes',
'ordering': ['step_number'],
},
),
migrations.CreateModel(
name='CaseStudyImage',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('image', models.ImageField(upload_to='case_studies/gallery/')),
('image_url', models.CharField(blank=True, help_text='External image URL', max_length=500)),
('caption', models.CharField(blank=True, max_length=200)),
('display_order', models.PositiveIntegerField(default=0)),
('created_at', models.DateTimeField(auto_now_add=True)),
('case_study', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='gallery_images', to='case_studies.casestudy')),
],
options={
'verbose_name': 'Case Study Image',
'verbose_name_plural': 'Case Study Images',
'ordering': ['display_order', 'created_at'],
},
),
migrations.AddField(
model_name='casestudy',
name='category',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='case_studies', to='case_studies.casestudycategory'),
),
migrations.AddField(
model_name='casestudy',
name='client',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='case_studies', to='case_studies.client'),
),
migrations.AddIndex(
model_name='casestudy',
index=models.Index(fields=['-published_at'], name='case_studie_publish_77559c_idx'),
),
migrations.AddIndex(
model_name='casestudy',
index=models.Index(fields=['slug'], name='case_studie_slug_2898e2_idx'),
),
migrations.AddIndex(
model_name='casestudy',
index=models.Index(fields=['published'], name='case_studie_publish_c9c1aa_idx'),
),
]