Django Mapping strings to strings with HStoreField - a PostgreSQL specific field Setting up HStoreField


First, we'll need to do some setup to get HStoreField working.

  1. make sure django.contrib.postgres is in your `INSTALLED_APPS
  2. Add HStoreExtension to your migrations. Remember to put HStoreExtension before any CreateModel or AddField migrations.
from django.contrib.postgres.operations import HStoreExtension
from django.db import migrations

class FooMigration(migrations.Migration):
    # put your other migration stuff here
    operations = [