2020-05-20 08:17:06 +01:00
|
|
|
# Generated by Django 3.0.6 on 2020-05-19 22:08
|
2018-11-23 16:05:41 +00:00
|
|
|
|
|
|
|
import uuid
|
|
|
|
|
2019-10-07 15:33:48 +01:00
|
|
|
import django.contrib.postgres.fields.jsonb
|
2018-11-23 16:05:41 +00:00
|
|
|
import django.db.models.deletion
|
|
|
|
from django.conf import settings
|
|
|
|
from django.db import migrations, models
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
initial = True
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
2020-05-20 08:17:06 +01:00
|
|
|
name="Event",
|
2018-11-23 16:05:41 +00:00
|
|
|
fields=[
|
2019-12-31 11:51:16 +00:00
|
|
|
(
|
2020-05-20 08:17:06 +01:00
|
|
|
"event_uuid",
|
2019-12-31 11:51:16 +00:00
|
|
|
models.UUIDField(
|
|
|
|
default=uuid.uuid4,
|
|
|
|
editable=False,
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"action",
|
|
|
|
models.TextField(
|
|
|
|
choices=[
|
2020-05-20 08:17:06 +01:00
|
|
|
("LOGIN", "login"),
|
|
|
|
("LOGIN_FAILED", "login_failed"),
|
|
|
|
("LOGOUT", "logout"),
|
|
|
|
("AUTHORIZE_APPLICATION", "authorize_application"),
|
|
|
|
("SUSPICIOUS_REQUEST", "suspicious_request"),
|
|
|
|
("SIGN_UP", "sign_up"),
|
|
|
|
("PASSWORD_RESET", "password_reset"),
|
|
|
|
("INVITE_CREATED", "invitation_created"),
|
|
|
|
("INVITE_USED", "invitation_used"),
|
|
|
|
("CUSTOM", "custom"),
|
2019-12-31 11:51:16 +00:00
|
|
|
]
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("date", models.DateTimeField(auto_now_add=True)),
|
|
|
|
("app", models.TextField()),
|
|
|
|
(
|
|
|
|
"context",
|
|
|
|
django.contrib.postgres.fields.jsonb.JSONField(
|
|
|
|
blank=True, default=dict
|
|
|
|
),
|
|
|
|
),
|
2020-05-20 08:17:06 +01:00
|
|
|
("client_ip", models.GenericIPAddressField(null=True)),
|
2019-12-31 11:51:16 +00:00
|
|
|
("created", models.DateTimeField(auto_now_add=True)),
|
|
|
|
(
|
|
|
|
"user",
|
|
|
|
models.ForeignKey(
|
|
|
|
null=True,
|
|
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
|
|
to=settings.AUTH_USER_MODEL,
|
|
|
|
),
|
|
|
|
),
|
2018-11-23 16:05:41 +00:00
|
|
|
],
|
|
|
|
options={
|
2020-05-20 08:17:06 +01:00
|
|
|
"verbose_name": "Audit Event",
|
|
|
|
"verbose_name_plural": "Audit Events",
|
2018-11-23 16:05:41 +00:00
|
|
|
},
|
|
|
|
),
|
|
|
|
]
|