 --
 
 CREATE TABLE IF NOT EXISTS `xpa_mailbox` (
-  `username` varchar(255) NOT NULL default '',
+  `mailbox_id` int(11) NOT NULL auto_increment,
+  `email_address` varchar(255) NOT NULL,
   `password` varchar(255) NOT NULL default '',
   `name` varchar(255) NOT NULL default '',
   `maildir` varchar(255) NOT NULL default '',
   `quota` int(10) NOT NULL default '0',
-  `domain` varchar(255) NOT NULL default '',
+  `domain_id` int(11) NOT NULL default '0',
   `created` datetime NOT NULL default '0000-00-00 00:00:00',
   `modified` datetime NOT NULL default '0000-00-00 00:00:00',
   `active` tinyint(1) NOT NULL default '1',
-  PRIMARY KEY  (`username`),
-  KEY `username` (`username`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Postfix Admin - Virtual Mailboxes';
+  PRIMARY KEY  (`mailbox_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Postfix Admin - Virtual Mailboxes' AUTO_INCREMENT=1 ;
 
 -- --------------------------------------------------------
 

--

CREATE TABLE IF NOT EXISTS `xpa_alias` (
  `address` varchar(255) NOT NULL default '',
  `goto` text NOT NULL,
  `domain` varchar(255) NOT NULL default '',
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  `modified` datetime NOT NULL default '0000-00-00 00:00:00',
  `active` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`address`),
  KEY `address` (`address`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Postfix Admin - Virtual Aliases';

-- --------------------------------------------------------


  `modified` datetime NOT NULL default '0000-00-00 00:00:00',
  `active` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`domain_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 COMMENT='Postfix Admin - Virtual Domains' AUTO_INCREMENT=6 ;

-- --------------------------------------------------------

