So what is the MOST painless way to do this?
--Mark
(1) Add the field to your model.
(2) Run "manage.py sql <app_name>" and note the type of column that is
added to the model's table.
(3) At your database prompt ("manage.py shell" and go from there),
execute "ALTER TABLE ADD COLUMN ... DEFAULT ...", filling in the first
"..." part with the column definition you noted before. You will also
need to add a DEFAULT value to the column at the database level so that
existing entries have a value for that column. If the column can be
NULL, you won't need the default value -- it will just put NULLs in
there for all the existing entries.
(4) Sit back with drink of choice and realise just how painless the
whole process was.
Regards,
Malcolm
Alternative, and even better in my experience: write a SQL file which
will run the update inside a transaction, and commit that into the SVN
repo with your app so you have a history of what you've done to the
DB.
--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."