Changeset 2977


Ignore:
Timestamp:
06/04/11 11:33:04 (2 years ago)
Author:
xals
Message:

Changed mail addresses model.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • alternc/trunk/install/mysql.sql

    r2974 r2977  
    5151PRIMARY KEY ( `login` ) 
    5252) COMMENT = 'Allowed account for slave dns managment'; 
    53  
    54 #  
    55 # Structure de la table mail_alias 
    56 #  
    57  
    58 CREATE TABLE IF NOT EXISTS `mail_alias` ( 
    59   `mail` varchar(255) NOT NULL default '',      # Adresse email LOCALE 
    60   `alias` varchar(255) NOT NULL default '',     # WRAPPER  
    61   PRIMARY KEY  (`mail`) 
    62 ) TYPE=MyISAM COMMENT='Mail Alias pour postfix'; 
    63  
    64  
    65 CREATE TABLE IF NOT EXISTS `mail_users` ( 
    66   `uid` int(10) unsigned NOT NULL default '0',  # UID AlternC de l`utilisateur du mail 
    67   `alias` varchar(255) NOT NULL default '',     # Alias = Alias intermdiaire (voir domain) 
    68   `path` varchar(255) NOT NULL default '',      # Chemin vers le mail de l`utilisateur 
    69   `password` varchar(255) NOT NULL default '',  # Mot de passe crypt  
    70   PRIMARY KEY  (`alias`), 
    71   KEY `path` (`path`), 
    72   KEY `uid` (`uid`) 
    73 ) TYPE=MyISAM COMMENT='Comptes pop, wrappers, alias'; 
    74  
    75  
    76 CREATE TABLE IF NOT EXISTS `mail_domain` ( 
    77   `mail` varchar(255) NOT NULL default '',      # Adresse email COMPLETE (login@domaine) 
    78   `alias` text NOT NULL,                        # Alias intermdiaire (login_domaine) pour rfrence dans users 
    79   `uid` int(10) unsigned NOT NULL default '0',  # Numro de l utilisateur (alternc) 
    80   `pop` tinyint(4) NOT NULL default '0',        # Est-ce un compte pop ?  
    81   `type` tinyint(4) NOT NULL default '0',       # Je ne sais plus ... 
    82   `expiration_date` datetime DEFAULT null, # Pour les mails temporaire 
    83   PRIMARY KEY  (`mail`), 
    84   KEY `uid` (`uid`), 
    85   KEY `pop` (`pop`) 
    86 ) TYPE=MyISAM COMMENT='Alias en domaine pour Postfix'; 
    8753 
    8854 
     
    244210) TYPE=MyISAM COMMENT='Session actives sur le bureau'; 
    245211 
    246 # 
    247 # Structure de la table `sub_domaines` 
    248 # 
    249 # Sous-domaines des membres 
     212-- 
     213-- Structure de la table `sub_domaines` 
     214-- 
     215-- Sous-domaines des membres 
    250216 
    251217CREATE TABLE IF NOT EXISTS sub_domaines ( 
     218  id bigint(20) unsigned NOT NULL AUTO_INCREMENT, 
    252219  compte int(10) unsigned NOT NULL default '0', 
    253220  domaine varchar(64) NOT NULL default '', 
     
    258225  web_result varchar(255) not null default '', 
    259226  enable enum ('ENABLED', 'ENABLE', 'DISABLED', 'DISABLE') NOT NULL DEFAULT 'ENABLED', 
    260   PRIMARY KEY  (compte,domaine,sub,type) 
     227  PRIMARY KEY (id), 
     228  UNIQUE (compte,domaine,sub,type) 
    261229--  ,FOREIGN KEY (type) REFERENCES (domaines_type) 
    262230) TYPE=MyISAM; 
     231 
     232-- 
     233-- Main address table. 
     234-- 
     235-- Addresses for domain. 
     236 
     237CREATE TABLE `address` ( 
     238  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, -- Technical id. 
     239  `domain_id` bigint(20) unsigned DEFAULT NULL REFERENCES `sub_domain`(`id`), -- FK to sub_domains. 
     240  `address` varchar(255) NOT NULL, -- The address. 
     241  `password` varchar(255) DEFAULT NULL, -- The password associated to the address. 
     242  `enabled` int(1) unsigned NOT NULL DEFAULT '1', -- Enabled flag. 
     243  `expire_date` datetime DEFAULT NULL, -- Expiration date, used for temporary addresses. 
     244  `update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- Update date, for technical usage only. 
     245  PRIMARY KEY (`id`), 
     246  UNIQUE KEY `address` (`address`) 
     247) COMMENT = 'This is the main address table. It represents an address as in RFC2822'; 
     248 
     249-- 
     250-- Mailbox table. 
     251--  
     252-- Local delivered mailboxes. 
     253 
     254CREATE TABLE `mailbox` ( 
     255  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, -- Technical id. 
     256  `address_id` bigint(20) unsigned NOT NULL REFERENCES `address`(`id`), -- Reference to address. 
     257  `path` varchar(255) NOT NULL, -- Relative path to the mailbox. 
     258  `quota` bigint(20) unsigned DEFAULT NULL, -- Quota for this mailbox. 
     259  `delivery` varchar(255) NOT NULL, -- Delivery transport. 
     260  `update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- Update date, for technical usage only. 
     261  PRIMARY KEY (`id`), 
     262  UNIQUE KEY `address_id` (`address_id`) 
     263) COMMENT = 'Table containing local deliverd mailboxes.'; 
     264 
     265-- 
     266-- Other recipients. 
     267-- 
     268-- Other recipients for an address (aliases) 
     269 
     270CREATE TABLE `recipient` ( 
     271  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, -- Technical id. 
     272  `address_id` bigint(20) unsigned NOT NULL REFERENCES `address`(`id`), -- Reference to address 
     273  `recipients` text NOT NULL, -- Recipients 
     274  `update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- Update date, for technical usage only. 
     275  PRIMARY KEY (`id`), 
     276  UNIQUE KEY `address_id` (`address_id`) 
     277) COMMENT = 'Table containing other recipients (aliases) for an address.'; 
     278 
     279-- 
     280-- Mailman table. 
     281-- 
     282-- Table containing mailman addresses 
     283 
     284CREATE TABLE `mailman` ( 
     285  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, -- Technical id. 
     286  `address_id` bigint(20) unsigned NOT NULL REFERENCES `address`(`id`), -- Reference to address 
     287  `delivery` varchar(255) NOT NULL, -- Delivery transport. 
     288  `update_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- Update date, for technical usage only. 
     289  PRIMARY KEY (`id`), 
     290  UNIQUE KEY `address_id` (`address_id`) 
     291) COMMENT = 'Table containing mailman list addresses.'; 
    263292 
    264293# 
Note: See TracChangeset for help on using the changeset viewer.