From fcb0a2f0b458f5918d76654b4c2d5aaf135329a5 Mon Sep 17 00:00:00 2001 From: David Vogt Date: Thu, 21 Nov 2024 18:33:13 +0100 Subject: [PATCH] feat: widen token column a bit The 128 character limit implied a character limit of about 90 for file names. This is a bit too close to the practical limit of what users *actually* do, and if the limit is hit, LOCK calls fail with unexpected errors due to the DB not being able to deal with the token. Widening it to 255 chars should move the "hard limit" further away, thus reducing the chance of errors significantly. --- .../migrations/0002_alter_lock_token.py | 17 +++++++++++++++++ manabi_django/manabi_migrations/models.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 manabi_django/manabi_migrations/migrations/0002_alter_lock_token.py diff --git a/manabi_django/manabi_migrations/migrations/0002_alter_lock_token.py b/manabi_django/manabi_migrations/migrations/0002_alter_lock_token.py new file mode 100644 index 0000000..ef339ed --- /dev/null +++ b/manabi_django/manabi_migrations/migrations/0002_alter_lock_token.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.13 on 2024-11-21 17:32 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("manabi_migrations", "0001_initial"), + ] + + operations = [ + migrations.AlterField( + model_name="lock", + name="token", + field=models.CharField(max_length=255, primary_key=True, serialize=False), + ), + ] diff --git a/manabi_django/manabi_migrations/models.py b/manabi_django/manabi_migrations/models.py index 7387f68..0357a79 100644 --- a/manabi_django/manabi_migrations/models.py +++ b/manabi_django/manabi_migrations/models.py @@ -2,7 +2,7 @@ class Lock(models.Model): - token = models.CharField(max_length=128, primary_key=True) + token = models.CharField(max_length=255, primary_key=True) data = models.JSONField() class Meta: