Re: Postgres (sqlmigrate) FK to M2M without RunPython

2017-03-08 Thread Maksym Mospanenko
We don't have access to db server (only via custom django backend driver) 
in our configuration (security reasons). So we have to export raw sql for 
schema migrations manually and we can't generate sql for data migrations 
(because it is python's logic). 

вівторок, 7 березня 2017 р. 11:18:01 UTC+2 користувач Melvyn Sopacua 
написав:
>
> On Monday 06 March 2017 15:40:55 Maksym Mospanenko wrote:
>
> > Hello! I want to migrate data with schema migrations but I can't run
>
> > any python code on database server - only raw sql (postgres).
>
> > How can I move fk column data to m2m table's fk column?
>
>  
>
> On the server you can run python code:
>
> python manage.py sqlmigrate app_label migration_name |psql dbname
>
>  
>
> Or save the output, put it on db server and load it there.
>
> I don't see why though. Just run migrate on the server that runs django.
>
> -- 
>
> Melvyn Sopacua
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/41efb1bc-4314-4826-9bbb-262389ad2437%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Postgres (sqlmigrate) FK to M2M without RunPython

2017-03-08 Thread Maksym Mospanenko
Yes but I have to run on db server directly (via export sqlmigrate). 
Djando's manage.py can generate sql only for schema migrations - not for 
RunPython data migrations. 

вівторок, 7 березня 2017 р. 13:14:31 UTC+2 користувач Daniel Roseman 
написав:
>
> Schema migrations don't run on the database server, they run on the app 
> server with the rest of your Django code and communicate with the database 
> in exactly the same way. If you can run Django, you can run migrations.
> -- 
> DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/020dca84-25e5-4c36-8d27-1c83579544be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Postgres (sqlmigrate) FK to M2M without RunPython

2017-03-06 Thread Maksym Mospanenko
Hello! I want to migrate data with schema migrations but I can't run any 
python code on database server - only raw sql (postgres).
How can I move fk column data to m2m table's fk column?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c6c83ed5-946e-4fa3-9c1a-270f8ff5b978%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.