Skip to content

Commit

Permalink
fix(test): squash migrations 1 through 31
Browse files Browse the repository at this point in the history
This commit /manually/ squashes migrations pertaining the
user.email field. This was necessary due to upstream removal of
CIEmailField, resulting in an extra index in the api database
that made migration 0031 fail. The manual fix was to move all
changes pertaining user.email to migration 0001. Among all
affected migrations, the one with the highest number is 0031.

This commit also Django-squashes migrations 1 through 31
(including) to make clear that database versions in this range
aren't supported anymore.

If you maintain a desec-stack deployment and this breaking
change is a problem, please contact [email protected]. Thanks!
  • Loading branch information
nils-wisiol committed Aug 30, 2024
1 parent 4bfc44c commit 53864d3
Show file tree
Hide file tree
Showing 4 changed files with 1,109 additions and 30 deletions.
13 changes: 12 additions & 1 deletion api/desecapi/migrations/0001_initial_squashed_again.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import django.db.models.deletion
import re
import uuid
from django.contrib.postgres.operations import CreateCollation


class Migration(migrations.Migration):
Expand All @@ -15,6 +16,13 @@ class Migration(migrations.Migration):
dependencies = []

operations = [
# Explanation: https://adamj.eu/tech/2023/02/23/migrate-django-postgresql-ci-fields-case-insensitive-collation/
CreateCollation(
"case_insensitive",
provider="icu",
locale="und-u-ks-level2",
deterministic=False,
),
migrations.CreateModel(
name="User",
fields=[
Expand All @@ -37,7 +45,10 @@ class Migration(migrations.Migration):
(
"email",
models.EmailField(
max_length=191, unique=True, verbose_name="email address"
db_collation="case_insensitive",
max_length=254,
unique=True,
verbose_name="email address",
),
),
("is_active", models.BooleanField(default=True)),
Expand Down
Loading

0 comments on commit 53864d3

Please sign in to comment.