-- phpMyAdmin SQL Dump
-- version 4.2.12deb2+deb8u2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 10, 2017 at 04:29 PM
-- Server version: 10.0.30-MariaDB-0+deb8u2
-- PHP Version: 5.6.30-0+deb8u1

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `demo`
--

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

--
-- Table structure for table `users`
--

CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL,
  `group_id` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `username` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `remember_token` varchar(255) NOT NULL,
  `is_admin` tinyint(1) NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` int(11) NOT NULL,
  `updated_at` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `users_password_resets`
--

CREATE TABLE IF NOT EXISTS `users_password_resets` (
  `email` varchar(255) NOT NULL,
  `token` varchar(255) NOT NULL,
  `created_at` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `zrm_menu`
--

CREATE TABLE IF NOT EXISTS `zrm_menu` (
`menu_id` int(11) NOT NULL,
  `parent_id` int(11) DEFAULT '0',
  `module` varchar(50) DEFAULT NULL,
  `url` varchar(100) DEFAULT NULL,
  `menu_name` varchar(100) DEFAULT NULL,
  `menu_type` char(10) DEFAULT NULL,
  `role_id` varchar(100) DEFAULT NULL,
  `deep` smallint(2) DEFAULT NULL,
  `ordering` int(6) DEFAULT NULL,
  `position` enum('top','sidebar','both') DEFAULT NULL,
  `menu_icons` varchar(30) DEFAULT NULL,
  `active` enum('0','1') DEFAULT '1',
  `access_data` text,
  `allow_guest` enum('0','1') DEFAULT '0',
  `menu_lang` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `zrm_module`
--

CREATE TABLE IF NOT EXISTS `zrm_module` (
`id` int(11) NOT NULL,
  `module_sql` tinyint(1) NOT NULL,
  `title` varchar(100) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `controller` varchar(50) NOT NULL,
  `folder` varchar(20) NOT NULL,
  `tbl` varchar(255) DEFAULT NULL,
  `tbl_key` varchar(100) DEFAULT NULL,
  `module_type` varchar(15) DEFAULT 'master',
  `module_config` longtext,
  `module_multilang` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `zrm_notification`
--

CREATE TABLE IF NOT EXISTS `zrm_notification` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `from_object` int(11) NOT NULL,
  `to_user` int(11) NOT NULL,
  `to_object` int(11) NOT NULL,
  `url` varchar(1024) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `description` varchar(512) DEFAULT NULL,
  `icon` char(20) DEFAULT NULL,
  `is_read` enum('0','1') DEFAULT '0',
  `sound_played` tinyint(2) NOT NULL,
  `the_type` varchar(9) NOT NULL,
  `sub_type` varchar(9) NOT NULL,
  `important` enum('0','1') NOT NULL,
  `approved` enum('0','1') NOT NULL,
  `object_id` int(11) NOT NULL,
  `stop_for` text,
  `code` varchar(15) NOT NULL,
  `created_at` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `zrm_settings`
--

CREATE TABLE IF NOT EXISTS `zrm_settings` (
`id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `description` longtext NOT NULL,
  `type` tinyint(4) NOT NULL,
  `updated_at` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `zrm_users`
--

CREATE TABLE IF NOT EXISTS `zrm_users` (
  `id` int(11) NOT NULL,
  `group_id` mediumint(8) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `username` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `remember_token` varchar(255) NOT NULL,
  `is_admin` tinyint(1) NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` int(11) NOT NULL,
  `updated_at` int(11) NOT NULL
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `zrm_users`
--

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

--
-- Table structure for table `zrm_users_password_resets`
--

CREATE TABLE IF NOT EXISTS `zrm_users_password_resets` (
  `email` varchar(255) NOT NULL,
  `token` varchar(255) NOT NULL,
  `created_at` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

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

--
-- Table structure for table `zrm_users_roles`
--

CREATE TABLE IF NOT EXISTS `zrm_users_roles` (
`id` mediumint(8) unsigned NOT NULL,
  `name` varchar(20) DEFAULT NULL,
  `description` varchar(100) DEFAULT NULL,
  `level` int(6) DEFAULT NULL
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `zrm_users_roles`
--

INSERT INTO `zrm_users_roles` (`id`, `name`, `description`, `level`) VALUES
(1, 'Dev', NULL, 1),
(2, 'Administrator', NULL, 2);

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

--
-- Table structure for table `zrm_users_roles_access`
--

CREATE TABLE IF NOT EXISTS `zrm_users_roles_access` (
`id` int(6) NOT NULL,
  `group_id` int(6) DEFAULT NULL,
  `module_id` int(6) DEFAULT NULL,
  `access_data` text
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `users`
--
ALTER TABLE `users`
 ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `email` (`email`), ADD KEY `group_id` (`group_id`);

--
-- Indexes for table `users_password_resets`
--
ALTER TABLE `users_password_resets`
 ADD KEY `token` (`token`), ADD KEY `email` (`email`);

--
-- Indexes for table `zrm_menu`
--
ALTER TABLE `zrm_menu`
 ADD PRIMARY KEY (`menu_id`);

--
-- Indexes for table `zrm_module`
--
ALTER TABLE `zrm_module`
 ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `controller` (`controller`,`folder`);

--
-- Indexes for table `zrm_notification`
--
ALTER TABLE `zrm_notification`
 ADD PRIMARY KEY (`id`);

--
-- Indexes for table `zrm_settings`
--
ALTER TABLE `zrm_settings`
 ADD PRIMARY KEY (`id`);

--
-- Indexes for table `zrm_users`
--
ALTER TABLE `zrm_users`
 ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `email` (`email`), ADD KEY `group_id` (`group_id`);

--
-- Indexes for table `zrm_users_password_resets`
--
ALTER TABLE `zrm_users_password_resets`
 ADD KEY `token` (`token`), ADD KEY `email` (`email`);

--
-- Indexes for table `zrm_users_roles`
--
ALTER TABLE `zrm_users_roles`
 ADD PRIMARY KEY (`id`);

--
-- Indexes for table `zrm_users_roles_access`
--
ALTER TABLE `zrm_users_roles_access`
 ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `zrm_menu`
--
ALTER TABLE `zrm_menu`
MODIFY `menu_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `zrm_module`
--
ALTER TABLE `zrm_module`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `zrm_notification`
--
ALTER TABLE `zrm_notification`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `zrm_settings`
--
ALTER TABLE `zrm_settings`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `zrm_users`
--
ALTER TABLE `zrm_users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `zrm_users_roles`
--
ALTER TABLE `zrm_users_roles`
MODIFY `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `zrm_users_roles_access`
--
ALTER TABLE `zrm_users_roles_access`
MODIFY `id` int(6) NOT NULL AUTO_INCREMENT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
