Initial commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
# Generated by Django 6.0.7 on 2026-07-13 12:02
|
||||
|
||||
import django.db.models.deletion
|
||||
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='StudentProfile',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('xp', models.IntegerField(default=0)),
|
||||
('streak', models.IntegerField(default=0)),
|
||||
('daily_goal', models.IntegerField(default=60)),
|
||||
('target_band', models.FloatField(default=7.5)),
|
||||
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 6.0.7 on 2026-07-17 12:49
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounts', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='studentprofile',
|
||||
name='last_activity_date',
|
||||
field=models.DateField(blank=True, null=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,26 @@
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [("accounts", "0002_studentprofile_last_activity_date")]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="DailyMissionClaim",
|
||||
fields=[
|
||||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
||||
("mission_key", models.CharField(max_length=40)),
|
||||
("completed_on", models.DateField()),
|
||||
("xp_awarded", models.PositiveIntegerField()),
|
||||
("claimed_at", models.DateTimeField(auto_now_add=True)),
|
||||
("user", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name="daily_mission_claims", to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={"ordering": ["-completed_on", "-claimed_at"]},
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name="dailymissionclaim",
|
||||
constraint=models.UniqueConstraint(fields=("user", "mission_key", "completed_on"), name="unique_daily_mission_claim"),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,51 @@
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("accounts", "0003_dailymissionclaim"),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="PremiumEntitlement",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
(
|
||||
"source",
|
||||
models.CharField(
|
||||
choices=[
|
||||
("admin", "Admin grant"),
|
||||
("payment", "One-time payment"),
|
||||
("promotion", "Promotion"),
|
||||
],
|
||||
default="admin",
|
||||
max_length=20,
|
||||
),
|
||||
),
|
||||
("order_reference", models.CharField(blank=True, max_length=120)),
|
||||
("granted_at", models.DateTimeField(auto_now_add=True)),
|
||||
("revoked_at", models.DateTimeField(blank=True, null=True)),
|
||||
("notes", models.TextField(blank=True)),
|
||||
(
|
||||
"user",
|
||||
models.OneToOneField(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="premium_entitlement",
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,20 @@
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("accounts", "0004_premiumentitlement"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="studentprofile",
|
||||
name="display_name",
|
||||
field=models.CharField(blank=True, max_length=40),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="studentprofile",
|
||||
name="country",
|
||||
field=models.CharField(blank=True, max_length=80),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user