-- http://www.phpmyadmin.net
-- 
-- Servidor: localhost
-- Tiempo de generación: 21-07-2008 a las 15:34:07
-- Versión del servidor: 5.0.45
-- Versión de PHP: 5.2.4
-- 
-- Base de datos: `modelo`
-- 

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

-- 
-- Estructura de tabla para la tabla `cascade_delete`
-- 

CREATE TABLE `cascade_delete` (
  `cascade_delete_id` int(10) unsigned NOT NULL auto_increment,
  `parent` varchar(100) collate utf8_spanish_ci NOT NULL,
  `parent_index` varchar(100) collate utf8_spanish_ci NOT NULL,
  `child` varchar(100) collate utf8_spanish_ci NOT NULL,
  `child_index` varchar(100) collate utf8_spanish_ci NOT NULL,
  PRIMARY KEY  (`cascade_delete_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=26 ;

-- 
-- Volcar la base de datos para la tabla `cascade_delete`
-- 

INSERT INTO `cascade_delete` (`cascade_delete_id`, `parent`, `parent_index`, `child`, `child_index`) VALUES 
(7, 'security_menus', 'menu_id', 'security_submenus', 'submenu_id'),
(8, 'security_profiles', 'profile_id', 'security_users', 'user_id'),
(9, 'security_profiles', 'profile_id', 'security_profiles_submenus', 'profile_submenu_id'),
(10, 'security_submenus', 'submenu_id', 'security_profiles_submenus', 'profile_submenu_id');

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

-- 
-- Estructura de tabla para la tabla `security_menus`
-- 

CREATE TABLE `security_menus` (
  `menu_id` int(10) unsigned NOT NULL auto_increment,
  `menu` varchar(50) collate utf8_spanish_ci NOT NULL,
  `allowed` tinyint(3) unsigned NOT NULL default '0',
  PRIMARY KEY  (`menu_id`),
  KEY `index_menu` (`menu`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=21 ;

-- 
-- Volcar la base de datos para la tabla `security_menus`
-- 

INSERT INTO `security_menus` (`menu_id`, `menu`, `allowed`) VALUES 
(1, 'Comienzo', 1),
(2, 'Meta System', 1),
(3, 'Seguridad', 1);

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

-- 
-- Estructura de tabla para la tabla `security_profiles`
-- 

CREATE TABLE `security_profiles` (
  `profile_id` int(10) unsigned NOT NULL auto_increment,
  `profile` varchar(50) collate utf8_spanish_ci NOT NULL,
  `allowed` tinyint(3) unsigned NOT NULL default '0',
  PRIMARY KEY  (`profile_id`),
  KEY `index_profile` (`profile`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=7 ;

-- 
-- Volcar la base de datos para la tabla `security_profiles`
-- 

INSERT INTO `security_profiles` (`profile_id`, `profile`, `allowed`) VALUES 
(1, 'root', 1),
(2, 'Administrador', 1);

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

-- 
-- Estructura de tabla para la tabla `security_profiles_submenus`
-- 

CREATE TABLE `security_profiles_submenus` (
  `profile_submenu_id` int(10) unsigned NOT NULL auto_increment,
  `submenu_id` int(10) unsigned NOT NULL default '0',
  `profile_id` int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (`profile_submenu_id`),
  KEY `index_profile` (`profile_id`),
  KEY `index_submenu` (`submenu_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=14 ;

-- 
-- Volcar la base de datos para la tabla `security_profiles_submenus`
-- 

INSERT INTO `security_profiles_submenus` (`profile_submenu_id`, `submenu_id`, `profile_id`) VALUES 
(1, 1, 1),
(2, 2, 1),
(3, 3, 1),
(4, 4, 1),
(5, 5, 1),
(6, 6, 1),
(7, 7, 1),
(8, 8, 1),
(9, 9, 1),
(10, 10, 1),
(11, 1, 2),
(12, 2, 2),
(13, 3, 2);

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

-- 
-- Estructura de tabla para la tabla `security_submenus`
-- 

CREATE TABLE `security_submenus` (
  `submenu_id` int(10) unsigned NOT NULL auto_increment,
  `menu_id` int(10) unsigned NOT NULL default '0',
  `submenu` varchar(50) collate utf8_spanish_ci NOT NULL,
  `script` varchar(255) collate utf8_spanish_ci NOT NULL,
  `visible` tinyint(3) unsigned NOT NULL default '0',
  `allowed` tinyint(3) unsigned NOT NULL default '0',
  PRIMARY KEY  (`submenu_id`),
  KEY `index_submenu` (`submenu`),
  KEY `index_script` (`script`),
  KEY `index_menu` (`menu_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=11 ;

-- 
-- Volcar la base de datos para la tabla `security_submenus`
-- 

INSERT INTO `security_submenus` (`submenu_id`, `menu_id`, `submenu`, `script`, `visible`, `allowed`) VALUES 
(1, 1, '  Inicio', 'index.php', 1, 1),
(2, 1, ' Mis Datos', 'metadata/user.php', 1, 1),
(3, 1, 'Salir', 'security/logoff.php', 1, 1),
(4, 2, 'Borrado en Cascada', 'metasystem/cascade_delete.php', 1, 1),
(5, 2, 'Generar Menús', 'metasystem/generate_menus.php', 1, 1),
(6, 3, 'Menús', 'metadata/menus.php', 1, 1),
(7, 3, 'Perfiles', 'metadata/profiles.php', 1, 1),
(8, 3, 'Perfiles - Submenús', 'metadata/profiles_submenus.php', 1, 1),
(9, 3, 'Submenús', 'metadata/submenus.php', 1, 1),
(10, 3, 'Usuarios', 'metadata/users.php', 1, 1);
