Package trac :: Package upgrades :: Module db7

Source Code for Module trac.upgrades.db7

 1  # -*- coding: utf-8 -*- 
 2  # 
 3  # Copyright (C) 2004-2023 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  sql = [ 
15  #-- Add readonly flag to 'wiki' 
16  """CREATE TEMPORARY TABLE wiki_old AS SELECT * FROM wiki;""", 
17  """DROP TABLE wiki;""", 
18  """CREATE TABLE wiki ( 
19           name            text, 
20           version         integer, 
21           time            integer, 
22           author          text, 
23           ipnr            text, 
24           text            text, 
25           comment         text, 
26           readonly        integer, 
27           UNIQUE(name,version) 
28  );""", 
29  """INSERT INTO wiki(name,version,time,author,ipnr,text,comment,readonly) SELECT name,version,time,author,ipnr,text,comment,0 FROM wiki_old;""" 
30  ] 
31   
32 -def do_upgrade(env, ver, cursor):
33 for s in sql: 34 cursor.execute(s)
35