./manage.py migrate not work

WEN Pingbo wengpingbo at gmail.com
Fri May 20 19:19:51 AEST 2016


Hi, Stephen

2016-05-20 17:07 GMT+08:00 Finucane, Stephen <stephen.finucane at intel.com>:
> On 20 May 16:44, WEN Pingbo wrote:

>> 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].
>

Yes, I use the latest master branch. It seems the issue still there, even
I use 'vagrant up', instead of manual setup.

I have run './manage.py migrate' in v1.1.1 at the same time, it failed again.

Here are logs:

django.db.utils.ProgrammingError: relation "patchwork_state" does not exist
LINE 1: ...dering", "patchwork_state"."action_required" FROM "patchwork...

> 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').
>

Thanks for your patch, it works. I think I can move on now:)

Pingbo


More information about the Patchwork mailing list