summaryrefslogtreecommitdiff
path: root/pynslcd/alias.py
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2013-08-12 13:26:03 +0200
committerArthur de Jong <arthur@arthurdejong.org>2013-08-17 12:31:36 +0200
commit1b89df59af349feb27205b90727263f17f29a9d8 (patch)
tree4b84a5a633f63200fe089efd0ce220eb3364e661 /pynslcd/alias.py
parent76712760885774f883f7bf79ce97931a6e251428 (diff)
Give cache tables friendlier names
This also defined the tables for netgroup storage.
Diffstat (limited to 'pynslcd/alias.py')
-rw-r--r--pynslcd/alias.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/pynslcd/alias.py b/pynslcd/alias.py
index 48eccda..d5ae390 100644
--- a/pynslcd/alias.py
+++ b/pynslcd/alias.py
@@ -37,26 +37,27 @@ class Search(search.LDAPSearch):
class Cache(cache.Cache):
- tables = ('alias_cache', 'alias_1_cache')
+ tables = ('alias_cache', 'alias_member_cache')
create_sql = '''
CREATE TABLE IF NOT EXISTS `alias_cache`
( `cn` TEXT PRIMARY KEY COLLATE NOCASE,
`mtime` TIMESTAMP NOT NULL );
- CREATE TABLE IF NOT EXISTS `alias_1_cache`
+ CREATE TABLE IF NOT EXISTS `alias_member_cache`
( `alias` TEXT NOT NULL COLLATE NOCASE,
`rfc822MailMember` TEXT NOT NULL,
FOREIGN KEY(`alias`) REFERENCES `alias_cache`(`cn`)
ON DELETE CASCADE ON UPDATE CASCADE );
- CREATE INDEX IF NOT EXISTS `alias_1_idx` ON `alias_1_cache`(`alias`);
+ CREATE INDEX IF NOT EXISTS `alias_member_idx` ON `alias_member_cache`(`alias`);
'''
retrieve_sql = '''
SELECT `alias_cache`.`cn` AS `cn`,
- `alias_1_cache`.`rfc822MailMember` AS `rfc822MailMember`
+ `alias_member_cache`.`rfc822MailMember` AS `rfc822MailMember`,
+ `alias_cache`.`mtime` AS `mtime`
FROM `alias_cache`
- LEFT JOIN `alias_1_cache`
- ON `alias_1_cache`.`alias` = `alias_cache`.`cn`
+ LEFT JOIN `alias_member_cache`
+ ON `alias_member_cache`.`alias` = `alias_cache`.`cn`
'''
def retrieve(self, parameters):