incubator-bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1438011 - in /incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct: api.py dbcursor.py
Date Thu, 24 Jan 2013 14:23:26 GMT
Author: jure
Date: Thu Jan 24 14:23:26 2013
New Revision: 1438011

URL: http://svn.apache.org/viewvc?rev=1438011&view=rev
Log:
#288, include permission table in translated tables


Modified:
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/api.py
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/dbcursor.py

Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/api.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/api.py?rev=1438011&r1=1438010&r2=1438011&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/api.py
(original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/api.py
Thu Jan 24 14:23:26 2013
@@ -110,7 +110,7 @@ class MultiProductSystem(Component):
 
             if db_installed_version < 3:
                 from multiproduct.dbcursor import DEFAULT_PRODUCT
-                migrate_tables = ['enum', 'component', 'milestone', 'version', 'wiki']
+                migrate_tables = ['enum', 'component', 'milestone', 'version', 'permission',
'wiki']
                 table_defs = [
                     Table('enum', key=('type', 'name', 'product'))[
                         Column('type'),
@@ -133,6 +133,10 @@ class MultiProductSystem(Component):
                         Column('time', type='int64'),
                         Column('description'),
                         Column('product')],
+                    Table('permission', key=('username', 'action', 'product'))[
+                        Column('username'),
+                        Column('action'),
+                        Column('product')],
                     Table('wiki', key=('name', 'version', 'product'))[
                         Column('name'),
                         Column('version', type='int'),
@@ -183,10 +187,10 @@ class MultiProductSystem(Component):
                         for v in list(r):
                             vals.append(v if v else '')
                         db(sql, tuple(vals + [product]))
-                for p in table_vals['bloodhound_product']:
-                    for table in migrate_tables:
-                        self.log.info("Creating tables '%s' for default product", table)
-                        insert_with_product(table, DEFAULT_PRODUCT)
+                for table in migrate_tables:
+                    self.log.info("Creating tables '%s' for default product", table)
+                    insert_with_product(table, DEFAULT_PRODUCT)
+                    for p in table_vals['bloodhound_product']:
                         self.log.info("Creating tables '%s' for product '%s' ('%s')", table,
p[1], p[0])
                         insert_with_product(table, p[0])
                 db_installed_version = self._update_db_version(db, 3)

Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/dbcursor.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/dbcursor.py?rev=1438011&r1=1438010&r2=1438011&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/dbcursor.py
(original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/dbcursor.py
Thu Jan 24 14:23:26 2013
@@ -25,15 +25,15 @@ import sqlparse.sql as Types
 
 __all__ = ['BloodhoundIterableCursor']
 
-SKIP_TABLES = ['system', 'permission', 'auth_cookie',
+SKIP_TABLES = ['system', 'auth_cookie',
                'session', 'session_attribute',
                'cache',
                'attachment', 'repository', 'revision', 'node_change',
                'ticket_change', 'ticket_custom',
                'report',
-               'bloodhound_product', 'bloodhound_productresourcemap',
+               'bloodhound_product', 'bloodhound_productresourcemap', 'bloodhound_productconfig',
                ]
-TRANSLATE_TABLES = ['ticket', 'enum', 'component', 'milestone', 'version', 'wiki']
+TRANSLATE_TABLES = ['ticket', 'enum', 'component', 'milestone', 'version', 'permission',
'wiki']
 PRODUCT_COLUMN = 'product'
 DEFAULT_PRODUCT = 'default'
 



Mime
View raw message