Skip to content

Commit

Permalink
Merge pull request #138 from jazzband/pr/kylie-sre/133-1
Browse files Browse the repository at this point in the history
[#132] use 36 length for UUIDFields to support including hyphens
  • Loading branch information
shimizukawa authored Jul 22, 2024
2 parents 0653dd8 + 1649ab4 commit 1bd2d44
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Features:
* #83 Drop Django-2.2 support.
* #134 Support adding COLUMN with UNIQUE; adding column without UNIQUE then add UNIQUE CONSTRAINT.
* #135 Support adding BinaryField.
* #132 Use 36 length for UUIDFields to support including hyphens. Thanks to kylie.

Bug Fixes:

Expand Down
2 changes: 1 addition & 1 deletion django_redshift_backend/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ def remove_field(self, model, field):
"AutoField": "integer identity(1, 1)",
"BigAutoField": "bigint identity(1, 1)",
"TextField": "varchar(max)", # text must be varchar(max)
"UUIDField": "varchar(32)", # redshift doesn't support uuid fields
"UUIDField": "varchar(36)", # redshift doesn't support uuid fields
"BinaryField": "varbyte(%(max_length)s)",
}

Expand Down
2 changes: 1 addition & 1 deletion tests/test_redshift_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_load_redshift_backend(self):
"id" integer identity(1, 1) NOT NULL PRIMARY KEY,
"ctime" timestamp with time zone NOT NULL,
"text" varchar(max) NOT NULL,
"uuid" varchar(32) NOT NULL
"uuid" varchar(36) NOT NULL
)
;''')

Expand Down

0 comments on commit 1bd2d44

Please sign in to comment.