0001_initial.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. # Generated by Django 4.0.4 on 2022-05-17 15:40
  2. from django.db import migrations, models
  3. import django.db.models.deletion
  4. import uuid
  5. class Migration(migrations.Migration):
  6. initial = True
  7. dependencies = [
  8. ]
  9. operations = [
  10. migrations.CreateModel(
  11. name='Image',
  12. fields=[
  13. ('_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
  14. ('url', models.ImageField(upload_to='uploads/')),
  15. ],
  16. ),
  17. migrations.CreateModel(
  18. name='Good',
  19. fields=[
  20. ('_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
  21. ('name', models.CharField(max_length=200, verbose_name='name')),
  22. ('description', models.CharField(max_length=1000, verbose_name='description')),
  23. ('price', models.IntegerField(default=0, verbose_name='price')),
  24. ('amount', models.IntegerField(default=0, verbose_name='price')),
  25. ('images', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to='goods.image')),
  26. ],
  27. ),
  28. ]