Skip to content

Commit

Permalink
fix: Add compound index when the indexed columns have the right size
Browse files Browse the repository at this point in the history
At the place of migration 0043, the columns together are too long. So it
fails with
> 'Specified key was too long; max key length is 3072 bytes

After most migrations are ran, the columns are resized and do fit in
that index size limitation.

https://dev.mysql.com/doc/refman/8.0/en/innodb-limits.html
>  The index key prefix length limit is 3072 bytes for InnoDB tables that use DYNAMIC or COMPRESSED row format.

We already have the "max" size possible, going over the 3072 is not
possible.
  • Loading branch information
berkes committed Sep 25, 2024
1 parent 4f9c134 commit a672f7f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
4 changes: 0 additions & 4 deletions apps/issuer/migrations/0043_auto_20180614_0949.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,4 @@ class Migration(migrations.Migration):
name='recipient_identifier',
field=models.EmailField(db_index=True, max_length=768),
),
migrations.AlterIndexTogether(
name='badgeinstance',
index_together=set([('recipient_identifier', 'badgeclass', 'revoked')]),
),
]
17 changes: 17 additions & 0 deletions apps/issuer/migrations/0117_alter_badgeinstance_index_together.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 3.2.25 on 2024-09-23 16:28

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('issuer', '0116_migrate_studyLoad_to_timeExtension'),
]

operations = [
migrations.AlterIndexTogether(
name='badgeinstance',
index_together={('recipient_identifier', 'badgeclass', 'revoked')},
),
]

0 comments on commit a672f7f

Please sign in to comment.