34 lines
1.2 KiB
Python
34 lines
1.2 KiB
Python
# Generated by Django 3.1.7 on 2021-03-09 20:10
|
|
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='Post',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('title', models.CharField(max_length=200, unique=True)),
|
|
('slug', models.SlugField(max_length=200, unique=True)),
|
|
('updated_on', models.DateTimeField(auto_now=True)),
|
|
('content', models.TextField()),
|
|
('created_on', models.DateTimeField(auto_now_add=True)),
|
|
('status', models.IntegerField(choices=[(0, 'Draft'), (1, 'Publish')], default=0)),
|
|
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='blog_posts', to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
options={
|
|
'ordering': ['-created_on'],
|
|
},
|
|
),
|
|
]
|