This repository has been archived on 2023-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
python-blog/articles/migrations/0024_auto_20201224_1746.py

33 lines
798 B
Python
Raw Normal View History

# Generated by Django 3.1.3 on 2020-12-24 16:46
from django.db import migrations, models
def forwards_func(apps, schema_editor):
Article = apps.get_model("articles", "Article")
db_alias = schema_editor.connection.alias
Article.objects.using(db_alias).filter(slug="about-me").update(is_home=True)
def reverse_func(apps, schema_editor):
pass
class Migration(migrations.Migration):
dependencies = [
("articles", "0023_article_has_code"),
]
operations = [
migrations.AddField(
model_name="article",
name="is_home",
field=models.BooleanField(blank=True, default=False),
),
migrations.DeleteModel(
name="Page",
),
migrations.RunPython(forwards_func, reverse_func),
]