0001_initial.py 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Generated by Django 3.2 on 2021-07-17 20:05
  2. from django.db import migrations, models
  3. class Migration(migrations.Migration):
  4. initial = True
  5. dependencies = [
  6. ]
  7. operations = [
  8. migrations.CreateModel(
  9. name='Permission',
  10. fields=[
  11. ('id', models.CharField(default='TestLaboratory_V1_Permission_1', max_length=50, primary_key=True, serialize=False, unique=True, verbose_name='权限ID')),
  12. ('name', models.CharField(max_length=25, verbose_name='权限名')),
  13. ('url', models.URLField(blank=True, max_length=125, null=True, verbose_name='URL')),
  14. ('method', models.CharField(max_length=20, null=True, verbose_name='方法')),
  15. ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
  16. ('update_time', models.DateTimeField(auto_now=True, verbose_name='修改时间')),
  17. ('delete', models.BooleanField(default=False)),
  18. ],
  19. options={
  20. 'verbose_name': '权限',
  21. 'verbose_name_plural': '权限',
  22. 'db_table': 'permission',
  23. },
  24. ),
  25. migrations.CreateModel(
  26. name='Role',
  27. fields=[
  28. ('id', models.CharField(default='TestLaboratory_V1_Role_1', max_length=50, primary_key=True, serialize=False, unique=True, verbose_name='角色ID')),
  29. ('name', models.CharField(max_length=25, unique=True, verbose_name='角色名')),
  30. ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
  31. ('update_time', models.DateTimeField(auto_now=True, verbose_name='修改时间')),
  32. ('delete', models.BooleanField(default=False)),
  33. ('permissions', models.ManyToManyField(blank=True, to='user.Permission', verbose_name='权限信息')),
  34. ],
  35. options={
  36. 'verbose_name': '角色',
  37. 'verbose_name_plural': '角色',
  38. 'db_table': 'role',
  39. },
  40. ),
  41. migrations.CreateModel(
  42. name='User',
  43. fields=[
  44. ('id', models.CharField(default='TestLaboratory_V1_User_1', max_length=50, primary_key=True, serialize=False, unique=True, verbose_name='用户编号')),
  45. ('username', models.CharField(max_length=30, unique=True, verbose_name='用户名')),
  46. ('name', models.CharField(max_length=20, verbose_name='姓名')),
  47. ('password', models.CharField(default='123456', max_length=60, verbose_name='密码')),
  48. ('tel', models.CharField(max_length=20, verbose_name='联系方式')),
  49. ('identify', models.IntegerField(verbose_name='身份信息')),
  50. ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
  51. ('update_time', models.DateTimeField(auto_now=True, verbose_name='修改时间')),
  52. ('is_login', models.BooleanField(default=False)),
  53. ('delete', models.BooleanField(default=False)),
  54. ('roles', models.ManyToManyField(blank=True, to='user.Role', verbose_name='角色信息')),
  55. ],
  56. options={
  57. 'verbose_name': '用户',
  58. 'verbose_name_plural': '用户',
  59. 'db_table': 'user',
  60. },
  61. ),
  62. ]