Thursday, August 13, 2015ΒΆ

A quick release to for #414 (milestones, sites & projects) because maybe Otto and I will look at this today.

There is a change in the database schema: in the tickets.Milestone model the project field has been removed and has a new field site has been added. Here is an example of how to handle this using a manual local migration.

First we make a snapshot:

$ ./make_snapshot

Then we upgrade our local copy of the source repositories:

$ ./

Then we try to restore our snapshot. Since there is a schema change, we will get an error message:

$ python run snapshot/
Traceback (most recent call last):
  File "snapshot/", line 682, in <module>
  File "snapshot/", line 672, in main
  File "", line 4, in <module>,100,u'gx-2014-12',None,None))
  File "snapshot/", line 538, in create_tickets_milestone
  File "/usr/local/pythonenv/demo/local/lib/python2.7/site-packages/django/db/models/", line 417, in __init__
    raise TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])
TypeError: 'project_id' is an invalid keyword argument for this function
INFO Done run snapshot/ (PID 18940)

So we edit the file snapshot/ In line 538 we see:

def create_tickets_milestone(id, project_id, label, expected, reached):
    kw = dict()
    return tickets_Milestone(**kw)

In current case we just uncomment the following line of above code:

# kw.update(project_id=project_id)

And we restore our snapshot again, this time there should be no errors:

$ python run snapshot/

And finally of course:

$ restart_apache