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
54 lines (48 loc) · 1.71 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
# Generated by Django 5.0.7 on 2024-08-06 12:56
import django.core.validators
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(max_length=100)),
('description', models.TextField()),
],
),
migrations.CreateModel(
name='CarModel',
fields=[
('id',
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID')),
('name', models.CharField(max_length=100)),
('type', models.CharField(
choices=[('SEDAN',
'Sedan'), ('SUV', 'SUV'),
('WAGON', 'Wagon')],
default='SUV', max_length=10)),
('year', models.IntegerField(
default=2023,
validators=[
django.core.validators.MaxValueValidator(2023),
django.core.validators.MinValueValidator(2015)])),
('car_make',
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to='djangoapp.carmake')),
],
),
]