Merge pull request 'fix migrations error' (#101) from behruz into main
Some checks failed
Deploy to Production / build-and-deploy (push) Failing after 2m3s
Some checks failed
Deploy to Production / build-and-deploy (push) Failing after 2m3s
Reviewed-on: #101
This commit is contained in:
@@ -0,0 +1,78 @@
|
|||||||
|
# Generated by Django 5.2.7 on 2026-04-24 12:55
|
||||||
|
|
||||||
|
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'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -18,7 +18,7 @@ class User(auth_models.AbstractUser):
|
|||||||
default=RoleChoice.USER,
|
default=RoleChoice.USER,
|
||||||
)
|
)
|
||||||
avatar = models.ImageField(upload_to="avatars/", null=True, blank=True)
|
avatar = models.ImageField(upload_to="avatars/", null=True, blank=True)
|
||||||
permission = models.ForeignKey(Role, on_delete=models.SET_NULL, null=True)
|
permission = models.ForeignKey(Role, on_delete=models.SET_NULL, null=True, blank=True, related_name='users')
|
||||||
|
|
||||||
USERNAME_FIELD = "phone"
|
USERNAME_FIELD = "phone"
|
||||||
objects = UserManager()
|
objects = UserManager()
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 5.2.7 on 2026-04-24 12:55
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('evaluation', '0034_remove_certificatemodel_file_url_and_more'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='autoevaluationmodel',
|
||||||
|
name='is_archived',
|
||||||
|
field=models.BooleanField(default=False, verbose_name='is archived'),
|
||||||
|
),
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user