Hi Bruno, 

I think that putting such an operation in a migration doesn't make much sense. 
If it's part of the project migrations, it means that the canonical way to set 
up the database is to start up on MySQL and move to PG later. This is almost 
surely not what you intend. 

Copying data across is usually a one-time thing, not something you want as part 
of your living history. A management command fits much better than a migration. 

My 2 cents, 
Shai 

On 10 ביוני 2016 20:47:51 GMT+03:00, Bruno Ribeiro da Silva 
<[email protected]> wrote:
>Hey guys, I'm not sure if I should be asking this here, but it's
>related to 
>django internals.
>
>I have this idea to create a command that uses the migrations api to 
>migrate all the data from one database (eg. MySQL) to another database 
>(PostgreSQL).
>
>So I would run the migrations in the new target database, then flush
>all 
>the tables there, and model by model do a bunch of bulk_create into the
>new 
>database using the result queryset from the source database.
>
>
>The questions are: do you think it is feasible to make all of this
>inside a 
>command? If I have to change the migrations api to make it happen, do
>you 
>think this could be a nice feature to have in Django?
>
>
>Thanks in advance!
>
>-- 
>You received this message because you are subscribed to the Google
>Groups "Django developers  (Contributions to Django itself)" group.
>To unsubscribe from this group and stop receiving emails from it, send
>an email to [email protected].
>To post to this group, send email to
>[email protected].
>Visit this group at https://groups.google.com/group/django-developers.
>To view this discussion on the web visit
>https://groups.google.com/d/msgid/django-developers/1f588512-dc82-4182-a87b-cbdabea71a11%40googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/9B1A79E7-E458-4DA5-BC94-C1838DA4908E%40platonix.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to