=== added file 'trac/upgrades/db17.py'
--- /dev/null	
+++ trac/upgrades/db17.py	
@@ -0,0 +1,22 @@
+from trac.db import Table, Column, Index, DatabaseManager
+
+def get_table_from_name(name):
+    from trac.core import TracError
+    from trac.db_default import schema
+    table = filter((lambda n: n.name == name), schema)
+    if len(table) != 1:
+        raise TracError, "Cannot find table '%s' in schema!" % name
+    return table[0]
+
+def do_upgrade(env, ver, cursor):
+    # SQLite does not fully support ALTER, so we must use temp tables to
+    # rename node_change columns.
+    cursor.execute("CREATE TEMP TABLE nc_old AS SELECT * FROM node_change")
+    cursor.execute("DROP TABLE node_change")
+    db_backend, _ = DatabaseManager(env)._get_connector()
+    table = get_table_from_name('node_change')
+    for stmt in db_backend.to_sql(table):
+        cursor.execute(stmt)
+    cursor.execute("INSERT INTO node_change (rev,path,node_type,change_type,"
+                   "base_path,base_rev) SELECT rev,path,kind,change,"
+                   "base_path,base_rev FROM nc_old")

=== modified file 'trac/db_default.py'
--- trac/db_default.py	
+++ trac/db_default.py	
@@ -18,7 +18,7 @@
 from trac.db import Table, Column, Index
 
 # Database version identifier. Used for automatic upgrades.
-db_version = 16
+db_version = 17
 
 def __mkreports(reports):
     """Utility function used to create report data in same syntax as the
@@ -83,11 +83,11 @@
         Column('author'),
         Column('message'),
         Index(['time'])],
-    Table('node_change', key=('rev', 'path', 'change'))[
+    Table('node_change', key=('rev', 'path', 'change_type'))[
         Column('rev'),
         Column('path'),
-        Column('kind', size=1),
-        Column('change', size=1),
+        Column('node_type', size=1),
+        Column('change_type', size=1),
         Column('base_path'),
         Column('base_rev'),
         Index(['rev'])],

=== modified file 'trac/versioncontrol/cache.py'
--- trac/versioncontrol/cache.py	
+++ trac/versioncontrol/cache.py	
@@ -88,8 +88,8 @@
                                       base_path, base_rev)))
                     kind = kindmap[kind]
                     action = actionmap[action]
-                    cursor.execute("INSERT INTO node_change (rev,path,kind,"
-                                   "change,base_path,base_rev) "
+                    cursor.execute("INSERT INTO node_change (rev,path,"
+                                   "node_type,change_type,base_path,base_rev) "
                                    "VALUES (%s,%s,%s,%s,%s,%s)",
                                    (str(current_rev), path, kind, action,
                                    base_path, base_rev))
@@ -148,7 +148,7 @@
 
     def get_changes(self):
         cursor = self.db.cursor()
-        cursor.execute("SELECT path,kind,change,base_path,base_rev "
+        cursor.execute("SELECT path,node_type,change_type,base_path,base_rev "
                        "FROM node_change WHERE rev=%s "
                        "ORDER BY path", (self.rev,))
         for path, kind, change, base_path, base_rev in cursor:

=== modified file 'trac/versioncontrol/tests/cache.py'
--- trac/versioncontrol/tests/cache.py	
+++ trac/versioncontrol/tests/cache.py	
@@ -68,8 +68,8 @@
         self.assertEquals(('0', 41000, '', ''), cursor.fetchone())
         self.assertEquals(('1', 42000, 'joe', 'Import'), cursor.fetchone())
         self.assertEquals(None, cursor.fetchone())
-        cursor.execute("SELECT rev,path,kind,change,base_path,base_rev "
-                       "FROM node_change")
+        cursor.execute("SELECT rev,path,node_type,change_type,base_path,"
+                       "base_rev FROM node_change")
         self.assertEquals(('1', 'trunk', 'D', 'A', None, None),
                           cursor.fetchone())
         self.assertEquals(('1', 'trunk/README', 'F', 'A', None, None),
@@ -82,8 +82,9 @@
                        "VALUES (0,41000,'','')")
         cursor.execute("INSERT INTO revision (rev,time,author,message) "
                        "VALUES (1,42000,'joe','Import')")
-        cursor.executemany("INSERT INTO node_change (rev,path,kind,change,"
-                           "base_path,base_rev) VALUES ('1',%s,%s,%s,%s,%s)",
+        cursor.executemany("INSERT INTO node_change (rev,path,node_type,"
+                           "change_type,base_path,base_rev) "
+                           "VALUES ('1',%s,%s,%s,%s,%s)",
                            [('trunk', 'D', 'A', None, None),
                             ('trunk/README', 'F', 'A', None, None)])
 
@@ -101,7 +102,7 @@
         cursor.execute("SELECT time,author,message FROM revision WHERE rev='2'")
         self.assertEquals((42042, 'joe', 'Update'), cursor.fetchone())
         self.assertEquals(None, cursor.fetchone())
-        cursor.execute("SELECT path,kind,change,base_path,base_rev "
+        cursor.execute("SELECT path,node_type,change_type,base_path,base_rev "
                        "FROM node_change WHERE rev='2'")
         self.assertEquals(('trunk/README', 'F', 'E', 'trunk/README', '1'),
                           cursor.fetchone())
@@ -113,8 +114,9 @@
                        "VALUES (0,41000,'','')")
         cursor.execute("INSERT INTO revision (rev,time,author,message) "
                        "VALUES (1,42000,'joe','Import')")
-        cursor.executemany("INSERT INTO node_change (rev,path,kind,change,"
-                           "base_path,base_rev) VALUES ('1',%s,%s,%s,%s,%s)",
+        cursor.executemany("INSERT INTO node_change (rev,path,node_type,"
+                           "change_type,base_path,base_rev) "
+                           "VALUES ('1',%s,%s,%s,%s,%s)",
                            [('trunk', 'D', 'A', None, None),
                             ('trunk/README', 'F', 'A', None, None)])
 

