CREATE TABLE liveuser_users (authUserId INT NOT NULL AUTO_INCREMENT PRIMARY KEY, handle CHAR (32) DEFAULT '' NOT NULL, passwd CHAR (32) DEFAULT '' NOT NULL, lastLogin DATETIME DEFAULT NULL, isActive TINYINT(1) DEFAULT NULL, owner_user_id INT DEFAULT NULL, owner_group_id INT DEFAULT NULL) ALTER TABLE liveuser_users ADD UNIQUE users_unique_i_idx (handle) CREATE TABLE liveuser_perm_users (perm_user_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, auth_user_id INT DEFAULT 0 NOT NULL, auth_container_name CHAR (32) DEFAULT '' NOT NULL, perm_type INT DEFAULT NULL) ALTER TABLE liveuser_perm_users ADD UNIQUE perm_users_auth_id_i_idx (auth_user_id, auth_container_name) CREATE TABLE liveuser_userrights (perm_user_id INT DEFAULT 0 NOT NULL, right_id INT DEFAULT 0 NOT NULL, right_level INT DEFAULT NULL) ALTER TABLE liveuser_userrights ADD UNIQUE userrights_id_i_idx (perm_user_id, right_id) CREATE TABLE liveuser_rights (right_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, area_id INT DEFAULT 0 NOT NULL, right_define_name CHAR (32) DEFAULT '' NOT NULL, has_implied TINYINT(1) DEFAULT NULL) ALTER TABLE liveuser_rights ADD UNIQUE rights_define_name_i_idx (area_id, right_define_name) CREATE TABLE liveuser_right_implied (right_id INT DEFAULT 0 NOT NULL, implied_right_id INT DEFAULT 0 NOT NULL) ALTER TABLE liveuser_right_implied ADD UNIQUE right_implied_id_i_idx (right_id, implied_right_id) CREATE TABLE liveuser_translations (translation_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, section_id INT DEFAULT 0 NOT NULL, section_type INT DEFAULT 0 NOT NULL, language_id CHAR (32) DEFAULT '' NOT NULL, name CHAR (32) DEFAULT NULL, description CHAR (32) DEFAULT NULL) ALTER TABLE liveuser_translations ADD UNIQUE translations_translation_i_idx (section_id, section_type, language_id) CREATE TABLE liveuser_areas (area_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, application_id INT DEFAULT 0 NOT NULL, area_define_name CHAR (32) DEFAULT '' NOT NULL) ALTER TABLE liveuser_areas ADD UNIQUE areas_define_name_i_idx (application_id, area_define_name) CREATE TABLE liveuser_area_admin_areas (area_id INT DEFAULT 0 NOT NULL, perm_user_id INT DEFAULT 0 NOT NULL) ALTER TABLE liveuser_area_admin_areas ADD UNIQUE area_admin_areas_id_i_idx (area_id, perm_user_id) CREATE TABLE liveuser_applications (application_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, application_define_name CHAR (32) DEFAULT '' NOT NULL) ALTER TABLE liveuser_applications ADD UNIQUE applications_define_name_i_idx (application_define_name) CREATE TABLE liveuser_groups (group_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, group_type INT DEFAULT NULL, group_define_name CHAR (32) DEFAULT '' NOT NULL) ALTER TABLE liveuser_groups ADD UNIQUE groups_define_name_i_idx (group_define_name) CREATE TABLE liveuser_groupusers (perm_user_id INT DEFAULT 0 NOT NULL, group_id INT DEFAULT 0 NOT NULL) ALTER TABLE liveuser_groupusers ADD UNIQUE groupusers_id_i_idx (perm_user_id, group_id) CREATE TABLE liveuser_grouprights (group_id INT DEFAULT 0 NOT NULL, right_id INT DEFAULT 0 NOT NULL, right_level INT DEFAULT NULL) ALTER TABLE liveuser_grouprights ADD UNIQUE grouprights_id_i_idx (group_id, right_id) CREATE TABLE liveuser_group_subgroups (group_id INT DEFAULT 0 NOT NULL, subgroup_id INT DEFAULT 0 NOT NULL) ALTER TABLE liveuser_group_subgroups ADD UNIQUE group_subgroups_id_i_idx (group_id, subgroup_id)