django-pgfields icon indicating copy to clipboard operation
django-pgfields copied to clipboard

Django 1.7 Migrations?

Open akestner opened this issue 10 years ago • 2 comments

So, I've been using django-pgfields successfully for a while now, but am having trouble writing a Django 1.7 migration to disentangle the "pgfields-ness" from my models. While I could migrate far enough back to get to a time pre-pgfields, I was hoping there was a more elegant solution.

Thoughts?

akestner avatar Oct 28 '14 15:10 akestner

My thought essentially is, "I need to write this." My time has been swamped recently though. :(

lukesneeringer avatar Nov 10 '14 16:11 lukesneeringer

To add my two cents, I was having trouble with Django 1.7 migrations of ArrayField. The migration did not include the field's "of" attribute, so it created an array of integers by default. Adding this method to ArrayField solved the problem:

    def deconstruct(self):
        name, path, args, kwargs = super(ArrayField, self).deconstruct()
        kwargs['of'] = self.of
        return name, path, args, kwargs

ishirav avatar Feb 10 '15 14:02 ishirav