From 6d8f7a3c9153b995f086e5eda268fed19f6f7833 Mon Sep 17 00:00:00 2001 From: holyantony Date: Tue, 7 Jul 2015 10:34:06 +0530 Subject: Subject: Add a new model field to an existing table Description: 1. Add a new model field to an existing table using South without having to drop a table 2. Installed south and added it to INSTALLED_APPS in settings.py --- ReadMe.rst | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'ReadMe.rst') diff --git a/ReadMe.rst b/ReadMe.rst index dc6d16a..942abc2 100644 --- a/ReadMe.rst +++ b/ReadMe.rst @@ -100,6 +100,49 @@ Usage python manage.py runserver +**Not for first time users and only for developers** +Migration (How to add a new model field to an existing table using South without having to drop a table) +-------------------------------------------------------------------------------------------------------- + +- Enter into virual environment + +- install south :: + + pip install south + +- Add south to INSTALLED_APPS in settings.py + +- Change the directory to the `spoken-tutorial-forums/` project using the command :: + + cd /path/to/spoken-tutorial-forums + +- Run below command to create south_migrationhistory table :: + + python manage.py syncdb + +- Create the initial migration with South :: + + python manage.py schemamigration --initial website + +- Apply it as a fake migration :: + + python manage.py migrate website --fake + +- Make the change to the website model, in this case :: + + git pull + +- Create a migration for your new change :: + + python manage.py schemamigration --auto website + +- Apply new migration :: + + python manage.py migrate website + + + + Contributing ------------ -- cgit From c36331f6c8f45441910235de218d39ec471c3872 Mon Sep 17 00:00:00 2001 From: holy Date: Wed, 8 Jul 2015 16:46:54 +0530 Subject: Update ReadMe.rst --- ReadMe.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ReadMe.rst') diff --git a/ReadMe.rst b/ReadMe.rst index 942abc2..3a2e861 100644 --- a/ReadMe.rst +++ b/ReadMe.rst @@ -102,7 +102,7 @@ Usage **Not for first time users and only for developers** Migration (How to add a new model field to an existing table using South without having to drop a table) --------------------------------------------------------------------------------------------------------- +--------- - Enter into virual environment -- cgit From dfa131dc7a17e17308c2c831104149887e45e8bf Mon Sep 17 00:00:00 2001 From: holy Date: Wed, 8 Jul 2015 16:48:28 +0530 Subject: Update ReadMe.rst --- ReadMe.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ReadMe.rst') diff --git a/ReadMe.rst b/ReadMe.rst index 3a2e861..6138499 100644 --- a/ReadMe.rst +++ b/ReadMe.rst @@ -101,8 +101,9 @@ Usage **Not for first time users and only for developers** -Migration (How to add a new model field to an existing table using South without having to drop a table) ---------- +Migration +---------- +(How to add a new model field to an existing table using South without having to drop a table) - Enter into virual environment -- cgit