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

Make CharFields not nullable. The Right Way.

1. remove the fields
2. re-add the fields as not-nullable.
parent f88b00df
No related branches found
No related tags found
No related merge requests found
Pipeline #3271 passed
# Generated by Django 3.2.18 on 2023-04-18 22:15
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('program', '0054_alter_schedule_last_date'),
]
operations = [
migrations.RemoveField(
model_name='host',
name='updated_by',
),
migrations.RemoveField(
model_name='note',
name='updated_by',
),
migrations.RemoveField(
model_name='show',
name='updated_by',
),
migrations.RemoveField(
model_name='userprofile',
name='updated_by',
),
]
# Generated by Django 3.2.18 on 2023-04-18 22:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('program', '0055_auto_20230419_0015'),
]
operations = [
migrations.AddField(
model_name='host',
name='updated_by',
field=models.CharField(blank=True, default='', max_length=150),
),
migrations.AddField(
model_name='note',
name='updated_by',
field=models.CharField(blank=True, default='', max_length=150),
),
migrations.AddField(
model_name='show',
name='updated_by',
field=models.CharField(blank=True, default='', max_length=150),
),
migrations.AddField(
model_name='userprofile',
name='updated_by',
field=models.CharField(blank=True, default='', max_length=150),
),
]
......@@ -152,7 +152,7 @@ class Host(models.Model):
is_active = models.BooleanField(default=True)
name = models.CharField(max_length=128)
updated_at = models.DateTimeField(auto_now=True, blank=True, null=True)
updated_by = models.CharField(blank=True, max_length=150, null=True)
updated_by = models.CharField(blank=True, default="", max_length=150)
class Meta:
ordering = ("name",)
......@@ -244,7 +244,7 @@ class Show(models.Model):
Type, blank=True, null=True, on_delete=models.CASCADE, related_name="shows"
)
updated_at = models.DateTimeField(auto_now=True, blank=True, null=True)
updated_by = models.CharField(blank=True, max_length=150, null=True)
updated_by = models.CharField(blank=True, default="", max_length=150)
class Meta:
ordering = ("slug",)
......@@ -474,7 +474,7 @@ class Note(models.Model):
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)
updated_by = models.CharField(blank=True, max_length=150, null=True)
updated_by = models.CharField(blank=True, default="", max_length=150)
class Meta:
ordering = ("timeslot",)
......@@ -500,7 +500,7 @@ class UserProfile(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
created_by = models.CharField(max_length=150)
updated_at = models.DateTimeField(auto_now=True, blank=True, null=True)
updated_by = models.CharField(blank=True, max_length=150, null=True)
updated_by = models.CharField(blank=True, default="", max_length=150)
user = models.OneToOneField(
User,
on_delete=models.CASCADE,
......
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