Package trac :: Package upgrades :: Module db22

Source Code for Module trac.upgrades.db22

 1  # -*- coding: utf-8 -*- 
 2  # 
 3  # Copyright (C) 2009-2020 Edgewall Software 
 4  # All rights reserved. 
 5  # 
 6  # This software is licensed as described in the file COPYING, which 
 7  # you should have received as part of this distribution. The terms 
 8  # are also available at https://trac.edgewall.org/wiki/TracLicense. 
 9  # 
10  # This software consists of voluntary contributions made by many 
11  # individuals. For the exact contribution history, see the revision 
12  # history and logs, available at https://trac.edgewall.org/. 
13   
14  from trac.db import Table, Column, DatabaseManager 
15   
16 -def do_upgrade(env, ver, cursor):
17 """Add the cache table.""" 18 table = Table('cache', key='id')[ 19 Column('id'), 20 Column('generation', type='int') 21 ] 22 db_connector, _ = DatabaseManager(env).get_connector() 23 for stmt in db_connector.to_sql(table): 24 cursor.execute(stmt)
25