# Generated by Django 3.2.16 on 2023-04-01 21:07 import django.contrib.auth.models import django.contrib.auth.validators from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ('auth', '0012_alter_user_first_name_max_length'), ] operations = [ migrations.CreateModel( name='Menu', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')), ('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')), ('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')), ('number', models.IntegerField(blank=True, null=True, verbose_name='排序数字')), ('url', models.CharField(blank=True, max_length=256, null=True, verbose_name='菜单访问的URL')), ('name', models.CharField(max_length=50, verbose_name='菜单名字')), ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='erp_system.menu')), ], options={ 'verbose_name': '功能菜单', 'verbose_name_plural': '功能菜单', 'db_table': 't_menu', 'ordering': ['number'], }, ), migrations.CreateModel( name='PermissionsModel', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')), ('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')), ('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')), ('name', models.CharField(max_length=50, verbose_name='权限名')), ('is_menu', models.BooleanField(default=True, verbose_name='是否为菜单')), ('method', models.CharField(blank=True, choices=[('POST', '增'), ('DELETE', '删'), ('PUT', '改'), ('PATCH', '改局部'), ('GET', '查')], default='', max_length=8, verbose_name='请求方法')), ('path', models.CharField(blank=True, default='', max_length=200, verbose_name='请求路径')), ('desc', models.CharField(blank=True, default='', max_length=512, verbose_name='权限描述')), ('menu', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='permissions_list', to='erp_system.menu')), ], options={ 'verbose_name': '权限', 'verbose_name_plural': '权限', 'db_table': 't_permissions', 'ordering': ['id'], }, ), migrations.CreateModel( name='RolesModel', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')), ('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')), ('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')), ('name', models.CharField(max_length=32, unique=True, verbose_name='角色名字')), ('permissions', models.ManyToManyField(blank=True, db_table='t_roles_permissions', to='erp_system.PermissionsModel', verbose_name='权限')), ], options={ 'verbose_name': '角色', 'verbose_name_plural': '角色', 'db_table': 't_roles', }, ), migrations.CreateModel( name='DeptModel', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')), ('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')), ('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')), ('name', models.CharField(max_length=32, unique=True, verbose_name='部门')), ('address', models.CharField(blank=True, default='', max_length=128, verbose_name='部门地址')), ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='erp_system.deptmodel', verbose_name='父部门')), ], options={ 'verbose_name': '部门', 'verbose_name_plural': '部门', 'db_table': 't_dept', }, ), migrations.CreateModel( name='UserModel', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('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')), ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')), ('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')), ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')), ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')), ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')), ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')), ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')), ('phone', models.CharField(blank=True, max_length=11, null=True, unique=True, verbose_name='手机号码')), ('real_name', models.CharField(blank=True, max_length=128, null=True, verbose_name='真实姓名')), ('dept', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='erp_system.deptmodel', verbose_name='用户所在的部门')), ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')), ('roles', models.ManyToManyField(blank=True, db_table='t_users_roles', to='erp_system.RolesModel', verbose_name='用户所拥有的角色列表')), ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')), ], options={ 'verbose_name': '功能菜单', 'verbose_name_plural': '功能菜单', 'db_table': 't_user', 'ordering': ['id'], }, managers=[ ('objects', django.contrib.auth.models.UserManager()), ], ), ]