|
| 1 | +# Generated by Django 4.1.3 on 2023-01-12 10:42 |
| 2 | + |
| 3 | +from django.db import migrations, models |
| 4 | +import django.db.models.deletion |
| 5 | + |
| 6 | + |
| 7 | +class Migration(migrations.Migration): |
| 8 | + |
| 9 | + initial = True |
| 10 | + |
| 11 | + dependencies = [ |
| 12 | + ] |
| 13 | + |
| 14 | + operations = [ |
| 15 | + migrations.CreateModel( |
| 16 | + name='Journalist', |
| 17 | + fields=[ |
| 18 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 19 | + ('first_name', models.CharField(max_length=60)), |
| 20 | + ('last_name', models.CharField(max_length=60)), |
| 21 | + ('bio', models.CharField(max_length=200)), |
| 22 | + ], |
| 23 | + ), |
| 24 | + migrations.CreateModel( |
| 25 | + name='Article', |
| 26 | + fields=[ |
| 27 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 28 | + ('title', models.CharField(max_length=120)), |
| 29 | + ('description', models.CharField(max_length=200)), |
| 30 | + ('body', models.TextField()), |
| 31 | + ('location', models.CharField(max_length=120)), |
| 32 | + ('publication_date', models.DateField()), |
| 33 | + ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='articles', to='news_app.journalist')), |
| 34 | + ], |
| 35 | + ), |
| 36 | + ] |
0 commit comments