Author: rgardler
Date: Tue Jul 28 07:11:29 2015
New Revision: 1693007
URL: http://svn.apache.org/r1693007
Log:
Add a migrateDev script to make it easier to migrate the database in testing
Added:
comdev/tools/scripts/cleanDev.sh
- copied, changed from r1692686, comdev/tools/scripts/dev.sh
comdev/tools/scripts/migrateDev.sh
Removed:
comdev/tools/scripts/dev.sh
Modified:
comdev/tools/events_list/models.py
comdev/tools/readme.md
Modified: comdev/tools/events_list/models.py
URL:
http://svn.apache.org/viewvc/comdev/tools/events_list/models.py?rev=1693007&r1=1693006&r2=1693007&view=diff
==============================================================================
--- comdev/tools/events_list/models.py (original)
+++ comdev/tools/events_list/models.py Tue Jul 28 07:11:29 2015
@@ -24,8 +24,9 @@ class Hashtag(models.Model):
return unicode(self.name)
class Person(models.Model):
- meetupID = models.BigIntegerField(verbose_name = "Meetups.com ID",
unique=True)
-
+ bio = models.TextField(default="None provided.")
+ meetupID = models.BigIntegerField(verbose_name = "Meetups.com ID",
unique=True)
+
class Event(models.Model):
name = models.CharField(max_length=200)
event_url = models.URLField()
Modified: comdev/tools/readme.md
URL:
http://svn.apache.org/viewvc/comdev/tools/readme.md?rev=1693007&r1=1693006&r2=1693007&view=diff
==============================================================================
--- comdev/tools/readme.md (original)
+++ comdev/tools/readme.md Tue Jul 28 07:11:29 2015
@@ -126,12 +126,23 @@ Docker host using the following command:
Then you can setup a clean dev environment with the command:
- $ scripts/dev.sh
+ $ scripts/cleanDev.sh
-NOTE: this command kills any running dev containers and restarts
-them. This will remove any data that has been changed during the most
-recent development activity. Only run this command if you are prepared
-to go back to a clean dev state.
+NOTE: this command kills any running dev containers and restarts them
+(see below for less destructive scripts). This will remove any data
+that has been changed during the most recent development
+activity. Only run this command if you are prepared to go back to a
+clean dev state.
+
+If, rather than creating a clean development environment, you want to
+migrate the database in a running instance of the application to a new
+version of the application use the command (this will generate any
+migrations and execute them):
+
+ $ script/migrateDev.sh
+
+NOTE: This will only work if each new field has defaults provided. The
+system will report errors if no defaults are defined.
### Running Django Commands ###
Copied: comdev/tools/scripts/cleanDev.sh (from r1692686,
comdev/tools/scripts/dev.sh)
URL:
http://svn.apache.org/viewvc/comdev/tools/scripts/cleanDev.sh?p2=comdev/tools/scripts/cleanDev.sh&p1=comdev/tools/scripts/dev.sh&r1=1692686&r2=1693007&rev=1693007&view=diff
==============================================================================
--- comdev/tools/scripts/dev.sh (original)
+++ comdev/tools/scripts/cleanDev.sh Tue Jul 28 07:11:29 2015
@@ -1,10 +1,10 @@
echo
"##################################################################################################"
-echo "# Check we really want to restart dev containers"
+echo "# Check we really want to create clean dev containers"
echo
"##################################################################################################"
echo "DOCKER_HOST is set to $DOCKER_HOST"
echo "DOCKER_MACHINE_NAME is set to $DOCKER_MACHINE_NAME"
-echo "Do you really want to restart containers on this machine?"
+echo "Do you really want to start clean containers on this machine?"
read -p "Remember, it will destroy all data.\nEnter 'Yes' to confirm: " CONFIRM
if [ $CONFIRM != "Yes" ]; then
Added: comdev/tools/scripts/migrateDev.sh
URL:
http://svn.apache.org/viewvc/comdev/tools/scripts/migrateDev.sh?rev=1693007&view=auto
==============================================================================
--- comdev/tools/scripts/migrateDev.sh (added)
+++ comdev/tools/scripts/migrateDev.sh Tue Jul 28 07:11:29 2015
@@ -0,0 +1,10 @@
+echo
"##################################################################################################"
+echo "# Migrate the database"
+echo
"##################################################################################################"
+
+docker exec meetups_app python manage.py makemigrations events_list
+docker exec meetups_app python manage.py migrate
+
+echo
"##################################################################################################"
+echo "# Done"
+echo
"##################################################################################################"