First commit
This commit is contained in:
35
app/website/migrations/0001_initial.py
Normal file
35
app/website/migrations/0001_initial.py
Normal file
@ -0,0 +1,35 @@
|
||||
# Generated by Django 4.0 on 2022-04-29 06:43
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Post',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('title', models.CharField(max_length=200, unique=True)),
|
||||
('author', models.CharField(max_length=20)),
|
||||
('content', models.TextField()),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Comment',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=20)),
|
||||
('content', models.TextField()),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='website.post')),
|
||||
],
|
||||
),
|
||||
]
|
18
app/website/migrations/0002_rename_name_comment_author.py
Normal file
18
app/website/migrations/0002_rename_name_comment_author.py
Normal file
@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.0 on 2022-04-29 06:57
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('website', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='comment',
|
||||
old_name='name',
|
||||
new_name='author',
|
||||
),
|
||||
]
|
17
app/website/migrations/0003_alter_post_options.py
Normal file
17
app/website/migrations/0003_alter_post_options.py
Normal file
@ -0,0 +1,17 @@
|
||||
# Generated by Django 4.0 on 2022-05-15 15:58
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('website', '0002_rename_name_comment_author'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='post',
|
||||
options={'ordering': ['-created_at']},
|
||||
),
|
||||
]
|
0
app/website/migrations/__init__.py
Normal file
0
app/website/migrations/__init__.py
Normal file
Reference in New Issue
Block a user