./manage.py migrate not work

Finucane, Stephen stephen.finucane at intel.com
Fri May 20 19:07:26 AEST 2016


On 20 May 16:44, WEN Pingbo wrote:
> Hello, folks
> 
> I want to install patchwork in my local environment, by following
> development guide doc. But when I run './manage.py migrate' command,
> the script complains that the 'patchwork_state' table not found. And I
> can not find the table definition.
> 
> Did I miss something?

Are you using the latest version of master? There was an issue with
django-rest-framework causing this kind of issue, but it's been fixed
upstream [1].

If this is on master then there's something else at play. This needs to
be properly investigated, but in the short term there's a temporary fix
which will allow you to create tables.

    diff --git a/patchwork/forms.py b/patchwork/forms.py
    index 3f876b7..a8b9849 100644
    --- a/patchwork/forms.py
    +++ b/patchwork/forms.py
    @@ -213,7 +213,7 @@ class MultipleBooleanField(forms.ChoiceField):

     class MultiplePatchForm(forms.Form):
         action = 'update'
    -    state = OptionalModelChoiceField(queryset=State.objects.all())
    +    #state = OptionalModelChoiceField(queryset=State.objects.all())
         archived = MultipleBooleanField()

         def __init__(self, project, *args, **kwargs):

Apply this, run the migration, then remove it again ('git checkout -f').

I've created a GitHub issue to track progress on this bug [2].

Let me know if this works out for you,
Stephen

[1] https://github.com/getpatchwork/patchwork/commit/34ccee4
[2] https://github.com/getpatchwork/patchwork/issues/42


More information about the Patchwork mailing list