Files
eam-project/authentication/migrations/0021_historicaluser.py
T
2025-05-23 14:44:12 +08:00

61 lines
4.0 KiB
Python

# Generated by Django 3.2 on 2023-01-05 06:54
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import simple_history.models
import uuid
class Migration(migrations.Migration):
dependencies = [
('roles', '0003_alter_role_status'),
('dashboard', '0018_auto_20230104_1455'),
('authentication', '0020_alter_user_status'),
]
operations = [
migrations.CreateModel(
name='HistoricalUser',
fields=[
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('status', models.BooleanField(default=True)),
('created_at', models.DateTimeField(blank=True, editable=False)),
('updated_at', models.DateTimeField(blank=True, editable=False)),
('created_by', models.CharField(blank=True, max_length=255, null=True)),
('updated_by', models.CharField(blank=True, max_length=255, null=True)),
('is_deleted', models.BooleanField(default=False)),
('id', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False)),
('email', models.EmailField(db_index=True, max_length=255)),
('username', models.CharField(blank=True, max_length=255, null=True)),
('full_name', models.CharField(blank=True, max_length=255, null=True)),
('phone', models.CharField(blank=True, max_length=255, null=True)),
('profile_pic', models.TextField(blank=True, max_length=100, null=True)),
('employee_id', models.CharField(blank=True, max_length=45, null=True)),
('is_active', models.BooleanField(default=False)),
('is_staff', models.BooleanField(default=False)),
('access_level', models.BooleanField(choices=[(False, 'Only Assigned'), (True, 'All')], default=False)),
('history_id', models.AutoField(primary_key=True, serialize=False)),
('history_date', models.DateTimeField(db_index=True)),
('history_change_reason', models.CharField(max_length=100, null=True)),
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
('address', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='dashboard.address')),
('department', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='dashboard.department')),
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
('location', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='dashboard.location')),
('organization', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='dashboard.organization')),
('role', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='roles.role')),
],
options={
'verbose_name': 'historical user',
'verbose_name_plural': 'historical users',
'ordering': ('-history_date', '-history_id'),
'get_latest_by': ('history_date', 'history_id'),
},
bases=(simple_history.models.HistoricalChanges, models.Model),
),
]