On Feb 19, 2015, at 1:04 AM, talex <bkielhor...@gmail.com> wrote:
> Am I correct that use of "python makemigrations" followed by
> "python migrate", should copy the existing data into Postgres
> and leave me with a working application?

I'm afraid not.

Migration allows for predictable and reversible alterations to the database 
structure. It's an excellent tool for modifying the schema (tables, columns) of 
a database. It is possible to use migrations for data (rows), but you typically 
need to modify the migration to achieve your goal.

Migrations are not intended for moving data from one database to another. You 
might be able to use Django to help achieve your goal, but it's not magic. To 
start with, you will need both both databases to be connected to your Django 
site - if you disconnect your SQLite database, then all the data in it is 
unavailable to you. Django won't know how to get to it anymore.

You might find my article about migrations interesting:
http://afrg.co/updj17/a2

> Instead what is happening is that "python migrate" gives
> the following error and hint:
> 
>  django.db.utils.ProgrammingError: column "date" cannot be cast automatically 
> to type integer
>  HINT:  Specify a USING expression to perform the conversion.
> 
> How can I apply this hint to make this work?

I'm unfamiliar with this error, but I suspect your problem lies in the 
migration files. What files exist in `/app_name/migrations/` ? Those are the 
files that `./manage.py migrate` execute with.

Andrew

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5DE5783C-4AA5-4884-B369-DFA1F305A81D%40andrewsforge.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to