|
|
|
|
@@ -0,0 +1,78 @@
|
|
|
|
|
# Generated by Django 5.2.7 on 2026-04-27 09:33
|
|
|
|
|
|
|
|
|
|
import django.db.models.deletion
|
|
|
|
|
from django.db import migrations, models
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
|
('accounts', '0003_user_avatar'),
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
|
migrations.CreateModel(
|
|
|
|
|
name='PermissionToAction',
|
|
|
|
|
fields=[
|
|
|
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
|
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
|
|
|
('name', models.CharField(max_length=200)),
|
|
|
|
|
('code', models.CharField(max_length=100, unique=True)),
|
|
|
|
|
],
|
|
|
|
|
options={
|
|
|
|
|
'verbose_name': 'Harakatlar uchun ruxsatnoma',
|
|
|
|
|
'verbose_name_plural': 'Harakatlar uchun ruxsatnomalar',
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
migrations.CreateModel(
|
|
|
|
|
name='PermissionToTab',
|
|
|
|
|
fields=[
|
|
|
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
|
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
|
|
|
('name', models.CharField(max_length=200)),
|
|
|
|
|
('code', models.CharField(max_length=100, unique=True)),
|
|
|
|
|
('permission_to_actions', models.ManyToManyField(related_name='permission_to_tabs', to='accounts.permissiontoaction')),
|
|
|
|
|
],
|
|
|
|
|
options={
|
|
|
|
|
'verbose_name': "Bo'lim uchun ruxsatnoma",
|
|
|
|
|
'verbose_name_plural': "Bo'lim uchun ruxsatnomalar",
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
migrations.CreateModel(
|
|
|
|
|
name='Permission',
|
|
|
|
|
fields=[
|
|
|
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
|
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
|
|
|
('name', models.CharField(max_length=200)),
|
|
|
|
|
('code', models.CharField(max_length=100, unique=True)),
|
|
|
|
|
('permission_tab', models.ManyToManyField(related_name='permissions', to='accounts.permissiontotab')),
|
|
|
|
|
],
|
|
|
|
|
options={
|
|
|
|
|
'verbose_name': 'Sahifa uchun ruxsatnoma',
|
|
|
|
|
'verbose_name_plural': 'Sahifa uchun ruxsatnomalar',
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
migrations.CreateModel(
|
|
|
|
|
name='Role',
|
|
|
|
|
fields=[
|
|
|
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
|
('name', models.CharField(max_length=200, unique=True)),
|
|
|
|
|
('comment', models.CharField(blank=True, max_length=200, null=True)),
|
|
|
|
|
('permission_to_actions', models.ManyToManyField(blank=True, related_name='roles', to='accounts.permissiontoaction')),
|
|
|
|
|
('permission_to_tabs', models.ManyToManyField(blank=True, related_name='roles', to='accounts.permissiontotab')),
|
|
|
|
|
('permissions', models.ManyToManyField(blank=True, related_name='roles', to='accounts.permission')),
|
|
|
|
|
],
|
|
|
|
|
options={
|
|
|
|
|
'verbose_name': 'Rol',
|
|
|
|
|
'verbose_name_plural': 'Rollar',
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
migrations.AddField(
|
|
|
|
|
model_name='user',
|
|
|
|
|
name='permission',
|
|
|
|
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='users', to='accounts.role'),
|
|
|
|
|
),
|
|
|
|
|
]
|