32 lines
1.5 KiB
Python
32 lines
1.5 KiB
Python
# Generated by Django 5.2.17 on 2026-08-18 03:10
|
|
|
|
import django.db.models.deletion
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('content', '0001_initial'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='NodeProgress',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('user_id', models.IntegerField(db_index=True)),
|
|
('status', models.CharField(choices=[('not_started', 'شروع\u200cنشده'), ('in_progress', 'در حال انجام'), ('completed', 'تکمیل\u200cشده'), ('abandoned', 'نصفه\u200cرها')], default='not_started', max_length=15)),
|
|
('lessons_completed_count', models.PositiveIntegerField(default=0)),
|
|
('started_at', models.DateTimeField(blank=True, null=True)),
|
|
('completed_at', models.DateTimeField(blank=True, null=True)),
|
|
('last_activity_at', models.DateTimeField(blank=True, db_index=True, null=True)),
|
|
('node', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='progress_records', to='content.node')),
|
|
],
|
|
options={
|
|
'indexes': [models.Index(fields=['status', 'last_activity_at'], name='content_nod_status_7971c6_idx')],
|
|
'constraints': [models.UniqueConstraint(fields=('user_id', 'node'), name='unique_node_progress_per_user')],
|
|
},
|
|
),
|
|
]
|