summaryrefslogtreecommitdiffstats
path: root/users/migrations/0001_initial.py
diff options
context:
space:
mode:
Diffstat (limited to 'users/migrations/0001_initial.py')
-rw-r--r--users/migrations/0001_initial.py79
1 files changed, 71 insertions, 8 deletions
diff --git a/users/migrations/0001_initial.py b/users/migrations/0001_initial.py
index a51ef00..d8ab363 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-11 20:02
+# Generated by Django 4.1.3 on 2022-11-18 17:49
import functools
@@ -6,10 +6,12 @@ import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
+import core.uploads
import stator.models
import users.models.follow
import users.models.identity
import users.models.inbox_message
+import users.models.password_reset
class Migration(migrations.Migration):
@@ -45,6 +47,7 @@ class Migration(migrations.Migration):
("deleted", models.BooleanField(default=False)),
("created", models.DateTimeField(auto_now_add=True)),
("updated", models.DateTimeField(auto_now=True)),
+ ("last_seen", models.DateTimeField(auto_now_add=True)),
],
options={
"abstract": False,
@@ -70,6 +73,7 @@ class Migration(migrations.Migration):
("local", models.BooleanField()),
("blocked", models.BooleanField(default=False)),
("public", models.BooleanField(default=False)),
+ ("default", models.BooleanField(default=False)),
("created", models.DateTimeField(auto_now_add=True)),
("updated", models.DateTimeField(auto_now=True)),
(
@@ -112,6 +116,25 @@ class Migration(migrations.Migration):
},
),
migrations.CreateModel(
+ name="Invite",
+ fields=[
+ (
+ "id",
+ models.BigAutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ ("token", models.CharField(max_length=500, unique=True)),
+ ("email", models.EmailField(blank=True, max_length=254, null=True)),
+ ("note", models.TextField(blank=True, null=True)),
+ ("created", models.DateTimeField(auto_now_add=True)),
+ ("updated", models.DateTimeField(auto_now=True)),
+ ],
+ ),
+ migrations.CreateModel(
name="UserEvent",
fields=[
(
@@ -147,6 +170,48 @@ class Migration(migrations.Migration):
],
),
migrations.CreateModel(
+ name="PasswordReset",
+ fields=[
+ (
+ "id",
+ models.BigAutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ ("state_ready", models.BooleanField(default=True)),
+ ("state_changed", models.DateTimeField(auto_now_add=True)),
+ ("state_attempted", models.DateTimeField(blank=True, null=True)),
+ ("state_locked_until", models.DateTimeField(blank=True, null=True)),
+ (
+ "state",
+ stator.models.StateField(
+ choices=[("new", "new"), ("sent", "sent")],
+ default="new",
+ graph=users.models.password_reset.PasswordResetStates,
+ max_length=100,
+ ),
+ ),
+ ("token", models.CharField(max_length=500, unique=True)),
+ ("new_account", models.BooleanField()),
+ ("created", models.DateTimeField(auto_now_add=True)),
+ ("updated", models.DateTimeField(auto_now=True)),
+ (
+ "user",
+ models.ForeignKey(
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="password_resets",
+ to=settings.AUTH_USER_MODEL,
+ ),
+ ),
+ ],
+ options={
+ "abstract": False,
+ },
+ ),
+ migrations.CreateModel(
name="Identity",
fields=[
(
@@ -194,9 +259,7 @@ class Migration(migrations.Migration):
blank=True,
null=True,
upload_to=functools.partial(
- users.models.identity.upload_namer,
- *("profile_images",),
- **{},
+ core.uploads.upload_namer, *("profile_images",), **{}
),
),
),
@@ -206,14 +269,13 @@ class Migration(migrations.Migration):
blank=True,
null=True,
upload_to=functools.partial(
- users.models.identity.upload_namer,
- *("background_images",),
- **{},
+ core.uploads.upload_namer, *("background_images",), **{}
),
),
),
("private_key", models.TextField(blank=True, null=True)),
("public_key", models.TextField(blank=True, null=True)),
+ ("public_key_id", models.TextField(blank=True, null=True)),
("created", models.DateTimeField(auto_now_add=True)),
("updated", models.DateTimeField(auto_now=True)),
("fetched", models.DateTimeField(blank=True, null=True)),
@@ -224,6 +286,7 @@ class Migration(migrations.Migration):
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
+ related_name="identities",
to="users.domain",
),
),
@@ -302,7 +365,7 @@ class Migration(migrations.Migration):
("local_requested", "local_requested"),
("remote_requested", "remote_requested"),
("accepted", "accepted"),
- ("undone_locally", "undone_locally"),
+ ("undone", "undone"),
("undone_remotely", "undone_remotely"),
],
default="unrequested",