Index: trac/db_default.py
===================================================================
--- trac/db_default.py	(revision 1674)
+++ trac/db_default.py	(working copy)
@@ -21,7 +21,7 @@
 
 
 # Database version identifier. Used for automatic upgrades.
-db_version = 12
+db_version = 13
 
 def __mkreports(reports):
     """Utility function used to create report data in same syntax as the
@@ -160,6 +160,7 @@
     Table('component', key='name')[
         Column('name'),
         Column('owner'),
+        Column('qaowner'),
         Column('description')],
     Table('milestone', key='name')[
         Column('name'),
@@ -355,8 +356,8 @@
 # (table, (column1, column2), ((row1col1, row1col2), (row2col1, row2col2)))
 data = (('component',
              ('name', 'owner'),
-               (('component1', 'somebody'),
-                ('component2', 'somebody'))),
+               (('component1', 'somebody', 'qasomebody'),
+                ('component2', 'somebody', 'qasomebody'))),
            ('milestone',
              ('name', 'due', 'completed'),
                (('milestone1', 0, 0),
Index: trac/scripts/admin.py
===================================================================
--- trac/scripts/admin.py	(revision 1674)
+++ trac/scripts/admin.py	(working copy)
@@ -319,10 +319,10 @@
 
 #    ## Component
     _help_component = [('component list', 'Show available components'),
-                       ('component add <name> <owner>', 'Add a new component'),
+                       ('component add <name> <owner> [<qaowner>]', 'Add a new component'),
                        ('component rename <name> <newname>', 'Rename a component'),
                        ('component remove <name>', 'Remove/uninstall component'),
-                       ('component chown <name> <owner>', 'Change component ownership')]
+                       ('component chown <name> <owner> [<qaowner>]', 'Change component ownership')]
 
     def complete_component (self, text, line, begidx, endidx):
         if begidx in [16,17]:
@@ -338,10 +338,14 @@
         try:
             if arg[0]  == 'list':
                 self._do_component_list()
-            elif arg[0] == 'add' and len(arg)==3:
+            elif arg[0] == 'add' and len(arg) in [3,4]:
                 name = arg[1]
                 owner = arg[2]
-                self._do_component_add(name, owner)
+                if len(arg) == 4:
+                    qaowner = arg[3]
+                else:
+                    qaowner = owner
+                self._do_component_add(name, owner, qaowner)
             elif arg[0] == 'rename' and len(arg)==3:
                 name = arg[1]
                 newname = arg[2]
@@ -349,22 +353,26 @@
             elif arg[0] == 'remove'  and len(arg)==2:
                 name = arg[1]
                 self._do_component_remove(name)
-            elif arg[0] == 'chown' and len(arg)==3:
+            elif arg[0] == 'chown' and len(arg) in [3,4]:
                 name = arg[1]
                 owner = arg[2]
-                self._do_component_set_owner(name, owner)
+                if len(arg) == 4:
+                    qaowner = arg[3]
+                else:
+                    qaowner = owner
+                self._do_component_set_owner(name, owner, qaowner)
             else:    
                 self.do_help ('component')
         except Exception, e:
             print 'Component %s failed:' % arg[0], e
 
     def _do_component_list(self):
-        data = self.db_execsql('SELECT name, owner FROM component') 
-        self.print_listing(['Name', 'Owner'], data)
+        data = self.db_execsql('SELECT name, owner, qaowner FROM component') 
+        self.print_listing(['Name', 'Owner', 'QA Owner'], data)
 
-    def _do_component_add(self, name, owner):
-        self.db_execsql("INSERT INTO component (name,owner) VALUES('%s','%s')"
-                        % (name, owner))
+    def _do_component_add(self, name, owner, qaowner):
+        data = self.db_execsql("INSERT INTO component VALUES('%s', '%s', '%s')"
+                               % (name,owner,qaowner))
 
     def _do_component_rename(self, name, newname):
         cnx = self.db_open()
@@ -389,15 +397,15 @@
         data = self.db_execsql("DELETE FROM component WHERE name='%s'"
                                % (name))
 
-    def _do_component_set_owner(self, name, owner):
+    def _do_component_set_owner(self, name, owner, qaowner):
         cnx = self.db_open()
         cursor = cnx.cursor ()
         cursor.execute('SELECT name FROM component WHERE name=%s', name)
         data = cursor.fetchone()
         if not data:
             raise Exception("No such component '%s'" % name)
-        data = self.db_execsql("UPDATE component SET owner='%s' WHERE name='%s'"
-                               % (owner,name))
+        data = self.db_execsql("UPDATE component SET owner='%s', qaowner='%s' WHERE name='%s'"
+                               % (owner,qaowner,name))
 
 
     ## Permission
Index: trac/upgrades/db13.py
===================================================================
--- trac/upgrades/db13.py	(revision 0)
+++ trac/upgrades/db13.py	(revision 0)
@@ -0,0 +1,18 @@
+sql = """
+-- Add QA Contact to 'component'
+CREATE TEMPORARY TABLE component_backup AS SELECT * FROM component;
+DROP TABLE component;
+CREATE TABLE component (
+         name            text PRIMARY KEY,
+         owner           text,
+         qaowner         text,
+         description     text
+);
+INSERT INTO component
+  SELECT name, owner, owner AS qaowner, description
+  FROM component_backup;
+DROP TABLE component_backup;
+"""
+
+def do_upgrade(env, ver, cursor):
+    cursor.execute(sql)

