Skip to content

Commit

Permalink
Merge pull request #2 from elarahq/sortkey
Browse files Browse the repository at this point in the history
sort key fix
  • Loading branch information
jdkanani authored Jul 20, 2017
2 parents 030635d + 57f3612 commit 1178bc5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions django_redshift_backend/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,8 @@ def _get_create_options(self, model):
Provide options to create the table. Supports:
- sortkey
"""
options = ['SORTKEY({})'.format(field) for field in model._meta.ordering]
if options:
return " " + " ".join(options)
if model._meta.ordering:
return " sortkey({})".format(",".join(model._meta.ordering))
return ""


Expand Down

0 comments on commit 1178bc5

Please sign in to comment.