I have taken route 1 before; its a bit more messy because you may have to explicitly map your desired model names to the actual column names. You also face the issue of dealing with primary keys.
If you have the choice, and the current database is not in use anymore, I would create a new one, using Django conventions (such as an auto-increment primary key, with "unique_together" constraints) and then import the existing data. This has the added benefit of allowing you to validate the existing data and ensure that you start with a 'clean' data set.
HTH
Derek
On Friday, 6 March 2015 23:39:33 UTC+2, Robert Daniels wrote:
-- If you have the choice, and the current database is not in use anymore, I would create a new one, using Django conventions (such as an auto-increment primary key, with "unique_together" constraints) and then import the existing data. This has the added benefit of allowing you to validate the existing data and ensure that you start with a 'clean' data set.
HTH
Derek
On Friday, 6 March 2015 23:39:33 UTC+2, Robert Daniels wrote:
I understand it is possible to use an existing database on a new Django project.
As I see it, I have 2 choices.
1 - Use the existing database and deal with it in that fashion.
or
2 - Create a new project to store the same type of data as if there were no existing database, Then write a separate export-import script to move the data from the existing db to the new structure.
Wondering if anyone has gone through the "good" and "bad" of each of these. I have about 100,000 records in the database, but moving the data across should not be that difficult as its a pretty flat model
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+unsubscribe@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/7a50e628-e803-41c1-90f6-9a4586976a7b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment