unable to make database evolution happen

70 views
Skip to first unread message

Wei Lu Liu

unread,
Feb 16, 2012, 5:51:23 PM2/16/12
to reviewboard-dev, mike.d...@gmail.com
Hey all,

I am trying to modify the database.

Ref to r/2615, I manually changed my code to r/2615 in the files
below:
reviewboard/changedescs/models.py
reviewboard/changedescs/evolutions/__init__.py
reviewboard/changedescs/evolutions/change_desc_user.py

Then what are the procedures I should follow to make it happen to the
database???

I have tried almost everything I could think of including "manage.py
evolve" and even "prepare-dev.py" but I could not make it.

Sincerely thanks,
Wei

Christian Hammond

unread,
Feb 16, 2012, 7:05:29 PM2/16/12
to reviewb...@googlegroups.com, mike.d...@gmail.com
The correct command for initiating a database evolution is:

    ./reviewboard/manage.py evolve --execute

If that errors out, please show me the error and I'll help diagnose that.

Christian

--
Christian Hammond - chi...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com

Wei Lu Liu

unread,
Feb 16, 2012, 8:08:58 PM2/16/12
to reviewb...@googlegroups.com
Hi Christian,

I executed that command and got:

Traceback (most recent call last):
File "manage.py", line 178, in <module>
execute_manager(settings)
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/django_evolution-0.6.5-py2.7.egg/django_evolution/management/commands/evolve.py", line 60, in handle
self.evolve(*app_labels, **options)
File "/usr/local/lib/python2.7/dist-packages/django_evolution-0.6.5-py2.7.egg/django_evolution/management/commands/evolve.py", line 104, in evolve
latest_version = Version.objects.using(database).latest('when')
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/db/models/query.py", line 407, in latest
return obj.get()
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/db/models/query.py", line 344, in get
num = len(clone)
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/db/models/query.py", line 82, in __len__
self._result_cache = list(self.iterator())
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/db/models/query.py", line 273, in iterator
for row in compiler.results_iter():
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/db/models/sql/compiler.py", line 680, in results_iter
for rows in self.execute_sql(MULTI):
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/db/models/sql/compiler.py", line 735, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/db/backends/util.py", line 34, in execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/django/db/backends/sqlite3/base.py", line 234, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.DatabaseError: no such table: django_project_version

I think it may be the database issue (the database is mysql, but it uses "mysql" in /reviewboard/changedesc/__init__.py), but I am not sure how to resolve it. What do you think?

Thanks and regards,
Wei

Wei Lu Liu

unread,
Feb 17, 2012, 5:28:12 AM2/17/12
to reviewb...@googlegroups.com
And the weird thing is that I checked the database and found the table named "django_project_version".

Btw, I began to have this error since I updated my /reviewboard repository almost one day ago.

Mike Conley

unread,
Feb 17, 2012, 9:31:24 AM2/17/12
to reviewboard-dev
Wei:

Hm - you may have a configuration issue - looking at this line:

File "/usr/local/lib/python2.7/dist-packages/Django-1.3.1-py2.7.egg/
django/db/backends/sqlite3/base.py", line 234, in execute
return Database.Cursor.execute(self, query, params)

It's clear that your instance is configured to use SQLite, as opposed
to MySQL.

I strongly recommend using SQLite over MySQL for development. MySQL
is fine for production, but is more firepower than you'll probably
ever need for development.

What did you do to configure for MySQL? You might want to undo any of
that configuration to go back to SQLite... (default for development)

-Mike
> Christian Hammond - chip...@chipx86.com
> Review Board -http://www.reviewboard.org
> VMware, Inc. -http://www.vmware.com

Wei Lu Liu

unread,
Feb 17, 2012, 7:29:02 PM2/17/12
to reviewb...@googlegroups.com
I re-installed a fresh copy of Ubuntu (without any mysql stuff) and excecuted the all steps but still got the same error, so I don't think this is the configuration error. Notice I began to have this error after I updated my ~/src/reviewboard copy recently. Is it possible to be an error on the origin master?

Headache issue. What do you think??

Thanks,

Christian Hammond

unread,
Feb 18, 2012, 1:15:06 AM2/18/12
to reviewb...@googlegroups.com
I've written up a little guide with some troubleshooting, partially based on the errors you saw. Please take a look and see if it helps.

http://www.reviewboard.org/docs/codebase/dev/tasks/database-evolutions/

Christian

--
Christian Hammond - chi...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com


Wei Lu Liu

unread,
Feb 18, 2012, 4:43:01 AM2/18/12
to reviewb...@googlegroups.com
Hi Christain,

I'm giving it a try. Just a small question: where is the copy of the database? Is it reviewboard/reviewboard.db??

Thanks,
Wei

http://www.reviewboard.org/docs/codebase/dev/tasks/database-evolutions/

Christian

Thanks,

Wei

----- Original Message -----

Wei:

-Mike

> Review Board - http://www.reviewboard.org
> VMware, Inc. - http://www.vmware.com
>

Steven MacLeod

unread,
Feb 18, 2012, 10:45:39 AM2/18/12
to reviewb...@googlegroups.com
The database is in your top review board directory. There should be a file called settings_local.py as well, which you can modify to change the name of the database which is being used. See the DATABASES dictionary inside that file.
Reply all
Reply to author
Forward
0 new messages