Skip to content

Commit

Permalink
make user a required field for DataFile model
Browse files Browse the repository at this point in the history
  • Loading branch information
mathemancer committed Jan 22, 2025
1 parent 4a0cf4b commit b746d70
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mathesar/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='datafile',
name='user',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='database',
Expand Down
2 changes: 1 addition & 1 deletion mathesar/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def _user_directory_path(instance, filename):
file_type_choices = models.TextChoices("type", "CSV TSV JSON")

file = models.FileField(upload_to=_user_directory_path)
user = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True, on_delete=models.CASCADE)
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
created_from = models.CharField(max_length=128, choices=created_from_choices.choices)
type = models.CharField(max_length=128, choices=file_type_choices.choices)
base_name = models.CharField(max_length=100)
Expand Down

0 comments on commit b746d70

Please sign in to comment.