-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorect work with migrations in Django 1.7 #50
Comments
Can you test the latest version (1.2) it should fix it. |
Seems to be working OK for me on 1.7 with a similar use case. |
Thanks |
I think this issue should be reopened. Using pgarray 1.2, if the field is defined as:
It fails on Django 1.7
|
@niwinz I found this issue searching Github and has to use the same solution as @ses4j. I also noticed the field definition in the test cases here - https://github.com/niwinz/djorm-pgarray/blob/master/testing/pg_array_fields/models.py#L16 - where a function defines the default value by returning a list. I don't fully understand the constraints, but setting the default with |
Is clearly not fixed bug! I'll reopen the issue. |
Problem with default values of fields.
For example:
roles = IntegerArrayField(blank=True, default=[0, 1])
It create migration like:
It causes error when migrate:
django.db.utils.DataError: missing "]" in array dimensions
Temporarily I manualy changed migration to
field=djorm_pgarray.fields.IntegerArrayField(default='{0, 1}')
. It works fine.Do you have any ideas to fix it?
The text was updated successfully, but these errors were encountered: