3

I read somewhere that you would never run syncdb on a database, post its initial run. Is this true?

I don't see what the problem could be. Do you?

second
  • 28,029
  • 7
  • 75
  • 76
Val Neekman
  • 17,692
  • 14
  • 63
  • 66

2 Answers2

7

running syncdb will not make changes to tables for any models already in the database (even if you have changed them).

for managing changes to models, consider south

second
  • 28,029
  • 7
  • 75
  • 76
  • This is without mentioning `syncdb` also reload all `initial_data` fixtures at each call, unless `--no-initial-data` specified (available since django1.5). – Pierre de LESPINAY Dec 14 '12 at 10:04
1

Syncdb will create tables that don't exist, but not modify existing tables. So it's fairly safe to run in production. But it's not a reliable way to maintain a database schema. Look at the South package for a way to reliably maintain changes to your database schema between development and production. Should be part of django standard, IMHO.

Leopd
  • 41,333
  • 31
  • 129
  • 167