postgresql - how to sync django models with pre-existing database? -
i having hard time trying come reasonable design project. have existing postgres database gets updated other python scripts. web server built on django framework access postgres database update user models , display blog information logged in users. blog information being updated overnight other python scripts.
now question, if have syncdb
blog model
existing postgres database, cause problem? ex:
models.py class blog: title=... content=... author=....
and postgres db called mydb has many tables, 1 of blog
table , contains columns title
, content
, author
. how make model in sync existing database? lets included new column in db date of entry
.
if update model :
class blog: title=... content=... author=.... date of entry=...
will work.
what potential problems here , simpler solutions these?
p.s: have used south
in past. situation here different. using db read-only django's point of view, , no data migration necessary of now.
if database read-only, don't have syncdb
. use managed=false
, db_table
meta option on model specify table name corresponds to, , likewise field column names.
if haven't already, see the doc on legacy databases more info.
Comments
Post a Comment