You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
2.3 KiB
50 lines
2.3 KiB
# Generated by Django 5.1 on 2025-02-06 11:23
|
|
|
|
import django.db.models.deletion
|
|
import django.utils.timezone
|
|
import uuid
|
|
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(
|
|
name='DataAccess',
|
|
fields=[
|
|
('creation_date', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
|
|
('last_update', models.DateTimeField(default=django.utils.timezone.now)),
|
|
('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
|
|
('model_name', models.CharField(max_length=50)),
|
|
('model_id', models.UUIDField()),
|
|
('granted_at', models.DateTimeField(auto_now_add=True)),
|
|
('last_updated_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
|
|
('related_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
|
|
('shared_with', models.ManyToManyField(related_name='shared_data', to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='ModelLog',
|
|
fields=[
|
|
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
|
('model_id', models.UUIDField()),
|
|
('operation', models.CharField(choices=[('POST', 'POST'), ('PUT', 'PUT'), ('DELETE', 'DELETE'), ('GRANT_ACCESS', 'GRANT_ACCESS'), ('REVOKE_ACCESS', 'REVOKE_ACCESS')], max_length=50)),
|
|
('date', models.DateTimeField()),
|
|
('model_name', models.CharField(max_length=50)),
|
|
('store_id', models.CharField(blank=True, max_length=200, null=True)),
|
|
('device_id', models.CharField(blank=True, max_length=200, null=True)),
|
|
('count', models.IntegerField(default=0)),
|
|
('users', models.ManyToManyField(blank=True, related_name='model_logs', to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
),
|
|
]
|
|
|