| 90 | | if __name__ == '__main__': |
|---|
| 91 | | |
|---|
| 92 | | from trac.core import ComponentManager |
|---|
| 93 | | import trac.db.mysql_backend |
|---|
| 94 | | import trac.db.sqlite_backend |
|---|
| 95 | | import trac.db.postgres_backend |
|---|
| 96 | | |
|---|
| 97 | | unread_table = Table('trac_unread', key=('type', 'id', 'username'))[ |
|---|
| 98 | | Column('username'), |
|---|
| 99 | | Column('last_read_on', type='int'), |
|---|
| 100 | | Column('type'), |
|---|
| 101 | | Column('id'), |
|---|
| 102 | | Index(['type']), |
|---|
| 103 | | Index(['id']), |
|---|
| 104 | | Index(['username'])] |
|---|
| 105 | | cman = ComponentManager() |
|---|
| 106 | | c_mysql = trac.db.mysql_backend.MySQLConnector(cman); |
|---|
| 107 | | c_psql = trac.db.postgres_backend.PostgreSQLConnector(cman); |
|---|
| 108 | | c_sqlite = trac.db.sqlite_backend.SQLiteConnector(cman); |
|---|
| 109 | | |
|---|
| 110 | | for stmt in c_mysql.to_sql(unread_table): |
|---|
| 111 | | print "mysql: ", stmt |
|---|
| 112 | | |
|---|
| 113 | | for stmt in c_psql.to_sql(unread_table): |
|---|
| 114 | | print "psql: ", stmt |
|---|
| 115 | | |
|---|
| 116 | | for stmt in c_sqlite.to_sql(unread_table): |
|---|
| 117 | | print "sqlite: ", stmt |
|---|