0001_initial.py 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Generated by Django 4.0.3 on 2022-03-31 04:12
  2. import django.core.validators
  3. from django.db import migrations, models
  4. import django.db.models.deletion
  5. import django_extensions.db.fields
  6. import games.models
  7. class Migration(migrations.Migration):
  8. initial = True
  9. dependencies = [
  10. ]
  11. operations = [
  12. migrations.CreateModel(
  13. name='Developer',
  14. fields=[
  15. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  16. ('name', models.CharField(max_length=255)),
  17. ('slug', django_extensions.db.fields.AutoSlugField(blank=True, editable=False, populate_from='name')),
  18. ],
  19. options={
  20. 'abstract': False,
  21. },
  22. ),
  23. migrations.CreateModel(
  24. name='GameSystem',
  25. fields=[
  26. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  27. ('name', models.CharField(max_length=255)),
  28. ('slug', django_extensions.db.fields.AutoSlugField(blank=True, editable=False, populate_from='name')),
  29. ('retropie_slug', models.CharField(blank=True, max_length=50, null=True)),
  30. ],
  31. options={
  32. 'abstract': False,
  33. },
  34. ),
  35. migrations.CreateModel(
  36. name='Genre',
  37. fields=[
  38. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  39. ('name', models.CharField(max_length=255)),
  40. ('slug', django_extensions.db.fields.AutoSlugField(blank=True, editable=False, populate_from='name')),
  41. ],
  42. options={
  43. 'abstract': False,
  44. },
  45. ),
  46. migrations.CreateModel(
  47. name='Publisher',
  48. fields=[
  49. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  50. ('name', models.CharField(max_length=255)),
  51. ('slug', django_extensions.db.fields.AutoSlugField(blank=True, editable=False, populate_from='name')),
  52. ],
  53. options={
  54. 'abstract': False,
  55. },
  56. ),
  57. migrations.CreateModel(
  58. name='Game',
  59. fields=[
  60. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  61. ('name', models.CharField(max_length=255)),
  62. ('slug', django_extensions.db.fields.AutoSlugField(blank=True, editable=False, populate_from='name')),
  63. ('release_date', models.DateTimeField(blank=True, null=True)),
  64. ('players', models.SmallIntegerField()),
  65. ('kid_game', models.BooleanField(default=False)),
  66. ('description', models.TextField(blank=True, null=True)),
  67. ('rating', models.FloatField(blank=True, null=True, validators=[django.core.validators.MaxValueValidator(1), django.core.validators.MinValueValidator(0)])),
  68. ('video', models.FileField(blank=True, null=True, upload_to=games.models.get_video_upload_path)),
  69. ('marquee', models.FileField(blank=True, null=True, upload_to=games.models.get_marquee_upload_path)),
  70. ('screenshot', models.FileField(blank=True, null=True, upload_to=games.models.get_screenshot_upload_path)),
  71. ('rom_file', models.FileField(blank=True, null=True, upload_to=games.models.get_rom_upload_path)),
  72. ('developer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='games.publisher')),
  73. ('game_system', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='games.gamesystem')),
  74. ('genre', models.ManyToManyField(to='games.genre')),
  75. ('publisher', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='games.developer')),
  76. ],
  77. options={
  78. 'abstract': False,
  79. },
  80. ),
  81. ]