* Rename the allowed_connections table to requests.
* Map the requests table.
This commit is contained in:
parent
87e2f73dd5
commit
a1da7e1ee7
2 changed files with 17 additions and 8 deletions
|
@ -62,6 +62,7 @@ GroupEmailsTable = Table('group_emails', metadata, autoload=True)
|
|||
GroupRolesTable = Table('group_roles', metadata, autoload=True)
|
||||
BugzillaQueueTable = Table('bugzilla_queue', metadata, autoload=True)
|
||||
LogTable = Table('log', metadata, autoload=True)
|
||||
RequestsTable = Table('requests', metadata, autoload=True)
|
||||
|
||||
#
|
||||
# Selects for filtering roles
|
||||
|
@ -331,7 +332,13 @@ class BugzillaQueue(SABase):
|
|||
pass
|
||||
|
||||
class Log(SABase):
|
||||
'''Write simple logs of changesto the database.'''
|
||||
'''Write simple logs of changes to the database.'''
|
||||
pass
|
||||
|
||||
class Requests(SABase):
|
||||
'''
|
||||
Requests for certain resources may be restricted based on the user or host.
|
||||
'''
|
||||
pass
|
||||
|
||||
#
|
||||
|
@ -431,6 +438,9 @@ mapper(Log, LogTable, properties = {
|
|||
### TODO: test to be sure SQLAlchemy only loads the backref on demand
|
||||
'author': relation(People, backref='changes')
|
||||
})
|
||||
mapper(Requests, RequestsTable, properties = {
|
||||
'person': relation(People, backref='requests')
|
||||
})
|
||||
|
||||
# TurboGears Identity
|
||||
mapper(Visit, visits_table)
|
||||
|
|
13
fas/fas2.sql
13
fas/fas2.sql
|
@ -227,7 +227,7 @@ cluster log_changetime_idx on log;
|
|||
-- New records are created when a request is first made by a specific
|
||||
-- username@(hostname/id)
|
||||
--
|
||||
create table allowed_connections (
|
||||
create table requests (
|
||||
id serial primary key;
|
||||
person_id INTEGER not null references people(id),
|
||||
hostname TEXT not null,
|
||||
|
@ -238,12 +238,11 @@ create table allowed_connections (
|
|||
unique (person_id, hostname, ip, action)
|
||||
);
|
||||
|
||||
create index allowed_connections_changetime_idx on
|
||||
allowed_connections(changetime);
|
||||
create index hostname_idx on allowed_connections(hostname);
|
||||
create index ip_idx on allowed_connections(ip);
|
||||
create index person_id_idx on allowed_connections(person_id);
|
||||
cluster allowed_connection_changetime_idx on allowed_connections;
|
||||
create index requests_changetime_idx on requests(changetime);
|
||||
create index hostname_idx on requests(hostname);
|
||||
create index ip_idx on requests(ip);
|
||||
create index person_id_idx on requests(person_id);
|
||||
cluster requests_changetime_idx on requests;
|
||||
|
||||
--
|
||||
-- turbogears session tables
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue