source: tagsplugin/tags/0.8/tractags/db_default.py

Last change on this file was 13428, checked in by Steffen Hoffmann, 10 years ago

TagsPlugin: Introduce tag version recording, requires db upgrade, refs #2429.

This will especially help recovering tags after SPAM tagging, refs #11205.
Therefore configurable behavior enables tracking of wiki page tag changes, but
excludes ticket keywords changes by default.

File size: 1.2 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3#
4# Copyright (C) 2012,2013 Steffen Hoffmann <hoff.st@web.de>
5#
6# This software is licensed as described in the file COPYING, which
7# you should have received as part of this distribution.
8
9from trac.db import Table, Column, Index
10
11schema_version = 4
12
13## Database schema
14#
15
16schema = [
17    Table('tags', key=('tagspace', 'name', 'tag'))[
18        Column('tagspace'),
19        Column('name'),
20        Column('tag'),
21        Index(['tagspace', 'name']),
22        Index(['tagspace', 'tag']),
23    ],
24    Table('tags_change', key=('tagspace', 'name', 'time'))[
25        Column('tagspace'),
26        Column('name'),
27        Column('time', type='int64'),
28        Column('author'),
29        Column('oldtags'),
30        Column('newtags'),
31    ]
32]
33
34## Default database values
35#
36
37# (table, (column1, column2), ((row1col1, row1col2), (row2col1, row2col2)))
38def get_data(db):
39    return (('permission',
40              ('username', 'action'),
41                (('anonymous', 'TAGS_VIEW'),
42                 ('authenticated', 'TAGS_MODIFY'))),
43            ('system',
44              ('name', 'value'),
45                (('tags_version', str(schema_version)),)))
Note: See TracBrowser for help on using the repository browser.