57 lines
1.9 KiB
Python
Raw Normal View History

2025-01-20 14:33:03 +05:00
# Generated by Django 5.1.2 on 2025-01-20 04:50
import django.db.models.deletion
import django.utils.timezone
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="Device",
fields=[
(
"id",
models.CharField(max_length=255, primary_key=True, serialize=False),
),
("name", models.CharField(max_length=255)),
("mac", models.CharField(max_length=255)),
(
"reason_for_blocking",
models.CharField(blank=True, max_length=255, null=True),
),
("is_active", models.BooleanField(default=False)),
("registered", models.BooleanField(default=False)),
("blocked", models.BooleanField(default=False)),
(
"blocked_by",
models.CharField(
choices=[("ADMIN", "Admin"), ("PARENT", "Parent")],
default="PARENT",
max_length=255,
),
),
("expiry_date", models.DateTimeField(blank=True, null=True)),
("created_at", models.DateTimeField(default=django.utils.timezone.now)),
("updated_at", models.DateTimeField(auto_now=True)),
(
"user",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="devices",
to=settings.AUTH_USER_MODEL,
),
),
],
),
]