generated from ibm-developer-skills-network/coding-project-template
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
Copy path0001_initial.py
84 lines (78 loc) · 2.84 KB
/
0001_initial.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Generated by Django 5.1.3 on 2024-12-04 03:50
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='CarMake',
fields=[
('id', models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID'
)),
('name', models.CharField(
help_text='The name of the car make.',
max_length=100,
unique=True
)),
('description', models.TextField(
blank=True,
help_text='A brief description of the car make.'
)),
('country_of_origin', models.CharField(
blank=True,
help_text='The country where the car make originates.',
max_length=100
)),
('established_year', models.PositiveIntegerField(
blank=True,
help_text='The year the car make was established.',
null=True)),
],
),
migrations.CreateModel(
name='CarModel',
fields=[
('id', models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID'
)),
('dealer_id', models.IntegerField(
help_text='The dealer ID associated with this car model.'
)),
('name', models.CharField(
help_text='The name of the car model.',
max_length=100
)),
('type', models.CharField(
choices=[
('Sedan', 'Sedan'),
('SUV', 'SUV'),
('Wagon', 'Wagon')
],
help_text='The type of car model.', max_length=10
)),
('year', models.DateField(
help_text='The year this car model was manufactured.'
)),
('color', models.CharField(
blank=True,
help_text='The color of the car model.',
max_length=50
)),
('car_make', models.ForeignKey(
help_text='The car make this model belongs to.',
on_delete=django.db.models.deletion.CASCADE,
related_name='car_models',
to='djangoapp.carmake'
)),
],
),
]