You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

41 lines
1.7 KiB

# Generated by Django 4.0.3 on 2022-04-26 13:48
import comments.models
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('posts', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='CommentAuthor',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('author_name', models.CharField(max_length=60, verbose_name='Имя автора')),
('author_secret_hash', models.CharField(blank=True, max_length=256, null=True, verbose_name='Хеш секрета')),
],
options={
'unique_together': {('author_name',)},
},
),
migrations.CreateModel(
name='Comment',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('nickname', models.CharField(blank=True, max_length=60, null=True, verbose_name='имя автора')),
('comment_text', models.TextField()),
('date', models.DateTimeField(default=django.utils.timezone.now)),
('author', models.ForeignKey(default=comments.models.get_anonym_id, on_delete=django.db.models.deletion.CASCADE, to='comments.commentauthor')),
('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='posts.post')),
('reply', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='comments.comment')),
],
),
]