diff options
| -rw-r--r-- | chimere/main/models.py | 1 | ||||
| -rwxr-xr-x | chimere/scripts/upgrade.py | 13 | 
2 files changed, 14 insertions, 0 deletions
diff --git a/chimere/main/models.py b/chimere/main/models.py index daf7b3b..198b837 100644 --- a/chimere/main/models.py +++ b/chimere/main/models.py @@ -209,6 +209,7 @@ Format YYYY-MM-DD"))      if 'chimere.rss' in settings.INSTALLED_APPS:          available_date = models.DateTimeField(_("Available Date"), blank=True,                                                null=True) +    route = models.ForeignKey("Route", blank=True, null=True)      objects = models.GeoManager()      def __unicode__(self): diff --git a/chimere/scripts/upgrade.py b/chimere/scripts/upgrade.py index a5e316f..286842a 100755 --- a/chimere/scripts/upgrade.py +++ b/chimere/scripts/upgrade.py @@ -278,3 +278,16 @@ for route in routes:  if changed:      print " * projections of routes corrected" +# -> version 1.3: associate point to route (for the future) +query = QUERY_CHECK_FIELD % ('main_marker', 'route_id') +cursor.execute(query) +transaction.commit_unless_managed() + +row = cursor.fetchone() +if not row: +    query_update = 'ALTER TABLE "main_marker" ADD COLUMN \ +"route_id" integer REFERENCES "main_route" ("id") DEFERRABLE INITIALLY DEFERRED' +    cursor.execute(query_update) +    transaction.commit_unless_managed() +    print " * route_id added to table main_marker." +  | 
