PyLucid CMS Logo

new django-reversion needs schema migrations

tag cloud ajax | Amazon | Apache | Aptana | backward incompatible | blog | browser | bugfix | ColorMirror | creole | database | dbtemplates | development | django | django-reversion | django-sync | django-sync-server | django-tagging | django-tools | django-weave | documentation | dokumentation | Eclipse | editor | encoding | fastcgi | firefox | firefox sync | formset | generic | git | html | include | IRC | javascript | linux | mysql | pip | plugin | politik | pydev | pygments | pylucid | python | release | screencast | screencasts | security | sicherheit | software | sqlite | standalone | suchmaschine | svn | test | textile | unittest | v0.10 | v0.11 | virtualenv | visible changes | web | webspace

↑ 2011-07-12 - new django-reversion needs schema migrations  #

Before 10 months, 2 weeks published by jens.

django-reversion v1.4 has made some changes to his models, see also: https://github.com/etianen/django-reversion/wiki/Schema-migrations

So it's needed to update your database.

SQL
1
ALTER TABLE `reversion_version` ADD COLUMN `type` smallint UNSIGNED NOT NULL DEFAULT 1;

Without database migration you will get this error, after saving a page/blog entry etc.:

Python
1
OperationalError: (1054, "Unknown column 'type' in 'field list'")

↑ use south  #

↑ install south  #

You can use South for this:
e.g.:

Bash
1
2
3
~$ cd /home/FooBar/PyLucid_env
/home/FooBar/PyLucid_env$ source bin/activate
(PyLucid_env)/home/FooBar/PyLucid_env$ pip install south

To use south it's also needed to update PyLucid:

Bash
1
2
~$ cd /home/FooBar/PyLucid_env/src/pylucid
/home/FooBar/PyLucid_env/src/pylucid$ git pull origin master

Create new south database tables:

Bash
1
2
~$ cd /var/www/YourSite/
/var/www/YourSite$ ./manage.py syncdb

↑ do the migration  #

Bash
1
2
3
~$ cd /var/www/YourSite/
/var/www/YourSite$ ./manage.py migrate reversion 0001 --fake
/var/www/YourSite$ ./manage.py migrate reversion
tags backward incompatible | development | pylucid
0 comments for 'new django-reversion needs schema migrations':
    there exist no comment for 'new django-reversion needs schema migrations'
Leave a comment
tag navi developing

django-processinfo: 5.3 ms of 3.9 ms (134.9%)