0001_initial.py 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. # Copyright © 2023 Ingram Micro Inc. All rights reserved.
  2. import django.contrib.auth.validators
  3. import django.utils.timezone
  4. from django.db import migrations, models
  5. class Migration(migrations.Migration):
  6. initial = True
  7. dependencies = [
  8. ('auth', '0001_initial'),
  9. ]
  10. operations = [
  11. migrations.CreateModel(
  12. name='ProductType',
  13. fields=[
  14. (
  15. 'id',
  16. models.BigAutoField(
  17. auto_created=True,
  18. primary_key=True,
  19. serialize=False,
  20. verbose_name='ID',
  21. ),
  22. ),
  23. ('name', models.CharField(max_length=50)),
  24. ],
  25. ),
  26. migrations.CreateModel(
  27. name='Product',
  28. fields=[
  29. (
  30. 'id',
  31. models.BigAutoField(
  32. auto_created=True,
  33. primary_key=True,
  34. serialize=False,
  35. verbose_name='ID',
  36. ),
  37. ),
  38. ('cqrs_revision', models.IntegerField()),
  39. ('cqrs_updated', models.DateTimeField()),
  40. ('name', models.CharField(max_length=100)),
  41. (
  42. 'product_type',
  43. models.ForeignKey(
  44. on_delete=django.db.models.deletion.CASCADE,
  45. to='app.producttype',
  46. ),
  47. ),
  48. ],
  49. options={
  50. 'abstract': False,
  51. },
  52. ),
  53. migrations.CreateModel(
  54. name='User',
  55. fields=[
  56. (
  57. 'id',
  58. models.BigAutoField(
  59. auto_created=True,
  60. primary_key=True,
  61. serialize=False,
  62. verbose_name='ID',
  63. ),
  64. ),
  65. ('password', models.CharField(max_length=128, verbose_name='password')),
  66. (
  67. 'last_login',
  68. models.DateTimeField(blank=True, null=True, verbose_name='last login'),
  69. ),
  70. (
  71. 'is_superuser',
  72. models.BooleanField(
  73. default=False,
  74. help_text='Designates that this user has all permissions without explicitly assigning them.',
  75. verbose_name='superuser status',
  76. ),
  77. ),
  78. (
  79. 'username',
  80. models.CharField(
  81. error_messages={'unique': 'A user with that username already exists.'},
  82. help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
  83. max_length=150,
  84. unique=True,
  85. validators=[django.contrib.auth.validators.UnicodeUsernameValidator()],
  86. verbose_name='username',
  87. ),
  88. ),
  89. (
  90. 'first_name',
  91. models.CharField(blank=True, max_length=150, verbose_name='first name'),
  92. ),
  93. (
  94. 'last_name',
  95. models.CharField(blank=True, max_length=150, verbose_name='last name'),
  96. ),
  97. (
  98. 'email',
  99. models.EmailField(blank=True, max_length=254, verbose_name='email address'),
  100. ),
  101. (
  102. 'is_staff',
  103. models.BooleanField(
  104. default=False,
  105. help_text='Designates whether the user can log into this admin site.',
  106. verbose_name='staff status',
  107. ),
  108. ),
  109. (
  110. 'is_active',
  111. models.BooleanField(
  112. default=True,
  113. help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
  114. verbose_name='active',
  115. ),
  116. ),
  117. (
  118. 'date_joined',
  119. models.DateTimeField(
  120. default=django.utils.timezone.now,
  121. verbose_name='date joined',
  122. ),
  123. ),
  124. ('cqrs_revision', models.IntegerField()),
  125. ('cqrs_updated', models.DateTimeField()),
  126. (
  127. 'groups',
  128. models.ManyToManyField(
  129. blank=True,
  130. help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.',
  131. related_name='user_set',
  132. related_query_name='user',
  133. to='auth.Group',
  134. verbose_name='groups',
  135. ),
  136. ),
  137. (
  138. 'user_permissions',
  139. models.ManyToManyField(
  140. blank=True,
  141. help_text='Specific permissions for this user.',
  142. related_name='user_set',
  143. related_query_name='user',
  144. to='auth.Permission',
  145. verbose_name='user permissions',
  146. ),
  147. ),
  148. ],
  149. options={
  150. 'abstract': False,
  151. },
  152. ),
  153. ]