File: db_default.py

package info (click to toggle)
trac-tags 0.7%2Bsvn12392-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 324 kB
  • ctags: 268
  • sloc: python: 2,029; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 937 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Steffen Hoffmann <hoff.st@web.de>
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.

from trac.db import Table, Column, Index

schema_version = 3

## Database schema
#

schema = [
    Table('tags', key=('tagspace', 'name', 'tag'))[
        Column('tagspace'),
        Column('name'),
        Column('tag'),
        Index(['tagspace', 'name']),
        Index(['tagspace', 'tag']),
    ]
]

## Default database values
#

# (table, (column1, column2), ((row1col1, row1col2), (row2col1, row2col2)))
def get_data(db):
    return (('permission',
              ('username', 'action'),
                (('anonymous', 'TAGS_VIEW'),
                 ('authenticated', 'TAGS_MODIFY'))),
            ('system',
              ('name', 'value'),
                (('tags_version', str(schema_version)),)))