Skip to content

Commit 7802cc9

Browse files
jn123456789arthurio
authored andcommitted
Reduce size of lock_id field to 191 characters so that indexing will work with utf8mb4 character set
1 parent 2db1463 commit 7802cc9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

db_mutex/migrations/0001_initial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Migration(migrations.Migration):
1414
name='DBMutex',
1515
fields=[
1616
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
17-
('lock_id', models.CharField(unique=True, max_length=255)),
17+
('lock_id', models.CharField(unique=True, max_length=191)),
1818
('creation_time', models.DateTimeField(auto_now_add=True)),
1919
],
2020
options={

db_mutex/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class DBMutex(models.Model):
1111
:type creation_time: datetime
1212
:param creation_time: The creation time of the mutex lock
1313
"""
14-
lock_id = models.CharField(max_length=255, unique=True)
14+
lock_id = models.CharField(max_length=191, unique=True)
1515
creation_time = models.DateTimeField(auto_now_add=True)
1616

1717
class Meta:

0 commit comments

Comments
 (0)