:VERSION 5		# -------------------------

BEGIN;

CREATE TABLE IF NOT EXISTS `UserAccounts` (
  `PrincipalID` char(36) NOT NULL,
  `ScopeID` char(36) NOT NULL,
  `FirstName` varchar(64) NOT NULL,
  `LastName` varchar(64) NOT NULL,
  `Email` varchar(64) DEFAULT NULL,
  `ServiceURLs` text,
  `Created` int(11) DEFAULT NULL,
  `UserLevel` int(11) NOT NULL DEFAULT '0',
  `UserFlags` int(11) NOT NULL DEFAULT '0',
  `UserTitle` varchar(64) NOT NULL DEFAULT '',
  UNIQUE KEY `PrincipalID` (`PrincipalID`),
  KEY `Email` (`Email`),
  KEY `FirstName` (`FirstName`),
  KEY `LastName` (`LastName`),
  KEY `Name` (`FirstName`,`LastName`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

COMMIT;

:VERSION 6		# -------------------------

BEGIN;

ALTER TABLE `UserAccounts` ADD `active` INT NOT NULL DEFAULT '1';

COMMIT;
