summaryrefslogtreecommitdiffstats
path: root/core/migrations
diff options
context:
space:
mode:
authorAndrew Godwin2022-11-16 17:23:46 -0700
committerAndrew Godwin2022-11-16 17:23:46 -0700
commit44af0d4c59eed1c3715e9044e75c159cfddf54cc (patch)
treed2c87f953de12a526a158f2c03def5eb08b2d203 /core/migrations
parent495e955378d62dc439c4c210785e5d401bc77f64 (diff)
downloadtakahe-44af0d4c59eed1c3715e9044e75c159cfddf54cc.tar.gz
takahe-44af0d4c59eed1c3715e9044e75c159cfddf54cc.tar.bz2
takahe-44af0d4c59eed1c3715e9044e75c159cfddf54cc.zip
Add start of a settings (config) system
Diffstat (limited to 'core/migrations')
-rw-r--r--core/migrations/0001_initial.py63
-rw-r--r--core/migrations/__init__.py0
2 files changed, 63 insertions, 0 deletions
diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py
new file mode 100644
index 0000000..2c4731f
--- /dev/null
+++ b/core/migrations/0001_initial.py
@@ -0,0 +1,63 @@
+# Generated by Django 4.1.3 on 2022-11-16 21:23
+
+import django.db.models.deletion
+from django.conf import settings
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ initial = True
+
+ dependencies = [
+ ("users", "0002_identity_public_key_id"),
+ 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(
+ blank=True, null=True, upload_to="config/%Y/%m/%d/"
+ ),
+ ),
+ (
+ "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")},
+ },
+ ),
+ ]
diff --git a/core/migrations/__init__.py b/core/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/core/migrations/__init__.py