OperationalError no such column: table.colunm

Raised by:

django/db/backends/sqlite3/base.py (line 318)

Traceback (most recent call last):
  File "python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "python2.7/site-packages/django/utils/decorators.py", line 145, in inner
    return func(*args, **kwargs)
  File "python2.7/site-packages/django/contrib/auth/decorators.py", line 22, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "python2.7/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "python2.7/site-packages/oscar/apps/dashboard/catalogue/views.py", line 207, in dispatch
    request, *args, **kwargs)
  File "python2.7/site-packages/django/views/generic/base.py", line 89, in dispatch
    return handler(request, *args, **kwargs)
  File "python2.7/site-packages/django/views/generic/edit.py", line 268, in get
    return super(BaseUpdateView, self).get(request, *args, **kwargs)
  File "python2.7/site-packages/django/views/generic/edit.py", line 205, in get
    form = self.get_form()
  File "python2.7/site-packages/django/views/generic/edit.py", line 74, in get_form
    return form_class(**self.get_form_kwargs())
  File "python2.7/site-packages/oscar/apps/dashboard/catalogue/forms.py", line 249, in __init__
    self.add_attribute_fields(product_class, self.instance.is_parent)
  File "python2.7/site-packages/oscar/apps/dashboard/catalogue/forms.py", line 289, in add_attribute_fields
    for attribute in product_class.attributes.all():
  File "python2.7/site-packages/django/db/models/query.py", line 162, in __iter__
    self._fetch_all()
  File "python2.7/site-packages/django/db/models/query.py", line 965, in _fetch_all
    self._result_cache = list(self.iterator())
  File "python2.7/site-packages/django/db/models/query.py", line 238, in iterator
    results = compiler.execute_sql()
  File "python2.7/site-packages/django/db/models/sql/compiler.py", line 840, in execute_sql
    cursor.execute(sql, params)
  File "python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "python2.7/site-packages/django/db/utils.py", line 97, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "python2.7/site-packages/django/db/backends/sqlite3/base.py", line 318, in execute
    return Database.Cursor.execute(self, query, params)
OperationalError: no such column: catalogue_productattribute.parent_owned

How to reproduce

Add a new field in a model that it's not currently present in the database.

How to fix

Make a migration:

python manage.py makemigrations name_of_your_app

and then apply it to the database:

python manage.py migrate