Coverage for audoma_api/migrations/0003_car_manufacturer.py: 0%

1# Generated by Django 3.2.12 on 2022-06-20 10:14

2

3 import django.db.models.deletion

4 from django.db import (

5 migrations,

6 models,

7)

8

9 import audoma.django.db.fields

10

11

12 class Migration(migrations.Migration):

13

14 dependencies = [

15 ("audoma_api", "0002_alter_examplemodel_json_and_more"),

16 ]

17

18 operations = [

19 migrations.CreateModel(

20 name="Manufacturer",

21 fields=[

22 (

23 "id",

24 models.BigAutoField(

25 auto_created=True,

26 primary_key=True,

27 serialize=False,

28 verbose_name="ID",

29 ),

30 ),

31 ("name", audoma.django.db.fields.CharField(max_length=255)),

32 ("slug_name", audoma.django.db.fields.SlugField()),

33 ],

34 ),

35 migrations.CreateModel(

36 name="Car",

37 fields=[

38 (

39 "id",

40 models.BigAutoField(

41 auto_created=True,

42 primary_key=True,

43 serialize=False,

44 verbose_name="ID",

45 ),

46 ),

47 ("name", audoma.django.db.fields.CharField(max_length=255)),

48 (

49 "body_type",

50 audoma.django.db.fields.IntegerField(

51 choices=[

52 (1, "Sedan"),

53 (2, "Coupe"),

54 (3, "Hatchback"),

55 (4, "Pickup Truck"),

56 ]

57 ),

58 ),

59 ("engine_size", audoma.django.db.fields.FloatField()),

60 (

61 "engine_type",

62 audoma.django.db.fields.IntegerField(

63 choices=[

64 (1, "Petrol"),

65 (2, "Diesel"),

66 (3, "Electric"),

67 (4, "Hybrid"),

68 ]

69 ),

70 ),

71 (

72 "manufacturer",

73 models.ForeignKey(

74 on_delete=django.db.models.deletion.CASCADE,

75 to="audoma_api.manufacturer",

76 ),

77 ),

78 ],

79 ),

80 ]