2022-11-18 15:28:15 +00:00
|
|
|
# Generated by Django 4.1.3 on 2022-11-18 17:49
|
|
|
|
|
|
|
|
import functools
|
2022-11-17 00:23:46 +00:00
|
|
|
|
|
|
|
import django.db.models.deletion
|
|
|
|
from django.conf import settings
|
|
|
|
from django.db import migrations, models
|
|
|
|
|
2022-11-18 15:28:15 +00:00
|
|
|
import core.uploads
|
|
|
|
|
2022-11-17 00:23:46 +00:00
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
initial = True
|
|
|
|
|
|
|
|
dependencies = [
|
2022-11-18 15:28:15 +00:00
|
|
|
("users", "0001_initial"),
|
2022-11-17 00:23:46 +00:00
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
|
|
|
name="Config",
|
|
|
|
fields=[
|
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.BigAutoField(
|
|
|
|
auto_created=True,
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("key", models.CharField(max_length=500)),
|
|
|
|
("json", models.JSONField(blank=True, null=True)),
|
|
|
|
(
|
|
|
|
"image",
|
|
|
|
models.ImageField(
|
2022-11-18 15:28:15 +00:00
|
|
|
blank=True,
|
|
|
|
null=True,
|
|
|
|
upload_to=functools.partial(
|
|
|
|
core.uploads.upload_namer, *("config",), **{}
|
|
|
|
),
|
2022-11-17 00:23:46 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"identity",
|
|
|
|
models.ForeignKey(
|
|
|
|
blank=True,
|
|
|
|
null=True,
|
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
|
|
related_name="configs",
|
|
|
|
to="users.identity",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"user",
|
|
|
|
models.ForeignKey(
|
|
|
|
blank=True,
|
|
|
|
null=True,
|
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
|
|
related_name="configs",
|
|
|
|
to=settings.AUTH_USER_MODEL,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
options={
|
|
|
|
"unique_together": {("key", "user", "identity")},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
]
|