django - Adding Model Attribute with MySQL later in project -
i have working django project , want add new model attribute. how do this?
currently have done
class stream(models.model): workingattributes = models.charfield(max_length=100) step = models.charfield(max_length=1)
when run 'python manage.py runserver' receive
databaseerror: (1054, "unknown column 'livestream_stream.step' in 'field list'")
i have gone mamp , accessed database , added new column 'step', receive same error. have recommendations on how add new attributes? thanks
you need use south (or similar) schemamigration. read documents see how it. it's quite easy, , helpful later in project (when have lots of data in database). other option (other using migration tool) drop database , create again, lose of data.
Comments
Post a Comment