38614-vm/core/migrations/0001_initial.py
2026-02-19 19:34:34 +00:00

53 lines
2.4 KiB
Python

# Generated by Django 5.2.7 on 2026-02-19 18:13
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('slug', models.SlugField(blank=True, unique=True)),
],
options={
'verbose_name_plural': 'Categories',
},
),
migrations.CreateModel(
name='Book',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=255)),
('description', models.TextField()),
('price', models.DecimalField(decimal_places=2, max_digits=10)),
('pdf_file', models.FileField(upload_to='books/pdfs/')),
('cover_image', models.ImageField(blank=True, null=True, upload_to='books/covers/')),
('created_at', models.DateTimeField(auto_now_add=True)),
('slug', models.SlugField(blank=True, unique=True)),
('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='books', to='core.category')),
],
),
migrations.CreateModel(
name='Order',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('user_email', models.EmailField(max_length=254)),
('transaction_id', models.CharField(help_text='Enter your EVC/Zaad/Sahal transaction ID or reference', max_length=100)),
('payment_screenshot', models.ImageField(blank=True, null=True, upload_to='payments/')),
('status', models.CharField(choices=[('pending', 'Pending'), ('approved', 'Approved'), ('rejected', 'Rejected')], default='pending', max_length=20)),
('created_at', models.DateTimeField(auto_now_add=True)),
('book', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.book')),
],
),
]