 
 -- ---- create users table:
 CREATE TABLE `users` (
-	`userId` int(11) unsigned NOT NULL AUTO_INCREMENT,
+	`userId` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
 	`realname` varchar(60) NOT NULL,
 	`email` varchar(60) NOT NULL,
 	`password` char(60) NOT NULL,


-- ---- create roles table:
CREATE TABLE `roles` (
	`roleId` int(11) unsigned NOT NULL AUTO_INCREMENT,
	`name` varchar(40) NOT NULL,
	`parent` int(11) NOT NULL,
	PRIMARY KEY (`roleId`),


-- ---- create permissions table:
CREATE TABLE `permissions` (
	`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
	`roleId` smallint(5) unsigned NOT NULL,
	`resourceId` smallint(5) unsigned NOT NULL,
	`privilegeId` smallint(5) unsigned NOT NULL,
	`allowed` enum('no','yes') NOT NULL DEFAULT 'yes',
	PRIMARY KEY (`id`),
	KEY `resource` (`resourceId`),
