# Generated by Django 5.2.1 on 2025-06-03 04:02

import autoslug.fields
import django.db.models.deletion
import imagekit.models.fields
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Images',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=254, verbose_name='Resim Başlığı')),
                ('is_active', models.BooleanField(choices=[(True, 'Evet'), (False, 'Hayır')], default=True, verbose_name='Yayındamı ?')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Oluşturulma Tarihi')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Güncelleme Tarihi')),
                ('images', imagekit.models.fields.ProcessedImageField(upload_to='uploads/product/%Y')),
            ],
            options={
                'verbose_name': 'Ürün Resmi',
                'verbose_name_plural': 'Ürün Resimleri',
                'db_table': 'images',
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=254, verbose_name='Kategori')),
                ('keywords', models.CharField(max_length=254, verbose_name='Seo Kelimeleri Aralarına Virgül Koyunuz')),
                ('description', models.CharField(max_length=254, verbose_name='Açıklama')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Oluşturulma Tarihi')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Güncelleme Tarihi')),
                ('is_active', models.BooleanField(choices=[(True, 'Evet'), (False, 'Hayır')], default=True, verbose_name='Yayındamı')),
                ('order', models.IntegerField(db_index=True, default=1, verbose_name='Görüntülenme Sırası')),
                ('slug', autoslug.fields.AutoSlugField(blank=True, editable=True, max_length=250, populate_from='title', unique=True)),
                ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='child', to='product.category', verbose_name='Üst Kategorisi')),
            ],
            options={
                'verbose_name': 'Ürün Kategori',
                'verbose_name_plural': 'Ürün Kategorilerileri',
                'db_table': 'categories',
                'ordering': ['order'],
                'unique_together': {('slug', 'parent')},
            },
        ),
        migrations.CreateModel(
            name='Tags',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tag', models.CharField(max_length=254, verbose_name='Ürün Tagları')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Oluşturulma Tarihi')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Güncelleme Tarihi')),
                ('is_active', models.BooleanField(choices=[(True, 'Evet'), (False, 'Hayır')], default=True, verbose_name='Yayındamı')),
                ('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='tag', unique=True)),
            ],
            options={
                'verbose_name': 'Ürün Tagı',
                'verbose_name_plural': 'Ürün Tagları',
                'db_table': 'tags',
                'ordering': ['-created_at'],
                'unique_together': {('slug',)},
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=254, verbose_name='Ürün Başlığı')),
                ('content', models.TextField(blank=True, null=True, verbose_name='Ürün İçeriği')),
                ('keywords', models.CharField(max_length=254, verbose_name='Seo Kelimeleri Aralarına Virgül Koyunuz')),
                ('price', models.FloatField(verbose_name='Fiyatı')),
                ('video', models.CharField(blank=True, default='none', max_length=254, null=True, verbose_name='Video')),
                ('slug', autoslug.fields.AutoSlugField(editable=False, max_length=250, populate_from='title', unique=True)),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Oluşturulma Tarihi')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Güncelleme Tarihi')),
                ('is_active', models.BooleanField(choices=[(True, 'Evet'), (False, 'Hayır')], default=True, verbose_name='Yayındamı ?')),
                ('categories', models.ManyToManyField(related_name='categories', to='product.category', verbose_name='Ürün Kategorisi')),
                ('images', models.ManyToManyField(related_name='img', to='product.images', verbose_name='Ürün Resimleri')),
                ('tags', models.ManyToManyField(related_name='tags', to='product.tags', verbose_name='Ürün Tagları')),
            ],
            options={
                'verbose_name': 'Ürün',
                'verbose_name_plural': 'Ürünler',
                'db_table': 'products',
                'ordering': ['-created_at'],
                'unique_together': {('slug',)},
            },
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=254, verbose_name='Yorum Başlığı')),
                ('body', models.TextField(verbose_name='Yorum')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Oluşturulma Tarihi')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Güncelleme Tarihi')),
                ('is_active', models.BooleanField(choices=[(True, 'Evet'), (False, 'Hayır')], default=True, verbose_name='Yayındamı')),
                ('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='title', unique=True)),
                ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='child', to='product.comment')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cuser', to=settings.AUTH_USER_MODEL)),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='_product', to='product.product')),
            ],
            options={
                'verbose_name': 'Ürüm Yorum',
                'verbose_name_plural': 'Ürün Yorumları',
                'db_table': 'comments',
                'ordering': ['-created_at'],
                'unique_together': {('slug', 'parent')},
            },
        ),
    ]
