diff options
author | Andrew Godwin | 2022-12-10 21:03:14 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-12-12 11:56:49 -0700 |
commit | 1017c71ba1d80a1690e357a938ad46f246a456ae (patch) | |
tree | ffe6172f5f38bb1c8aac3c42ada272bba40348e7 /api/migrations | |
parent | a8d1450763bea6f8d5388633b62a92c7d89913b6 (diff) | |
download | takahe-1017c71ba1d80a1690e357a938ad46f246a456ae.tar.gz takahe-1017c71ba1d80a1690e357a938ad46f246a456ae.tar.bz2 takahe-1017c71ba1d80a1690e357a938ad46f246a456ae.zip |
Working start of an OAuth flow
Diffstat (limited to 'api/migrations')
-rw-r--r-- | api/migrations/0001_initial.py | 87 | ||||
-rw-r--r-- | api/migrations/__init__.py | 0 |
2 files changed, 87 insertions, 0 deletions
diff --git a/api/migrations/0001_initial.py b/api/migrations/0001_initial.py new file mode 100644 index 0000000..e9d37f3 --- /dev/null +++ b/api/migrations/0001_initial.py @@ -0,0 +1,87 @@ +# Generated by Django 4.1.3 on 2022-12-11 03:39 + +import django.db.models.deletion +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ("users", "0003_identity_followers_etc"), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name="Application", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("client_id", models.CharField(max_length=500)), + ("client_secret", models.CharField(max_length=500)), + ("redirect_uris", models.TextField()), + ("scopes", models.TextField()), + ("name", models.CharField(max_length=500)), + ("website", models.CharField(blank=True, max_length=500, null=True)), + ("created", models.DateTimeField(auto_now_add=True)), + ("updated", models.DateTimeField(auto_now=True)), + ], + ), + migrations.CreateModel( + name="Token", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("token", models.CharField(max_length=500)), + ("code", models.CharField(blank=True, max_length=100, null=True)), + ("scopes", models.JSONField()), + ("created", models.DateTimeField(auto_now_add=True)), + ("updated", models.DateTimeField(auto_now=True)), + ( + "application", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="tokens", + to="api.application", + ), + ), + ( + "identity", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="tokens", + to="users.identity", + ), + ), + ( + "user", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="tokens", + to=settings.AUTH_USER_MODEL, + ), + ), + ], + ), + ] diff --git a/api/migrations/__init__.py b/api/migrations/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/api/migrations/__init__.py |