| 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 | |
|---|
| 9 | from trac.db import Table, Column, Index |
|---|
| 10 | |
|---|
| 11 | schema_version = 4 |
|---|
| 12 | |
|---|
| 13 | ## Database schema |
|---|
| 14 | # |
|---|
| 15 | |
|---|
| 16 | schema = [ |
|---|
| 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))) |
|---|
| 38 | def 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)),))) |
|---|