summaryrefslogtreecommitdiff
path: root/chimere/scripts/upgrade.py
diff options
context:
space:
mode:
Diffstat (limited to 'chimere/scripts/upgrade.py')
-rwxr-xr-xchimere/scripts/upgrade.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/chimere/scripts/upgrade.py b/chimere/scripts/upgrade.py
index 8f5c65a..46b3548 100755
--- a/chimere/scripts/upgrade.py
+++ b/chimere/scripts/upgrade.py
@@ -95,7 +95,8 @@ if not row:
row = cursor.fetchone()
if row:
- query_rename = """ALTER TABLE subcategory_areas RENAME TO main_subcategory_areas;"""
+ query_rename = "ALTER TABLE subcategory_areas RENAME TO \
+main_subcategory_areas;"
cursor.execute(query_rename)
transaction.commit_unless_managed()
print " * subcategory_areas renamed to main_subcategory_areas"
@@ -206,6 +207,22 @@ if settings.DAYS_BEFORE_EVENT:
transaction.commit_unless_managed()
print " * start_date and end_date added to table " + table + "."
+# changement from version 1.0 to 1.1: add available_date field to marker
+if 'chimere.rss' in settings.INSTALLED_APPS:
+ for cls in (Marker,):
+ table = cls._meta.db_table
+ query = QUERY_CHECK_FIELD % (table, 'available_date')
+ cursor.execute(query)
+ transaction.commit_unless_managed()
+
+ row = cursor.fetchone()
+ if not row:
+ query_update = "ALTER TABLE " + table + " ADD COLUMN \
+available_date timestamp with time zone"
+ cursor.execute(query_update)
+ transaction.commit_unless_managed()
+ print " * available_date added to table " + table + "."
+
# changement from version 1.0 to 1.1: multiple selection of categories