summaryrefslogtreecommitdiffstats
path: root/users/migrations
diff options
context:
space:
mode:
authorAndrew Godwin2022-11-06 13:48:04 -0700
committerAndrew Godwin2022-11-06 13:48:04 -0700
commitdbe57075d386d7474bafc208b654507d9a2d769e (patch)
tree96b779d17753669f42b7569ec4ec66834b0673f4 /users/migrations
parent8aec395331a1e9ec4ef1ea38aa20b8517131133b (diff)
downloadtakahe-dbe57075d386d7474bafc208b654507d9a2d769e.tar.gz
takahe-dbe57075d386d7474bafc208b654507d9a2d769e.tar.bz2
takahe-dbe57075d386d7474bafc208b654507d9a2d769e.zip
Rework to a domains model for better vhosting
Diffstat (limited to 'users/migrations')
-rw-r--r--users/migrations/0001_initial.py93
1 files changed, 85 insertions, 8 deletions
diff --git a/users/migrations/0001_initial.py b/users/migrations/0001_initial.py
index 5f9eacb..364daaa 100644
--- a/users/migrations/0001_initial.py
+++ b/users/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 4.1.3 on 2022-11-05 23:50
+# Generated by Django 4.1.3 on 2022-11-06 19:58
import functools
@@ -48,6 +48,30 @@ class Migration(migrations.Migration):
},
),
migrations.CreateModel(
+ name="Domain",
+ fields=[
+ (
+ "domain",
+ models.CharField(max_length=250, primary_key=True, serialize=False),
+ ),
+ (
+ "service_domain",
+ models.CharField(blank=True, max_length=250, null=True),
+ ),
+ ("local", models.BooleanField()),
+ ("blocked", models.BooleanField(default=False)),
+ ("public", models.BooleanField()),
+ ("created", models.DateTimeField(auto_now_add=True)),
+ ("updated", models.DateTimeField(auto_now=True)),
+ (
+ "users",
+ models.ManyToManyField(
+ blank=True, related_name="domains", to=settings.AUTH_USER_MODEL
+ ),
+ ),
+ ],
+ ),
+ migrations.CreateModel(
name="UserEvent",
fields=[
(
@@ -94,10 +118,20 @@ class Migration(migrations.Migration):
verbose_name="ID",
),
),
- ("handle", models.CharField(max_length=500, unique=True)),
+ (
+ "actor_uri",
+ models.CharField(
+ blank=True, max_length=500, null=True, unique=True
+ ),
+ ),
+ ("local", models.BooleanField()),
+ ("username", models.CharField(blank=True, max_length=500, null=True)),
("name", models.CharField(blank=True, max_length=500, null=True)),
("summary", models.TextField(blank=True, null=True)),
- ("actor_uri", models.CharField(blank=True, max_length=500, null=True)),
+ (
+ "manually_approves_followers",
+ models.BooleanField(blank=True, null=True),
+ ),
(
"profile_uri",
models.CharField(blank=True, max_length=500, null=True),
@@ -130,11 +164,6 @@ class Migration(migrations.Migration):
),
),
),
- ("local", models.BooleanField()),
- (
- "manually_approves_followers",
- models.BooleanField(blank=True, null=True),
- ),
("private_key", models.TextField(blank=True, null=True)),
("public_key", models.TextField(blank=True, null=True)),
("created", models.DateTimeField(auto_now_add=True)),
@@ -142,12 +171,25 @@ class Migration(migrations.Migration):
("fetched", models.DateTimeField(blank=True, null=True)),
("deleted", models.DateTimeField(blank=True, null=True)),
(
+ "domain",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.PROTECT,
+ to="users.domain",
+ ),
+ ),
+ (
"users",
models.ManyToManyField(
related_name="identities", to=settings.AUTH_USER_MODEL
),
),
],
+ options={
+ "verbose_name_plural": "identities",
+ "unique_together": {("username", "domain")},
+ },
),
migrations.CreateModel(
name="Follow",
@@ -182,4 +224,39 @@ class Migration(migrations.Migration):
),
],
),
+ migrations.CreateModel(
+ name="Block",
+ fields=[
+ (
+ "id",
+ models.BigAutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ ("mute", models.BooleanField()),
+ ("expires", models.DateTimeField(blank=True, null=True)),
+ ("note", models.TextField(blank=True, null=True)),
+ ("created", models.DateTimeField(auto_now_add=True)),
+ ("updated", models.DateTimeField(auto_now=True)),
+ (
+ "source",
+ models.ForeignKey(
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="outbound_blocks",
+ to="users.identity",
+ ),
+ ),
+ (
+ "target",
+ models.ForeignKey(
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="inbound_blocks",
+ to="users.identity",
+ ),
+ ),
+ ],
+ ),
]