{"action":"created","issue":{"url":"https://api.github.com/repos/djangonauts/django-pgjson/issues/21","labels_url":"https://api.github.com/repos/djangonauts/django-pgjson/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/djangonauts/django-pgjson/issues/21/comments","events_url":"https://api.github.com/repos/djangonauts/django-pgjson/issues/21/events","html_url":"https://github.com/djangonauts/django-pgjson/issues/21","id":73752391,"number":21,"title":"South migration from json to jsonb fails","user":{"login":"georgedorn","id":239067,"avatar_url":"https://avatars.githubusercontent.com/u/239067?v=3","gravatar_id":"","url":"https://api.github.com/users/georgedorn","html_url":"https://github.com/georgedorn","followers_url":"https://api.github.com/users/georgedorn/followers","following_url":"https://api.github.com/users/georgedorn/following{/other_user}","gists_url":"https://api.github.com/users/georgedorn/gists{/gist_id}","starred_url":"https://api.github.com/users/georgedorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgedorn/subscriptions","organizations_url":"https://api.github.com/users/georgedorn/orgs","repos_url":"https://api.github.com/users/georgedorn/repos","events_url":"https://api.github.com/users/georgedorn/events{/privacy}","received_events_url":"https://api.github.com/users/georgedorn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-06T22:13:39Z","updated_at":"2015-05-11T18:17:25Z","closed_at":null,"body":"When migrating from djorm_pgjson.fields.JSONField to django_pgjson.fields.JsonBField, south generates the following:\r\n\r\n```\r\ndb.alter_column(u'my_table', 'extra_data', self.gf('django_pgjson.fields.JsonBField')())\r\n```\r\nWhich turns into the following sql:\r\n```\r\nALTER TABLE \"my_table\" ALTER COLUMN \"extra_data\" TYPE jsonb, ALTER COLUMN \"extra_data\" SET NOT NULL, ALTER COLUMN \"extra_data\" DROP DEFAULT;\r\n```\r\n\r\nYielding the following error:\r\n\r\n```\r\nThe error was: column \"extra_data\" cannot be cast automatically to type jsonb\r\nHINT:  Specify a USING expression to perform the conversion.\r\n```\r\n\r\nIs it possible to get South to add the USING expression?  It'd be something like:\r\n```\r\nALTER TABLE \"my_table\" ALTER COLUMN \"extra_data\" TYPE jsonb USING extra_data::jsonb, [...]\r\n```"},"comment":{"url":"https://api.github.com/repos/djangonauts/django-pgjson/issues/comments/101004039","html_url":"https://github.com/djangonauts/django-pgjson/issues/21#issuecomment-101004039","issue_url":"https://api.github.com/repos/djangonauts/django-pgjson/issues/21","id":101004039,"user":{"login":"niwibe","id":843689,"avatar_url":"https://avatars.githubusercontent.com/u/843689?v=3","gravatar_id":"","url":"https://api.github.com/users/niwibe","html_url":"https://github.com/niwibe","followers_url":"https://api.github.com/users/niwibe/followers","following_url":"https://api.github.com/users/niwibe/following{/other_user}","gists_url":"https://api.github.com/users/niwibe/gists{/gist_id}","starred_url":"https://api.github.com/users/niwibe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niwibe/subscriptions","organizations_url":"https://api.github.com/users/niwibe/orgs","repos_url":"https://api.github.com/users/niwibe/repos","events_url":"https://api.github.com/users/niwibe/events{/privacy}","received_events_url":"https://api.github.com/users/niwibe/received_events","type":"User","site_admin":false},"created_at":"2015-05-11T18:17:25Z","updated_at":"2015-05-11T18:17:25Z","body":"Sincerely I do not known south, and i'm not using it in any project. I don't know how to solve your problem :(  "}}