Mercurial > p > roundup > code
comparison roundup/backends/rdbms_common.py @ 2081:fb4bf55b94d7
*** empty log message ***
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 17 Mar 2004 22:01:37 +0000 |
| parents | 3e0961d6d44d |
| children | c091cacdc505 |
comparison
equal
deleted
inserted
replaced
| 2079:6f5de386244b | 2081:fb4bf55b94d7 |
|---|---|
| 1 # $Id: rdbms_common.py,v 1.79 2004-03-15 05:50:20 richard Exp $ | 1 # $Id: rdbms_common.py,v 1.80 2004-03-17 22:01:37 richard Exp $ |
| 2 ''' Relational database (SQL) backend common code. | 2 ''' Relational database (SQL) backend common code. |
| 3 | 3 |
| 4 Basics: | 4 Basics: |
| 5 | 5 |
| 6 - map roundup classes to relational tables | 6 - map roundup classes to relational tables |
| 182 ''' Update the SQL database to reflect changes in the backend code. | 182 ''' Update the SQL database to reflect changes in the backend code. |
| 183 | 183 |
| 184 Return boolean whether we need to save the schema. | 184 Return boolean whether we need to save the schema. |
| 185 ''' | 185 ''' |
| 186 version = self.database_schema.get('version', 1) | 186 version = self.database_schema.get('version', 1) |
| 187 if version == self.current_db_version: | |
| 188 # nothing to do | |
| 189 return 0 | |
| 190 | |
| 187 if version == 1: | 191 if version == 1: |
| 188 # version 1 doesn't have the OTK, session and indexing in the | 192 # version 1 doesn't have the OTK, session and indexing in the |
| 189 # database | 193 # database |
| 190 self.create_version_2_tables() | 194 self.create_version_2_tables() |
| 191 # version 1 also didn't have the actor column | 195 # version 1 also didn't have the actor column |
| 192 self.add_actor_column() | 196 self.add_actor_column() |
| 193 else: | |
| 194 return 0 | |
| 195 | 197 |
| 196 self.database_schema['version'] = self.current_db_version | 198 self.database_schema['version'] = self.current_db_version |
| 197 return 1 | 199 return 1 |
| 198 | 200 |
| 199 | 201 |
