summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorholyantony2015-07-07 10:34:06 +0530
committerholyantony2015-07-07 10:34:06 +0530
commit6d8f7a3c9153b995f086e5eda268fed19f6f7833 (patch)
tree1da2e536f120f20f5edc5baef7c159e80407cb4f
parent4c5a279249a44bc921cfab5535ab69abe0311030 (diff)
downloadFOSSEE-Forum-6d8f7a3c9153b995f086e5eda268fed19f6f7833.tar.gz
FOSSEE-Forum-6d8f7a3c9153b995f086e5eda268fed19f6f7833.tar.bz2
FOSSEE-Forum-6d8f7a3c9153b995f086e5eda268fed19f6f7833.zip
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
-rw-r--r--ReadMe.rst43
-rw-r--r--forums/settings.py4
2 files changed, 45 insertions, 2 deletions
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
------------
diff --git a/forums/settings.py b/forums/settings.py
index c21d2e0..0399779 100644
--- a/forums/settings.py
+++ b/forums/settings.py
@@ -142,8 +142,8 @@ INSTALLED_APPS = (
'compressor',
'debug_toolbar',
'captcha',
- 'googlesearch',
- 'gtm',
+ 'south'
+
#'migrate_spoken',
)