derek-schaefer / django-json-field

Generic JSON model and form fields.
BSD 3-Clause "New" or "Revised" License
122 stars 86 forks source link

Add proper South introspection rules, fixing db_type for migrations. #16

Closed fletom closed 11 years ago

fletom commented 11 years ago

Since South didn't know that it had to include the db_type argument when initializing the field, the actual db_type value that got written to the database was always the same as TextField. In Postgres, this would be text even if you passed json. (It only worked correctly if you were using syncdb instead.)

Now South correctly adds the right arguments when creating migration files:

('data', self.gf('json_field.fields.JSONField')(default='null', db_type='json')),
derek-schaefer commented 11 years ago

Thanks for the fix!