--- a/ForgeTracker/forgetracker/model/migrations.py
+++ b/ForgeTracker/forgetracker/model/migrations.py
@@ -100,3 +100,19 @@
del app_config.acl.save_searches
self.ormsession.flush()
+
+class SplitStatusNamesIntoOpenAndClosed(TrackerMigration):
+ version = 3
+
+ def up(self):
+ for tracker_globals in self.ormsession.find(Globals):
+ old_names = tracker_globals.status_names
+ tracker_globals.open_status_names = ' '.join([name for name in old_names.split(' ') if name and name != 'closed'])
+ tracker_globals.closed_status_names = 'closed'
+ tracker_globals.status_names = ''
+
+ def down(self):
+ for tracker_globals in self.ormsession.find(Globals):
+ tracker_globals.status_names = ' '.join([tracker_globals.open_status_names, tracker_globals.closed_status_names])
+ tracker_globals.open_status_names = ''
+ tracker_globals.closed_status_names = ''