Adding new columns in Django models -
this question has answer here:
- altering database tables in django 8 answers
i have created sample django application multiple models within , populated data.
now, need add new column 1 of models?
here concerns?
- what happen if syncdb after adding column model , alter table , add new column?
- or create new table after deleting columns?
is there better way tackle issue?
syncdb
not work altering database tables. here the documentation (readup on : syncdb not alter existing tables)
a clean way achieve use 3rd party tool such django south handle migrations (handle alter table scripts in case) you.
here step step tutorial on south, , here official documentation on south
Comments
Post a Comment