-- http://www.phpmyadmin.net
--




--
-- Database: `capabilitiesdb`
--

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

--
-- Table structure for table `accesslevel`
--

CREATE TABLE IF NOT EXISTS `accesslevel` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

--
-- Dumping data for table `accesslevel`
--

INSERT INTO `accesslevel` (`id`, `name`, `description`) VALUES
(1, 'superadmin', 'Super Admin'),
(2, 'admin', 'Admin'),
(3, 'resource', 'Resource');

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

--
-- Table structure for table `assessment`
--

CREATE TABLE IF NOT EXISTS `assessment` (
  `id` int(11) NOT NULL,
  `resource_id` int(11) NOT NULL,
  `rescriteria_id` int(11) NOT NULL,
  `value` int(11) DEFAULT NULL,
  `date` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_evaluation_resource1` (`resource_id`),
  KEY `fk_evaluation_evalcriteria1` (`rescriteria_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `auth_assignment`
--

CREATE TABLE IF NOT EXISTS `auth_assignment` (
  `item_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `user_id` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `created_at` int(11) DEFAULT NULL,
  PRIMARY KEY (`item_name`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `auth_assignment`
--

INSERT INTO `auth_assignment` (`item_name`, `user_id`, `created_at`) VALUES
('Employee', '1', 1455030048),
('Employee', '10', 1457715959),
('Employee', '11', 1455031365),
('Employee', '12', 1457715967),
('Employee', '13', 1457715977),
('Employee', '14', 1456763743),
('Employee', '15', 1457715984),
('Employee', '16', 1457715991),
('Employee', '17', 1458064505),
('Employee', '18', 1465498852),
('Employee', '19', 1468421453),
('Employee', '2', 1455030057),
('Employee', '20', 1468421530),
('Employee', '3', 1455031384),
('Employee', '4', 1457715582),
('Employee', '5', 1456769065),
('Employee', '6', 1457715918),
('Employee', '7', 1455031375),
('Employee', '8', 1457715935),
('Employee', '9', 1457715945),
('HumanResources', '11', 1455031365),
('HumanResources', '18', 1468421250),
('HumanResources', '19', 1468421453),
('HumanResources', '20', 1468421530),
('Supervisor', '1', 1455030048),
('Supervisor', '10', 1457717350),
('Supervisor', '11', 1455031365),
('Supervisor', '12', 1457717357),
('Supervisor', '13', 1457717365),
('Supervisor', '17', 1458064587),
('Supervisor', '18', 1465498854),
('Supervisor', '19', 1468421453),
('Supervisor', '20', 1468421530),
('Supervisor', '7', 1455031375),
('sysadmin', '18', 1465485356),
('sysadmin', '19', 1468421453);

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

--
-- Table structure for table `auth_item`
--

CREATE TABLE IF NOT EXISTS `auth_item` (
  `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `type` int(11) NOT NULL,
  `description` text COLLATE utf8_unicode_ci,
  `rule_name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,
  `data` text COLLATE utf8_unicode_ci,
  `created_at` int(11) DEFAULT NULL,
  `updated_at` int(11) DEFAULT NULL,
  PRIMARY KEY (`name`),
  KEY `rule_name` (`rule_name`),
  KEY `idx-auth_item-type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `auth_item`
--

INSERT INTO `auth_item` (`name`, `type`, `description`, `rule_name`, `data`, `created_at`, `updated_at`) VALUES
('/admin/*', 2, NULL, NULL, NULL, 1465430752, 1465430752),
('/department/*', 2, NULL, NULL, NULL, 1465432185, 1465432185),
('/evaluation-evaluationstatus/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/evaluation/*', 2, NULL, NULL, NULL, 1465485169, 1465485169),
('/evaluationstatus/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/gii/*', 2, NULL, NULL, NULL, 1465430754, 1465430754),
('/goal/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/jobdescription-evaluation/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/jobdescription-responsibility/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/jobdescription/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/organizational-evaluation/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/organizationalcriteria/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/position-evaluation/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/position/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/resource-jobdescription/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/resource-position/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/resource/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/resourceevaluation-jobdescription/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/resourceevaluation-organizationalcriteria/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/resourceevaluation-valuescriteria/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/responsibility/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/site/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/user-resource/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/user/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/usertype/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/values-evaluation/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('/valuescriteria/*', 2, NULL, NULL, NULL, 1465485254, 1465485254),
('Employee', 1, 'Employee Role', NULL, NULL, 1454960073, 1454960073),
('evaluationAcceptation', 2, 'Ability to accept an evaluation and move it from one state to another', NULL, NULL, 1455029842, 1455029869),
('evaluationCreate', 2, 'Create Evaluation', NULL, NULL, 1454940215, 1454956408),
('evaluationRejection', 2, 'Ability to reject an evaluation', NULL, NULL, 1455029191, 1455029191),
('evaluationUpdate', 2, 'Evaluation Update', NULL, NULL, 1455028806, 1455028806),
('evaluationView', 2, 'View evaluation', NULL, NULL, 1455028870, 1455028870),
('hrViews', 2, 'Views which only a human resource can access', NULL, NULL, 1455029123, 1455029123),
('HumanResources', 1, NULL, NULL, NULL, 1454956619, 1454957060),
('jobdescriptionCreate', 2, 'Create a Job Description', NULL, NULL, 1455034601, 1455034601),
('jobdescriptionList', 2, 'List of job descriptions', NULL, NULL, 1455034884, 1455034884),
('jobdescriptionUpdate', 2, 'Update a job description', NULL, NULL, 1455034619, 1455034619),
('jobdescriptionView', 2, 'View a job description', NULL, NULL, 1455034854, 1455034854),
('organizationalcriteriaCreate', 2, 'Create an organizational criteria item.', NULL, NULL, 1455035089, 1455035089),
('organizationalcriteriaList', 2, 'List of all organizational criteria.', NULL, NULL, 1455035175, 1455035175),
('organizationalcriteriaUpdate', 2, 'Update an organizational criteria item.', NULL, NULL, 1455035105, 1455035105),
('organizationalcriteriaView', 2, 'View an organizational criteria item.', NULL, NULL, 1455035149, 1455035149),
('positionCreate', 2, 'Create position', NULL, NULL, 1455034515, 1455034515),
('positionList', 2, 'List of positions', NULL, NULL, 1455034579, 1455034579),
('positionUpdate', 2, 'Update Position', NULL, NULL, 1455034537, 1455034537),
('positionView', 2, 'View a position', NULL, NULL, 1455034564, 1455034564),
('resourceCreate', 2, 'Create resource', NULL, NULL, 1455034369, 1455034369),
('resourceList', 2, 'List of all resources', NULL, NULL, 1455034425, 1455034425),
('resourceUpdate', 2, 'Update a resource', NULL, NULL, 1455034386, 1455034386),
('resourceView', 2, 'View resource', NULL, NULL, 1455034408, 1455034408),
('Supervisor', 1, NULL, NULL, NULL, 1454940272, 1454956595),
('supervisorViews', 2, 'Views which only a supervisor can access', NULL, NULL, 1455029089, 1455029089),
('sysadmin', 1, 'System administration has access to all models and views, including the admin module and the gii module.', NULL, NULL, 1465485313, 1465485313),
('valuesCreate', 2, 'Create a value', NULL, NULL, 1455034901, 1455034901),
('valuesList', 2, 'List of values', NULL, NULL, 1455034946, 1455034946),
('valuesUpdate', 2, 'Update a value', NULL, NULL, 1455034914, 1455034914),
('valuesView', 2, 'View a value', NULL, NULL, 1455034935, 1455034935);

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

--
-- Table structure for table `auth_item_child`
--

CREATE TABLE IF NOT EXISTS `auth_item_child` (
  `parent` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `child` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`parent`,`child`),
  KEY `child` (`child`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `auth_item_child`
--

INSERT INTO `auth_item_child` (`parent`, `child`) VALUES
('sysadmin', '/admin/*'),
('sysadmin', '/department/*'),
('sysadmin', '/evaluation-evaluationstatus/*'),
('sysadmin', '/evaluation/*'),
('sysadmin', '/evaluationstatus/*'),
('sysadmin', '/gii/*'),
('sysadmin', '/goal/*'),
('sysadmin', '/jobdescription-evaluation/*'),
('sysadmin', '/jobdescription-responsibility/*'),
('sysadmin', '/jobdescription/*'),
('sysadmin', '/organizational-evaluation/*'),
('sysadmin', '/organizationalcriteria/*'),
('sysadmin', '/position-evaluation/*'),
('sysadmin', '/position/*'),
('sysadmin', '/resource-jobdescription/*'),
('sysadmin', '/resource-position/*'),
('sysadmin', '/resource/*'),
('sysadmin', '/resourceevaluation-jobdescription/*'),
('sysadmin', '/resourceevaluation-organizationalcriteria/*'),
('sysadmin', '/resourceevaluation-valuescriteria/*'),
('sysadmin', '/responsibility/*'),
('sysadmin', '/site/*'),
('sysadmin', '/user-resource/*'),
('sysadmin', '/user/*'),
('sysadmin', '/usertype/*'),
('sysadmin', '/values-evaluation/*'),
('sysadmin', '/valuescriteria/*'),
('sysadmin', 'Employee'),
('HumanResources', 'evaluationAcceptation'),
('Supervisor', 'evaluationCreate'),
('HumanResources', 'evaluationRejection'),
('Supervisor', 'evaluationUpdate'),
('Employee', 'evaluationView'),
('HumanResources', 'evaluationView'),
('Supervisor', 'evaluationView'),
('HumanResources', 'hrViews'),
('sysadmin', 'HumanResources'),
('HumanResources', 'jobdescriptionCreate'),
('HumanResources', 'jobdescriptionList'),
('HumanResources', 'jobdescriptionUpdate'),
('HumanResources', 'jobdescriptionView'),
('HumanResources', 'organizationalcriteriaCreate'),
('HumanResources', 'organizationalcriteriaList'),
('HumanResources', 'organizationalcriteriaUpdate'),
('HumanResources', 'organizationalcriteriaView'),
('HumanResources', 'positionCreate'),
('HumanResources', 'positionList'),
('HumanResources', 'positionUpdate'),
('HumanResources', 'positionView'),
('HumanResources', 'resourceCreate'),
('HumanResources', 'resourceList'),
('HumanResources', 'resourceUpdate'),
('HumanResources', 'resourceView'),
('sysadmin', 'Supervisor'),
('Supervisor', 'supervisorViews'),
('HumanResources', 'valuesCreate'),
('HumanResources', 'valuesList'),
('HumanResources', 'valuesUpdate'),
('HumanResources', 'valuesView');

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

--
-- Table structure for table `auth_rule`
--

CREATE TABLE IF NOT EXISTS `auth_rule` (
  `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `data` text COLLATE utf8_unicode_ci,
  `created_at` int(11) DEFAULT NULL,
  `updated_at` int(11) DEFAULT NULL,
  PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `badge`
--

CREATE TABLE IF NOT EXISTS `badge` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `contactinformation`
--

CREATE TABLE IF NOT EXISTS `contactinformation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `email` varchar(75) NOT NULL,
  `alternate_email` varchar(75) DEFAULT NULL,
  `phone_number` varchar(15) DEFAULT NULL,
  `alternate_phone_number` varchar(15) DEFAULT NULL,
  `phy_address` varchar(45) DEFAULT NULL,
  `phy_city` varchar(45) DEFAULT NULL,
  `phy_state` varchar(45) DEFAULT NULL,
  `phy_country` varchar(45) DEFAULT NULL,
  `phy_zipcode` varchar(45) DEFAULT NULL,
  `postal_address` varchar(45) DEFAULT NULL,
  `postal_city` varchar(45) DEFAULT NULL,
  `postal_state` varchar(45) DEFAULT NULL,
  `postal_country` varchar(45) DEFAULT NULL,
  `postal_zipcode` varchar(45) DEFAULT NULL,
  `resource_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_contactinformation_resource1_idx` (`resource_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `customercompany`
--

CREATE TABLE IF NOT EXISTS `customercompany` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) DEFAULT NULL,
  `industry` varchar(45) DEFAULT NULL,
  `phone_number` varchar(45) DEFAULT NULL,
  `physical_address` varchar(45) DEFAULT NULL,
  `physical_city` varchar(45) DEFAULT NULL,
  `physical_state` char(2) DEFAULT NULL,
  `physical_country` varchar(45) DEFAULT NULL,
  `physical_zipcode` varchar(10) DEFAULT NULL,
  `postal_address` varchar(45) DEFAULT NULL,
  `postal_city` varchar(45) DEFAULT NULL,
  `postal_state` varchar(45) DEFAULT NULL,
  `postal_country` varchar(45) DEFAULT NULL,
  `postal_zipcode` varchar(45) DEFAULT NULL,
  `fax` varchar(45) DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `notes` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `customercontact`
--

CREATE TABLE IF NOT EXISTS `customercontact` (
  `id` int(11) NOT NULL,
  `name` varchar(45) DEFAULT NULL,
  `position` varchar(45) DEFAULT NULL,
  `phone_number` varchar(45) DEFAULT NULL,
  `active` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `department`
--

CREATE TABLE IF NOT EXISTS `department` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `description` text,
  `create_at` datetime DEFAULT NULL,
  `modified_at` datetime DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `modified_by` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

--
-- Dumping data for table `department`
--

INSERT INTO `department` (`id`, `name`, `description`, `create_at`, `modified_at`, `created_by`, `modified_by`) VALUES
(1, 'Engineering', 'Engineering', NULL, NULL, NULL, NULL),
(2, 'Administration', 'Administration', NULL, NULL, NULL, NULL),
(3, 'Electric and Installations', 'Electric and Installations', NULL, NULL, NULL, NULL),
(4, 'Instrumentation', 'Instrumentation', NULL, NULL, NULL, NULL);

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

--
-- Table structure for table `evaluation`
--

CREATE TABLE IF NOT EXISTS `evaluation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) DEFAULT NULL,
  `description` text,
  `date` datetime DEFAULT NULL,
  `period_start_date` date DEFAULT NULL,
  `period_end_date` date DEFAULT NULL,
  `resource_id` int(11) NOT NULL,
  `currentstate` int(11) DEFAULT NULL,
  `jobdescription_weight` decimal(4,1) DEFAULT NULL,
  `organizational_weight` decimal(4,1) DEFAULT NULL,
  `values_weight` decimal(4,1) DEFAULT NULL,
  `jobdescription_percent` decimal(4,1) DEFAULT NULL,
  `organizational_percent` decimal(4,1) DEFAULT NULL,
  `values_percent` decimal(4,1) DEFAULT NULL,
  `total_percent` decimal(4,1) DEFAULT NULL,
  `previousevaluation_id` int(11) DEFAULT NULL,
  `position_id` int(11) DEFAULT NULL,
  `goals_percent` decimal(4,1) DEFAULT NULL,
  `past_goals_text` text,
  `goals_weight` decimal(4,1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_evaluation_resource_jobdescription1_idx` (`resource_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;

--
-- Dumping data for table `evaluation`
--

INSERT INTO `evaluation` (`id`, `name`, `description`, `date`, `period_start_date`, `period_end_date`, `resource_id`, `currentstate`, `jobdescription_weight`, `organizational_weight`, `values_weight`, `jobdescription_percent`, `organizational_percent`, `values_percent`, `total_percent`, `previousevaluation_id`, `position_id`, `goals_percent`, `past_goals_text`, `goals_weight`) VALUES
(9, NULL, NULL, '2016-07-13 00:00:00', '2015-07-01', '2016-06-30', 19, 2, 0.3, 0.1, 0.6, 200.0, 64.1, 100.0, 113.2, NULL, 27, 100.0, 'Ninguna', 0.5);

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

--
-- Table structure for table `evaluationstatus`
--

CREATE TABLE IF NOT EXISTS `evaluationstatus` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `state_num` int(11) DEFAULT NULL,
  `name` varchar(100) DEFAULT NULL,
  `description` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;

--
-- Dumping data for table `evaluationstatus`
--

INSERT INTO `evaluationstatus` (`id`, `state_num`, `name`, `description`) VALUES
(1, 1, 'New/Draft', 'State 1: New Evaluation'),
(2, 2, 'Human Resources Supervisor Revision', 'State 2: Human Resources revision of supervisor evaluation.  If evaluation approved, go to state 3, otherwise, go to state 6.'),
(3, 3, 'Evaluation in hold to employee', 'State 3: Evaluation ready to discuss but not available to employee view (it will be available only when supervisor marks it as ready).'),
(4, 4, 'Employee review and feedback', 'State 4: Evaluation available to employee.  Employee review and feedback. Evaluation must be printed and signed. Waiting for HR approval'),
(5, 5, 'Evaluation Print', 'State 5: Evaluation Print'),
(6, 6, 'Human Resources Employee Revision', 'State 6: Human Resources revision of employee feedback.  If evaluation approved, go to state 7, otherwise, go to state 9.'),
(7, 7, 'Filed', 'State 7: Final Approved.  Evaluation stored as final.'),
(8, 8, 'Rejected (Draft)', 'State 8: New Rejected.  HR reject evaluation based on supervisor comments. Evaluation assigned again to supervisor.  Re-evaluation required.'),
(9, 9, 'Rejected (Discussed)', 'State 9: Final Rejected.  HR reject evaluation based on employee feedback. '),
(10, 10, 'Rejected', 'State 10: Final Rejected.  Evaluation rejected on state 6.  Stored for historic purposes.');

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

--
-- Table structure for table `evaluation_evaluationstatus`
--

CREATE TABLE IF NOT EXISTS `evaluation_evaluationstatus` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `evaluation_id` int(11) NOT NULL,
  `evaluationstatus_id` int(11) NOT NULL,
  `date` datetime DEFAULT NULL,
  `last_modified` datetime DEFAULT NULL,
  `modified_by` varchar(100) DEFAULT NULL,
  `comment` text,
  PRIMARY KEY (`id`),
  KEY `fk_evaluation_evaluationstatus_evaluation1_idx` (`evaluation_id`),
  KEY `fk_evaluation_evaluationstatus_evaluationstatus1_idx` (`evaluationstatus_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=37 ;

--
-- Dumping data for table `evaluation_evaluationstatus`
--

INSERT INTO `evaluation_evaluationstatus` (`id`, `evaluation_id`, `evaluationstatus_id`, `date`, `last_modified`, `modified_by`, `comment`) VALUES
(35, 9, 1, '2016-07-13 16:38:23', '2016-07-13 16:38:23', NULL, NULL),
(36, 9, 2, '2016-07-13 18:54:24', '2016-07-13 18:54:24', NULL, NULL);

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

--
-- Table structure for table `goal`
--

CREATE TABLE IF NOT EXISTS `goal` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) DEFAULT NULL,
  `description` text,
  `evaluation_id` int(11) NOT NULL,
  `points` int(11) DEFAULT NULL,
  `min` int(11) DEFAULT NULL,
  `max` int(11) DEFAULT NULL,
  `comment` text,
  `definition` text,
  PRIMARY KEY (`id`),
  KEY `fk_goal_evaluation1_idx` (`evaluation_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `jobdescription`
--

CREATE TABLE IF NOT EXISTS `jobdescription` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) DEFAULT NULL,
  `description` text,
  `created_at` datetime DEFAULT NULL,
  `modified_at` datetime DEFAULT NULL,
  `department_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk-jobdescription-department_id` (`department_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ;

--
-- Dumping data for table `jobdescription`
--

INSERT INTO `jobdescription` (`id`, `name`, `description`, `created_at`, `modified_at`, `department_id`) VALUES
(1, 'president', 'President', NULL, NULL, 2),
(2, 'englead', 'Engineer/Automation Lead', NULL, NULL, 1),
(3, 'autSpec1', 'Automation Specialist 1', NULL, NULL, 1),
(4, 'autSpec2', 'Automation Specialist 2', NULL, NULL, 1),
(5, 'autSpec3', 'Automation Specialist 3', NULL, NULL, 1),
(6, 'adma1', 'Administrative Assistant 1', NULL, NULL, 2),
(7, 'adma2', 'Administrative Assistant 2', NULL, NULL, 2),
(8, 'adma3', 'Administrative Assistant 3', NULL, NULL, 2),
(9, 'vicepresident', 'Vice-President', NULL, NULL, 2),
(10, 'maneng', 'Engineering Manager', NULL, NULL, 1),
(11, 'manacc', 'Accounting Manager', '2016-03-04 15:00:52', '2016-03-04 15:00:52', 2),
(12, 'manelecinstall', 'Electrical and Installation Manager', '2016-03-10 04:18:50', '2016-03-10 04:18:50', 3),
(13, 'maninstru', 'Instrumentation Manager', '2016-03-10 04:25:52', '2016-03-10 04:25:52', 4),
(14, 'elecTech1', 'Electrical Technician 1', '2016-03-10 04:34:37', '2016-03-10 04:34:37', 3),
(15, 'elecTech2', 'Electrical Technician 2', '2016-03-10 04:34:37', '2016-03-10 04:34:37', 3),
(16, 'instruTech1', 'Instrumentation Technician 1', '2016-03-10 04:34:37', '2016-03-10 04:34:37', 4),
(17, 'instruTech2', 'Instrumentation Technician 2', '2016-03-10 04:34:37', '2016-03-10 04:34:37', 4);

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

--
-- Table structure for table `migration`
--

CREATE TABLE IF NOT EXISTS `migration` (
  `version` varchar(180) NOT NULL,
  `apply_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `migration`
--

INSERT INTO `migration` (`version`, `apply_time`) VALUES
('m000000_000000_base', 1454343812),
('m140506_102106_rbac_init', 1454425191),
('m140602_111327_create_menu_table', 1465415155),
('m160201_154039_add_department_table_and_relations', 1454343821),
('m160201_160522_add_department_foreign_key_to_jobdescription', 1454343821),
('m160215_183753_add_currentresource_attr_to_position', 1455562708),
('m160215_192225_add_previousevaluationid_attr_to_evaluation', 1455564441),
('m160215_195134_add_position_id_attr_to_evaluation', 1455566223),
('m160312_050000_create_user', 1465415155),
('m160608_203441_add_admincolumns_to_user', 1465419185),
('m160609_143819_drop_user_resource', 1465497129),
('m160609_144504_add_user_id_to_resource', 1465497129);

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

--
-- Table structure for table `organizationalcriteria`
--

CREATE TABLE IF NOT EXISTS `organizationalcriteria` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) DEFAULT NULL,
  `description` text,
  `min` int(11) DEFAULT NULL,
  `max` int(11) DEFAULT NULL,
  `definition` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ;

--
-- Dumping data for table `organizationalcriteria`
--

INSERT INTO `organizationalcriteria` (`id`, `name`, `description`, `min`, `max`, `definition`) VALUES
(1, 'leadership', 'Liderazgo', -1, 3, 'Leadership definition'),
(2, 'learning', 'Aprendizaje', -1, 3, 'Learning definition'),
(3, 'resourcemanagement', 'Manejo de Recursos', -1, 3, 'Resource management definition'),
(4, 'communications', 'Comunicaciones', -1, 3, NULL),
(5, 'optimism', 'Optimismo', -1, 3, NULL),
(6, 'availability', 'Disponibilidad', -1, 3, NULL),
(7, 'customerservice', 'Servicio al Cliente', -1, 3, NULL),
(8, 'quality', 'Calidad', -1, 3, NULL),
(9, 'attendanceandpunctuality', 'Asistencia y Puntualidad', -1, 3, NULL),
(10, 'resultsoriented', 'Orientacion a Resultados', -1, 3, NULL),
(11, 'organization', 'Organizacion', -1, 3, NULL),
(12, 'relationships', 'Relaciones Interpersonales', -1, 3, NULL),
(13, 'loyalty', 'Lealtad', -1, 3, NULL),
(14, 'changemanagment', 'Manejo de Cambios', -1, 3, NULL);

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

--
-- Table structure for table `organizational_evaluation`
--

CREATE TABLE IF NOT EXISTS `organizational_evaluation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `points` int(11) DEFAULT NULL,
  `evaluation_id` int(11) NOT NULL,
  `organizationalcriteria_name` varchar(45) DEFAULT NULL,
  `organizationalcriteria_description` text,
  `organizationalcriteria_min` int(11) DEFAULT NULL,
  `organizationalcriteria_max` int(11) DEFAULT NULL,
  `organizationalcriteria_comment` text,
  `organizationalcriteria_definition` text,
  PRIMARY KEY (`id`),
  KEY `fk_organizational_evaluation` (`evaluation_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=113 ;

--
-- Dumping data for table `organizational_evaluation`
--

INSERT INTO `organizational_evaluation` (`id`, `points`, `evaluation_id`, `organizationalcriteria_name`, `organizationalcriteria_description`, `organizationalcriteria_min`, `organizationalcriteria_max`, `organizationalcriteria_comment`, `organizationalcriteria_definition`) VALUES
(99, -1, 9, 'leadership', 'Liderazgo', -1, 3, '', 'Leadership definition'),
(100, 1, 9, 'learning', 'Aprendizaje', -1, 3, '', 'Learning definition'),
(101, 1, 9, 'resourcemanagement', 'Manejo de Recursos', -1, 3, '', 'Resource management definition'),
(102, 3, 9, 'communications', 'Comunicaciones', -1, 3, '', NULL),
(103, 2, 9, 'optimism', 'Optimismo', -1, 3, '', NULL),
(104, 1, 9, 'availability', 'Disponibilidad', -1, 3, '', NULL),
(105, 3, 9, 'customerservice', 'Servicio al Cliente', -1, 3, '', NULL),
(106, 2, 9, 'quality', 'Calidad', -1, 3, '', NULL),
(107, 3, 9, 'attendanceandpunctuality', 'Asistencia y Puntualidad', -1, 3, '', NULL),
(108, 1, 9, 'resultsoriented', 'Orientacion a Resultados', -1, 3, '', NULL),
(109, 2, 9, 'organization', 'Organizacion', -1, 3, '', NULL),
(110, 3, 9, 'relationships', 'Relaciones Interpersonales', -1, 3, '', NULL),
(111, 1, 9, 'loyalty', 'Lealtad', -1, 3, '', NULL),
(112, 2, 9, 'changemanagment', 'Manejo de Cambios', -1, 3, '', NULL);

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

--
-- Table structure for table `position`
--

CREATE TABLE IF NOT EXISTS `position` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) DEFAULT NULL,
  `description` text,
  `created_at` datetime DEFAULT NULL,
  `modified_at` datetime DEFAULT NULL,
  `jobdescription_id` int(11) NOT NULL,
  `super_position_id` int(11) DEFAULT NULL,
  `currentresource_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_position_jobdescription1_idx` (`jobdescription_id`),
  KEY `fk-position-currentresource_id` (`currentresource_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=28 ;

--
-- Dumping data for table `position`
--

INSERT INTO `position` (`id`, `name`, `description`, `created_at`, `modified_at`, `jobdescription_id`, `super_position_id`, `currentresource_id`) VALUES
(25, 'president', 'President', '2016-07-13 14:50:53', '2016-07-13 16:14:05', 1, 25, 17),
(27, 'Accouting Manager', 'Accounting Manager', '2016-07-13 16:11:00', '2016-07-13 16:18:11', 11, 25, 19);

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

--
-- Table structure for table `position_evaluation`
--

CREATE TABLE IF NOT EXISTS `position_evaluation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `points` int(11) DEFAULT NULL,
  `evaluation_id` int(11) NOT NULL,
  `position_name` varchar(45) DEFAULT NULL,
  `position_description` text,
  `responsibility_name` varchar(45) DEFAULT NULL,
  `responsibility_description` text,
  `responsibility_min` int(11) DEFAULT NULL,
  `responsibility_max` int(11) DEFAULT NULL,
  `responsibility_comment` text,
  `responsibility_definition` text,
  PRIMARY KEY (`id`),
  KEY `fk_resourceevaluation_organizationalcriteria_resourceevaluati1` (`evaluation_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=19 ;

--
-- Dumping data for table `position_evaluation`
--

INSERT INTO `position_evaluation` (`id`, `points`, `evaluation_id`, `position_name`, `position_description`, `responsibility_name`, `responsibility_description`, `responsibility_min`, `responsibility_max`, `responsibility_comment`, `responsibility_definition`) VALUES
(17, -1, 9, 'Accouting Manager', 'Accounting Manager', 'responsibility1manacc', 'Responsibility #1 for Accounting Manager', 0, 1, '', NULL),
(18, 2, 9, 'Accouting Manager', 'Accounting Manager', 'responsibility2manacc', 'Responsibility #2 for Accounting Manager', 0, 1, '', NULL);

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

--
-- Table structure for table `project`
--

CREATE TABLE IF NOT EXISTS `project` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) DEFAULT NULL,
  `quoteno` varchar(45) DEFAULT NULL,
  `contactname` varchar(45) DEFAULT NULL,
  `startdate` date DEFAULT NULL,
  `enddate` date DEFAULT NULL,
  `customer_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_project_customer1` (`customer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `projectcriteria`
--

CREATE TABLE IF NOT EXISTS `projectcriteria` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) DEFAULT NULL,
  `min_value` int(11) DEFAULT NULL,
  `max_value` int(11) DEFAULT NULL,
  `acceptable_value` int(11) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `project_customercontact`
--

CREATE TABLE IF NOT EXISTS `project_customercontact` (
  `id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL,
  `customercontact_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_project_contact_project1` (`project_id`),
  KEY `fk_project_contact_customercontact1` (`customercontact_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `project_evaluation`
--

CREATE TABLE IF NOT EXISTS `project_evaluation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_id` int(11) NOT NULL,
  `projectcriteria_id` int(11) NOT NULL,
  `value` int(11) DEFAULT NULL,
  `date` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_projecteval_project1` (`project_id`),
  KEY `fk_projecteval_projectevalcriteria1` (`projectcriteria_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `rescriteria`
--

CREATE TABLE IF NOT EXISTS `rescriteria` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) DEFAULT NULL,
  `min_value` int(11) DEFAULT NULL COMMENT '	',
  `max_value` int(11) DEFAULT NULL,
  `acceptable_value` int(11) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `resource`
--

CREATE TABLE IF NOT EXISTS `resource` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT '9999-12-31',
  `notes` varchar(200) DEFAULT NULL,
  `active` tinyint(1) NOT NULL,
  `resource_num` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx-resource-user_id` (`user_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=20 ;

--
-- Dumping data for table `resource`
--

INSERT INTO `resource` (`id`, `name`, `start_date`, `end_date`, `notes`, `active`, `resource_num`, `user_id`) VALUES
(17, 'Jose E Rullan', '2016-07-13', NULL, '', 1, 1, 19),
(19, 'Magdiel Santiago', '2016-07-13', NULL, '', 1, 3, NULL);

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

--
-- Table structure for table `resource_badge`
--

CREATE TABLE IF NOT EXISTS `resource_badge` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `resource_id` int(11) NOT NULL,
  `badge_id` int(11) NOT NULL,
  `date` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_resource_role_resource2` (`resource_id`),
  KEY `fk_resource_role_badge1` (`badge_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `resource_position`
--

CREATE TABLE IF NOT EXISTS `resource_position` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `resource_id` int(11) NOT NULL,
  `position_id` int(11) NOT NULL,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_resource_jobdescription_resource1` (`resource_id`),
  KEY `fk_resource_jobdescription_position1_idx` (`position_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=30 ;

--
-- Dumping data for table `resource_position`
--

INSERT INTO `resource_position` (`id`, `resource_id`, `position_id`, `start_date`, `end_date`) VALUES
(28, 17, 25, '2016-07-13', NULL),
(29, 19, 27, '2016-07-13', NULL);

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

--
-- Table structure for table `resource_role`
--

CREATE TABLE IF NOT EXISTS `resource_role` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `resource_id` int(11) NOT NULL,
  `role_id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL,
  `date` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_resource_role_resource1` (`resource_id`),
  KEY `fk_resource_role_role1` (`role_id`),
  KEY `fk_resource_role_project1` (`project_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `resource_skill`
--

CREATE TABLE IF NOT EXISTS `resource_skill` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '	',
  `resource_id` int(11) NOT NULL,
  `skill_id` int(11) NOT NULL,
  `level` int(11) DEFAULT NULL,
  `date` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_resource_skill_skill1` (`skill_id`),
  KEY `fk_resource_skill_resource2_idx` (`resource_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `resource_training`
--

CREATE TABLE IF NOT EXISTS `resource_training` (
  `id` int(11) NOT NULL,
  `training_id` int(11) NOT NULL,
  `resource_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_resource_training_training1` (`training_id`),
  KEY `fk_resource_training_resource1` (`resource_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `responsibility`
--

CREATE TABLE IF NOT EXISTS `responsibility` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) DEFAULT NULL,
  `description` text,
  `jobdescription_id` int(11) NOT NULL,
  `definition` text,
  PRIMARY KEY (`id`),
  KEY `fk_responsibility_jobdescription1_idx` (`jobdescription_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=32 ;

--
-- Dumping data for table `responsibility`
--

INSERT INTO `responsibility` (`id`, `name`, `description`, `jobdescription_id`, `definition`) VALUES
(1, 'responsibility1president', 'Responsibility #1 for President', 1, NULL),
(2, 'responsibility2president', 'Responsibility #2 for President', 1, NULL),
(3, 'responsibility1englead', 'Responsibility #1 for Engineering Lead', 2, NULL),
(4, 'responsibility1AutSpec1', 'Responsibility #1 for Automation Specialist 1', 3, NULL),
(5, 'responsibility2AutSpec1', 'Responsibility #2 for Automation Specialist 1', 3, NULL),
(6, 'responsibility1AutSpec2', 'Responsibility #1 for Automation Specialist 2', 4, NULL),
(7, 'responsibility1AutSpec3', 'Responsibility #1 for Automation Specialist 3', 5, NULL),
(8, 'responsibility1Adma1', 'Responsibility #1 for Administrative Assistant 1.', 6, NULL),
(9, 'responsibility1Adma2', 'Responsibility #1 for Administrative Assistant 2.', 7, NULL),
(10, 'responsibility2Adma2', 'Responsibility #2 for Administrative Assistant 2.', 7, NULL),
(11, 'responsibility1Adma3', 'Responsibility #1 for Administrative Assistant 3.', 8, NULL),
(12, 'responsibility3Adma2', 'Responsibility #3 for Administrative Assistant 2.', 7, NULL),
(13, 'responsibility4Adma2', 'Responsibility #4 for Administrative Assistant 2.', 7, NULL),
(14, 'responsibility1vicepresident', 'Responsibility #1 for Vice-President', 9, NULL),
(15, 'responsibility2vicepresident', 'Responsibility #2 for Vice-President', 9, NULL),
(16, 'responsibility1maneng', 'Responsibility #1 for Engineering Manager', 10, NULL),
(17, 'responsibility2maneng', 'Responsibility #2 for Engineering Manager', 10, NULL),
(18, 'responsibility1manacc', 'Responsibility #1 for Accounting Manager', 11, NULL),
(19, 'responsibility2manacc', 'Responsibility #2 for Accounting Manager', 11, NULL),
(20, 'responsibility1manelecinstall', 'Responsibility #1 for Electric and Installation Manager', 12, NULL),
(21, 'responsibility2manelecinstall', 'Responsibility #2 for Electric and Installation Manager', 12, NULL),
(22, 'responsibility1maninstru', 'Responsibility #1 for Instrumentation Manager', 13, NULL),
(23, 'responsibility2maninstru', 'Responsibility #2 for Instrumentation Manager', 13, NULL),
(24, 'responsibility1techelec1', 'Responsibility #1 for Electrical Technician 1', 14, NULL),
(25, 'responsibility2techelec1', 'Responsibility #2 for Electrical Technician 1', 14, NULL),
(26, 'responsibility1techelec2', 'Responsibility #1 for Electrical Technician 2', 15, NULL),
(27, 'responsibility2techelec2', 'Responsibility #2 for Electrical Technician 2', 15, NULL),
(28, 'responsibility1techinstru1', 'Responsibility #1 for Instrumentation Technician 1', 16, NULL),
(29, 'responsibility2techinstru1', 'Responsibility #2 for Instrumentation Technician 1', 16, NULL),
(30, 'responsibility1techinstru2', 'Responsibility #1 for Instrumentation Technician 2', 17, NULL),
(31, 'responsibility2techinstru2', 'Responsibility #2 for Instrumentation Technician 2', 17, NULL);

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

--
-- Table structure for table `role`
--

CREATE TABLE IF NOT EXISTS `role` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `skill`
--

CREATE TABLE IF NOT EXISTS `skill` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `training`
--

CREATE TABLE IF NOT EXISTS `training` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `company` varchar(45) DEFAULT NULL,
  `date` date NOT NULL,
  `place` varchar(45) DEFAULT NULL,
  `trainer` varchar(45) DEFAULT NULL,
  `duration` varchar(45) DEFAULT NULL,
  `expiration_date` date DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

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

--
-- Table structure for table `usertype`
--

CREATE TABLE IF NOT EXISTS `usertype` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(45) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `usertype`
--

INSERT INTO `usertype` (`id`, `type`, `description`) VALUES
(1, 'employee', 'Employee'),
(2, 'customer', 'Customer');

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

--
-- Table structure for table `user_customercontact`
--

CREATE TABLE IF NOT EXISTS `user_customercontact` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `customercontact_id` int(11) NOT NULL,
  `date` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_user_customer_user1` (`user_id`),
  KEY `fk_user_customercontact_customercontact1` (`customercontact_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `valuescriteria`
--

CREATE TABLE IF NOT EXISTS `valuescriteria` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(45) DEFAULT NULL,
  `description` text,
  `min` int(11) DEFAULT NULL,
  `max` int(11) DEFAULT NULL,
  `definition` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;

--
-- Dumping data for table `valuescriteria`
--

INSERT INTO `valuescriteria` (`id`, `name`, `description`, `min`, `max`, `definition`) VALUES
(1, 'teamwork', 'Trabajo en Equipo', 0, 1, 'Es: Colaborar con compañeros de trabajo, buscar reconocimiento para el equipo, comprometerse con el objetivo del equipo, asumir responsabilidad por las acciones de todos los miembros del equipo.\nNO Es: Buscar reconocimiento individual. Que todos estén de acuerdo siempre.'),
(2, 'integrity', 'Integridad', 0, 1, 'Es: Honestidad, ser asertivos en nuestras expresiones, transparencia, seguir las políticas y reglamentos internos y de los clientes y señalar cuando no se cumplan, asumir responsabilidad por las acciones propias NO Es: Manipular información o datos para que mentiras parezcan verdades, buscar fallas en los compañeros de trabajo. No es decir las cosas faltando el respeto.'),
(3, 'initiative', 'Iniciativa', 0, 1, 'Es: Ser proactivos en la búsqueda de soluciones, en aprendizaje y desarrollo profesional y en entender las necesidades del cliente.\nNO Es: Tomar decisiones sin seguir el debido proceso o tomar decisiones que no le corresponden.'),
(4, 'innovation', 'Innovacion', 0, 1, 'Es: Retar procesos y soluciones buscando una alternativa que añada más valor, identificar areas de oportunidad para innovacion.\nNO Es: Hacer las cosas a su manera, hacer las cosas siempre de una forma distinta, perseguir cualquier oportunidad sin seguir el debido proceso. '),
(5, 'insight', 'Conocimiento Profundo', 0, 1, 'Es: Buscar el conocimiento profundo de las necesidades del cliente (cliente, suplidor, empleados, contratistas).\nNO Es: Inmiscuirse en la vida privada o personal del cliente, no es satisfacer necesidades personales del cliente.'),
(6, 'generosity', 'Generosidad', 0, 1, 'Es: Dar más de lo que se requiere: a clientes, a compañeros, a la comunidad. Dar tiempo voluntariamente (para el trabajo, de apoyo, etc.) sin recibir ninguna presión para hacerlo.\nNO Es: Dar o esperar dinero o bienes materiales de nadie a cambio de ayuda voluntaria.');

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

--
-- Table structure for table `values_evaluation`
--

CREATE TABLE IF NOT EXISTS `values_evaluation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `points` int(11) DEFAULT NULL,
  `evaluation_id` int(11) NOT NULL,
  `valuescriteria_name` varchar(45) DEFAULT NULL,
  `valuescriteria_description` text,
  `valuescriteria_min` int(11) DEFAULT NULL,
  `valuescriteria_max` int(11) DEFAULT NULL,
  `valuescriteria_comment` text,
  `valuescriteria_definition` text,
  PRIMARY KEY (`id`),
  KEY `fk_resourceevaluation_organizationalcriteria_resourceevaluati1` (`evaluation_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=49 ;

--
-- Dumping data for table `values_evaluation`
--

INSERT INTO `values_evaluation` (`id`, `points`, `evaluation_id`, `valuescriteria_name`, `valuescriteria_description`, `valuescriteria_min`, `valuescriteria_max`, `valuescriteria_comment`, `valuescriteria_definition`) VALUES
(43, 1, 9, 'teamwork', 'Trabajo en Equipo', 0, 1, '', 'Es: Colaborar con compañeros de trabajo, buscar reconocimiento para el equipo, comprometerse con el objetivo del equipo, asumir responsabilidad por las acciones de todos los miembros del equipo.\nNO Es: Buscar reconocimiento individual. Que todos estén de acuerdo siempre.'),
(44, 1, 9, 'integrity', 'Integridad', 0, 1, '', 'Es: Honestidad, ser asertivos en nuestras expresiones, transparencia, seguir las políticas y reglamentos internos y de los clientes y señalar cuando no se cumplan, asumir responsabilidad por las acciones propias NO Es: Manipular información o datos para que mentiras parezcan verdades, buscar fallas en los compañeros de trabajo. No es decir las cosas faltando el respeto.'),
(45, 1, 9, 'initiative', 'Iniciativa', 0, 1, '', 'Es: Ser proactivos en la búsqueda de soluciones, en aprendizaje y desarrollo profesional y en entender las necesidades del cliente.\nNO Es: Tomar decisiones sin seguir el debido proceso o tomar decisiones que no le corresponden.'),
(46, 1, 9, 'innovation', 'Innovacion', 0, 1, '', 'Es: Retar procesos y soluciones buscando una alternativa que añada más valor, identificar areas de oportunidad para innovacion.\nNO Es: Hacer las cosas a su manera, hacer las cosas siempre de una forma distinta, perseguir cualquier oportunidad sin seguir el debido proceso. '),
(47, 1, 9, 'insight', 'Conocimiento Profundo', 0, 1, '', 'Es: Buscar el conocimiento profundo de las necesidades del cliente (cliente, suplidor, empleados, contratistas).\nNO Es: Inmiscuirse en la vida privada o personal del cliente, no es satisfacer necesidades personales del cliente.'),
(48, 1, 9, 'generosity', 'Generosidad', 0, 1, '', 'Es: Dar más de lo que se requiere: a clientes, a compañeros, a la comunidad. Dar tiempo voluntariamente (para el trabajo, de apoyo, etc.) sin recibir ninguna presión para hacerlo.\nNO Es: Dar o esperar dinero o bienes materiales de nadie a cambio de ayuda voluntaria.');

--
-- Constraints for dumped tables
--

--
-- Constraints for table `assessment`
--
ALTER TABLE `assessment`
  ADD CONSTRAINT `fk_evaluation_evalcriteria1` FOREIGN KEY (`rescriteria_id`) REFERENCES `rescriteria` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_evaluation_resource1` FOREIGN KEY (`resource_id`) REFERENCES `resource` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `auth_assignment`
--
ALTER TABLE `auth_assignment`
  ADD CONSTRAINT `auth_assignment_ibfk_1` FOREIGN KEY (`item_name`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `auth_item`
--
ALTER TABLE `auth_item`
  ADD CONSTRAINT `auth_item_ibfk_1` FOREIGN KEY (`rule_name`) REFERENCES `auth_rule` (`name`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `auth_item_child`
--
ALTER TABLE `auth_item_child`
  ADD CONSTRAINT `auth_item_child_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `auth_item_child_ibfk_2` FOREIGN KEY (`child`) REFERENCES `auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `contactinformation`
--
ALTER TABLE `contactinformation`
  ADD CONSTRAINT `fk_contactinformation_resource1` FOREIGN KEY (`resource_id`) REFERENCES `resource` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `evaluation`
--
ALTER TABLE `evaluation`
  ADD CONSTRAINT `fk_evaluation_resource` FOREIGN KEY (`resource_id`) REFERENCES `resource` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `evaluation_evaluationstatus`
--
ALTER TABLE `evaluation_evaluationstatus`
  ADD CONSTRAINT `fk_evaluation_evaluationstatus_evaluation1` FOREIGN KEY (`evaluation_id`) REFERENCES `evaluation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_evaluation_evaluationstatus_evaluationstatus1` FOREIGN KEY (`evaluationstatus_id`) REFERENCES `evaluationstatus` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `goal`
--
ALTER TABLE `goal`
  ADD CONSTRAINT `fk_goal_evaluation1` FOREIGN KEY (`evaluation_id`) REFERENCES `evaluation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `jobdescription`
--
ALTER TABLE `jobdescription`
  ADD CONSTRAINT `fk-jobdescription-department_id` FOREIGN KEY (`department_id`) REFERENCES `department` (`id`);

--
-- Constraints for table `organizational_evaluation`
--
ALTER TABLE `organizational_evaluation`
  ADD CONSTRAINT `fk_organizational_evaluation` FOREIGN KEY (`evaluation_id`) REFERENCES `evaluation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `position`
--
ALTER TABLE `position`
  ADD CONSTRAINT `fk-position-currentresource_id` FOREIGN KEY (`currentresource_id`) REFERENCES `resource` (`id`),
  ADD CONSTRAINT `fk_position_jobdescription1` FOREIGN KEY (`jobdescription_id`) REFERENCES `jobdescription` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `position_evaluation`
--
ALTER TABLE `position_evaluation`
  ADD CONSTRAINT `fk_jobdescription_evaluation` FOREIGN KEY (`evaluation_id`) REFERENCES `evaluation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `project`
--
ALTER TABLE `project`
  ADD CONSTRAINT `fk_project_customer1` FOREIGN KEY (`customer_id`) REFERENCES `customercompany` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `project_customercontact`
--
ALTER TABLE `project_customercontact`
  ADD CONSTRAINT `fk_project_contact_customercontact1` FOREIGN KEY (`customercontact_id`) REFERENCES `customercontact` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_project_contact_project1` FOREIGN KEY (`project_id`) REFERENCES `project` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `project_evaluation`
--
ALTER TABLE `project_evaluation`
  ADD CONSTRAINT `fk_projecteval_project1` FOREIGN KEY (`project_id`) REFERENCES `project` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_projecteval_projectevalcriteria1` FOREIGN KEY (`projectcriteria_id`) REFERENCES `projectcriteria` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `resource`
--
ALTER TABLE `resource`
  ADD CONSTRAINT `fk-resource-user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`);

--
-- Constraints for table `resource_badge`
--
ALTER TABLE `resource_badge`
  ADD CONSTRAINT `fk_resource_role_badge1` FOREIGN KEY (`badge_id`) REFERENCES `badge` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_resource_role_resource2` FOREIGN KEY (`resource_id`) REFERENCES `resource` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `resource_position`
--
ALTER TABLE `resource_position`
  ADD CONSTRAINT `fk_resource_jobdescription_position1` FOREIGN KEY (`position_id`) REFERENCES `position` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_resource_jobdescription_resource1` FOREIGN KEY (`resource_id`) REFERENCES `resource` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `resource_role`
--
ALTER TABLE `resource_role`
  ADD CONSTRAINT `fk_resource_role_project1` FOREIGN KEY (`project_id`) REFERENCES `project` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_resource_role_resource1` FOREIGN KEY (`resource_id`) REFERENCES `resource` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_resource_role_role1` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `resource_skill`
--
ALTER TABLE `resource_skill`
  ADD CONSTRAINT `fk_resource_skill_resource2` FOREIGN KEY (`resource_id`) REFERENCES `resource` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_resource_skill_skill1` FOREIGN KEY (`skill_id`) REFERENCES `skill` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `resource_training`
--
ALTER TABLE `resource_training`
  ADD CONSTRAINT `fk_resource_training_resource1` FOREIGN KEY (`resource_id`) REFERENCES `resource` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_resource_training_training1` FOREIGN KEY (`training_id`) REFERENCES `training` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `responsibility`
--
ALTER TABLE `responsibility`
  ADD CONSTRAINT `fk_responsibility_jobdescription1` FOREIGN KEY (`jobdescription_id`) REFERENCES `jobdescription` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `user_customercontact`
--
ALTER TABLE `user_customercontact`
  ADD CONSTRAINT `fk_user_customercontact_customercontact1` FOREIGN KEY (`customercontact_id`) REFERENCES `customercontact` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  ADD CONSTRAINT `fk_user_customer_user1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `values_evaluation`
--
ALTER TABLE `values_evaluation`
  ADD CONSTRAINT `fk_values_evaluation` FOREIGN KEY (`evaluation_id`) REFERENCES `evaluation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

