Skip to content
Snippets Groups Projects
Verified Commit b53be71b authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

Make TextFields not nullable. The Right Way.

1. remove the fields
2. re-add the fields as not-nullable.
parent 479cde49
No related branches found
No related tags found
No related merge requests found
Pipeline #3272 passed
# Generated by Django 3.2.18 on 2023-04-18 22:38
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('program', '0056_auto_20230419_0017'),
]
operations = [
migrations.RemoveField(
model_name='category',
name='subtitle',
),
migrations.RemoveField(
model_name='host',
name='biography',
),
migrations.RemoveField(
model_name='note',
name='playlist',
),
migrations.RemoveField(
model_name='note',
name='tags',
),
migrations.RemoveField(
model_name='show',
name='description',
),
migrations.RemoveField(
model_name='show',
name='internal_note',
),
]
# Generated by Django 3.2.18 on 2023-04-18 22:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('program', '0057_auto_20230419_0038'),
]
operations = [
migrations.AddField(
model_name='category',
name='subtitle',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='host',
name='biography',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='note',
name='playlist',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='note',
name='tags',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='show',
name='description',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='show',
name='internal_note',
field=models.TextField(blank=True),
),
]
......@@ -54,7 +54,7 @@ class Category(models.Model):
is_active = models.BooleanField(default=True)
name = models.CharField(max_length=32)
slug = models.SlugField(max_length=32, unique=True)
subtitle = models.TextField(blank=True, null=True)
subtitle = models.TextField(blank=True)
class Meta:
ordering = ("name",)
......@@ -144,7 +144,7 @@ class Image(models.Model):
class Host(models.Model):
biography = models.TextField(blank=True, null=True)
biography = models.TextField(blank=True)
created_at = models.DateTimeField(auto_now_add=True)
created_by = models.CharField(max_length=150)
email = models.EmailField(blank=True)
......@@ -204,7 +204,7 @@ class Show(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
created_by = models.CharField(max_length=150)
default_playlist_id = models.IntegerField(blank=True, null=True)
description = models.TextField(blank=True, null=True)
description = models.TextField(blank=True)
email = models.EmailField(blank=True, null=True)
funding_category = models.ForeignKey(
FundingCategory,
......@@ -215,7 +215,7 @@ class Show(models.Model):
)
hosts = models.ManyToManyField(Host, blank=True, related_name="shows")
image = models.ForeignKey(Image, null=True, on_delete=models.CASCADE, related_name="shows")
internal_note = models.TextField(blank=True, null=True)
internal_note = models.TextField(blank=True)
is_active = models.BooleanField(default=True)
is_public = models.BooleanField(default=False)
language = models.ManyToManyField(Language, blank=True, related_name="shows")
......@@ -467,10 +467,10 @@ class Note(models.Model):
related_name="notes",
default=1,
)
playlist = models.TextField(blank=True, null=True)
playlist = models.TextField(blank=True)
slug = models.SlugField(max_length=32, unique=True)
summary = models.TextField(blank=True)
tags = models.TextField(blank=True, null=True)
tags = models.TextField(blank=True)
timeslot = models.OneToOneField(TimeSlot, on_delete=models.CASCADE, unique=True)
title = models.CharField(max_length=128)
updated_at = models.DateTimeField(auto_now=True, blank=True, null=True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment