old_contents: # -*- coding: utf-8 -*-
  # Generated by Django 1.9.5 on 2016-06-09 10:26
  from __future__ import unicode_literals
  
  import django.contrib.postgres.fields
  from django.db import migrations, models
  
  
  class PostgresOnlyCreateModel(migrations.CreateModel):
      def database_forwards(self, app_label, schema_editor, from_state, to_state):
          if schema_editor.connection.vendor.startswith("postgres"):
              super(PostgresOnlyCreateModel, self).database_forwards(app_label, schema_editor, from_state, to_state)
  
      def database_backwards(self, app_label, schema_editor, from_state, to_state):
          if schema_editor.connection.vendor.startswith("postgres"):
              super(PostgresOnlyCreateModel, self).database_backwards(app_label, schema_editor, from_state, to_state)
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('core', '0003_withfloatfield'),
      ]
  
      operations = [
          PostgresOnlyCreateModel(
              name='BookWithChapters',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('name', models.CharField(max_length=100, verbose_name='Book name')),
                  ('chapters',
                   django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), default=list,
                                                             size=None)),
              ],
          ),
      ]
  
new_contents: from __future__ import unicode_literals
  
  from django import VERSION
  from django.db import migrations, models
  if VERSION >= (1, 8):
      from django.contrib.postgres.fields import ArrayField
      chapters_field = ArrayField(base_field=models.CharField(max_length=100), default=list, size=None)
  else:
      chapters_field = models.Field()  # Dummy field
  
  
  class PostgresOnlyCreateModel(migrations.CreateModel):
      def database_forwards(self, app_label, schema_editor, from_state, to_state):
          if VERSION >= (1, 8) and schema_editor.connection.vendor.startswith("postgres"):
              super(PostgresOnlyCreateModel, self).database_forwards(app_label, schema_editor, from_state, to_state)
  
      def database_backwards(self, app_label, schema_editor, from_state, to_state):
          if VERSION >= (1, 8) and schema_editor.connection.vendor.startswith("postgres"):
              super(PostgresOnlyCreateModel, self).database_backwards(app_label, schema_editor, from_state, to_state)
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('core', '0003_withfloatfield'),
      ]
  
      operations = [
          PostgresOnlyCreateModel(
              name='BookWithChapters',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('name', models.CharField(max_length=100, verbose_name='Book name')),
                  ('chapters', chapters_field)
              ],
          ),
      ]
  
subject: Add version check for importing django.contrib.postgres.fields.ArrayField