summaryrefslogtreecommitdiffstats
path: root/users/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'users/migrations')
-rw-r--r--users/migrations/0001_initial.py79
-rw-r--r--users/migrations/0002_identity_public_key_id.py18
-rw-r--r--users/migrations/0003_user_last_seen_alter_identity_domain.py34
-rw-r--r--users/migrations/0004_passwordreset.py60
-rw-r--r--users/migrations/0005_invite.py32
5 files changed, 71 insertions, 152 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",
diff --git a/users/migrations/0002_identity_public_key_id.py b/users/migrations/0002_identity_public_key_id.py
deleted file mode 100644
index 3648c20..0000000
--- a/users/migrations/0002_identity_public_key_id.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# Generated by Django 4.1.3 on 2022-11-12 21:29
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ("users", "0001_initial"),
- ]
-
- operations = [
- migrations.AddField(
- model_name="identity",
- name="public_key_id",
- field=models.TextField(blank=True, null=True),
- ),
- ]
diff --git a/users/migrations/0003_user_last_seen_alter_identity_domain.py b/users/migrations/0003_user_last_seen_alter_identity_domain.py
deleted file mode 100644
index b6c49d1..0000000
--- a/users/migrations/0003_user_last_seen_alter_identity_domain.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# Generated by Django 4.1.3 on 2022-11-17 04:18
-
-import django.db.models.deletion
-import django.utils.timezone
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ("users", "0002_identity_public_key_id"),
- ]
-
- operations = [
- migrations.AddField(
- model_name="user",
- name="last_seen",
- field=models.DateTimeField(
- auto_now_add=True, default=django.utils.timezone.now
- ),
- preserve_default=False,
- ),
- migrations.AlterField(
- model_name="identity",
- name="domain",
- field=models.ForeignKey(
- blank=True,
- null=True,
- on_delete=django.db.models.deletion.PROTECT,
- related_name="identities",
- to="users.domain",
- ),
- ),
- ]
diff --git a/users/migrations/0004_passwordreset.py b/users/migrations/0004_passwordreset.py
deleted file mode 100644
index d996ff4..0000000
--- a/users/migrations/0004_passwordreset.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# Generated by Django 4.1.3 on 2022-11-18 01:40
-
-import django.db.models.deletion
-from django.conf import settings
-from django.db import migrations, models
-
-import stator.models
-import users.models.password_reset
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ("users", "0003_user_last_seen_alter_identity_domain"),
- ]
-
- operations = [
- 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,
- },
- ),
- ]
diff --git a/users/migrations/0005_invite.py b/users/migrations/0005_invite.py
deleted file mode 100644
index bb18841..0000000
--- a/users/migrations/0005_invite.py
+++ /dev/null
@@ -1,32 +0,0 @@
-# Generated by Django 4.1.3 on 2022-11-18 06:34
-
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
- dependencies = [
- ("users", "0004_passwordreset"),
- ]
-
- operations = [
- 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)),
- ],
- ),
- ]