CREATE TABLE IF NOT EXISTS `tySiteUserAction` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `verified` tinytext NOT NULL,
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=455 ;

CREATE TABLE IF NOT EXISTS `tySiteUserLog` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `session_id` varchar(32) NOT NULL default '',
  `subject_id` int(10) unsigned NOT NULL default '0',
  `log_typ` varchar(255) NOT NULL default '',
  `modul_name` varchar(255) NOT NULL default '',
  `resource_name` varchar(255) NOT NULL default '',
  `action_name` varchar(255) NOT NULL default '',
  `description` varchar(255) NOT NULL default '',
  `log_time` timestamp NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `session_subject_index` (`session_id`,`subject_id`)
) TYPE=MyISAM AUTO_INCREMENT=30675 ;

CREATE TABLE IF NOT EXISTS `tySiteUserModule` (
  `id` int(11) NOT NULL auto_increment,
  `version` varchar(255) NOT NULL default '',
  `name` varchar(255) NOT NULL default '',
  `verified` tinytext NOT NULL,
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=388 ;

CREATE TABLE IF NOT EXISTS `tySiteUserPolicy` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `resources_ID` int(10) unsigned NOT NULL default '0',
  `action_id` int(10) unsigned NOT NULL default '0',
  `verified` tinytext NOT NULL,
  PRIMARY KEY  (`id`,`resources_ID`,`action_id`),
  KEY `Policy_FKIndex1` (`resources_ID`),
  KEY `Policy_FKIndex2` (`action_id`)
) TYPE=MyISAM AUTO_INCREMENT=926 ;


CREATE TABLE IF NOT EXISTS `tySiteUserPolicySet` (
  `role_id` int(10) unsigned NOT NULL default '0',
  `policy_id` int(10) unsigned NOT NULL default '0',
  `verified` tinytext NOT NULL,
  PRIMARY KEY  (`role_id`,`policy_id`)
) TYPE=MyISAM;


CREATE TABLE IF NOT EXISTS `tySiteUserRessource` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `modul_id` varchar(255) NOT NULL default '',
  `name` varchar(255) NOT NULL default '',
  `typ` varchar(255) NOT NULL default '',
  `verified` tinytext NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `resources_FKIndex1` (`modul_id`)
) TYPE=MyISAM AUTO_INCREMENT=533 ;

CREATE TABLE IF NOT EXISTS `tySiteUserRole` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `maxusers` int(11) NOT NULL default '-1',
  `verified` tinytext NOT NULL,
  PRIMARY KEY  (`id`)
) TYPE=MyISAM AUTO_INCREMENT=153 ;


CREATE TABLE IF NOT EXISTS `tySiteUserRoleParentChild` (
  `parent_role_id` int(10) unsigned NOT NULL default '0',
  `child_role_id` int(10) unsigned NOT NULL default '0',
  `verified` tinytext NOT NULL,
  PRIMARY KEY  (`parent_role_id`,`child_role_id`),
  KEY `rolle_has_rolle_FKIndex1` (`parent_role_id`),
  KEY `rolle_has_rolle_FKIndex2` (`child_role_id`)
) TYPE=MyISAM;


CREATE TABLE IF NOT EXISTS `tySiteUserRoleRef` (
  `role_id` int(10) unsigned NOT NULL default '0',
  `subject_id` int(10) unsigned NOT NULL default '0',
  `verified` tinytext NOT NULL,
  PRIMARY KEY  (`role_id`,`subject_id`),
  KEY `subject_has_rolle_FKIndex1` (`subject_id`),
  KEY `subject_has_rolle_FKIndex2` (`role_id`)
) TYPE=MyISAM;


CREATE TABLE IF NOT EXISTS `tySiteUserSubject` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `email` varchar(100) NOT NULL default '',
  `passwort` varchar(100) NOT NULL default '',
  `privs` text NOT NULL,
  `verified` tinytext NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `subject_index` (`email`,`passwort`)
) TYPE=MyISAM;


CREATE TABLE IF NOT EXISTS `tySiteUserSubjectAttribute` (
  `subject_id` int(10) unsigned NOT NULL default '0',
  `name` varchar(255) NOT NULL default '',
  `value` varchar(255) NOT NULL default '',
  `verified` tinytext NOT NULL,
  KEY `subject_attribute_FKIndex1` (`subject_id`)
) TYPE=MyISAM;

CREATE TABLE IF NOT EXISTS `tySiteUserFetched` (
  `modul` varchar(255) NOT NULL default '',
  `ressource` varchar(255) NOT NULL default '',
  `action` varchar(255) NOT NULL default ''
) TYPE=MyISAM;