Commit c9b94d13 by Luis Perez

Diseñada e implementada estructura de la base de datos

Añadidos nuevos modelos y eliminados antiguos
parent acfece0c
<?php
use Orm\Model;
/**
* SETI Consultyn S.L.
* www.seticonsultyn.es
*
* Copyright(c) 2011-2013
*
* @author SETI Consultyn S.L. <contacto@seticonsultyn.es>
* @copyright 2011-2013 SETI Consultyn S.L. http://seticonsultyn.com/copyright.txt
* @license SETI Consultyn Software License <license.txt>
* @link http://seticonsultyn.es
*/
class Model_Ingredient extends Model{
protected static $_table_name = 'ingredients';
protected static $_primary_key = array('id');
protected static $_belongs_to = array(
'recipe' => array(
'key_from' => 'recipe_local_od',
'key_to' => 'id',
'model_to' => 'Model_Recipe',
'cascade_delete' => false
),
);
}
\ No newline at end of file
<?php
use Orm\Model;
/**
* SETI Consultyn S.L.
* www.seticonsultyn.es
*
* Copyright(c) 2011-2013
*
* @author SETI Consultyn S.L. <contacto@seticonsultyn.es>
* @copyright 2011-2013 SETI Consultyn S.L. http://seticonsultyn.com/copyright.txt
* @license SETI Consultyn Software License <license.txt>
* @link http://seticonsultyn.es
*/
class Model_Recipe extends Model{
protected static $_table_name = 'recipes';
protected static $_primary_key = array('id');
protected static $_has_many = array(
'ingredients' => array(
'key_from' => 'id',
'key_to' => 'recipe_local_id',
'model_to' => 'Model_Ingredients',
'cascade_delete' => false
),
);
}
\ No newline at end of file
/*
Navicat MySQL Data Transfer
Source Server : localhost3306
Source Server Version : 50641
Source Server : localhost_3306
Source Server Version : 50640
Source Host : localhost:3306
Source Database : inutralia_webapp
Target Server Type : MYSQL
Target Server Version : 50641
Target Server Version : 50640
File Encoding : 65001
Date: 2018-11-27 14:49:38
Date: 2018-12-10 16:46:14
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for auth_groups
-- Table structure for ingredients
-- ----------------------------
DROP TABLE IF EXISTS `auth_groups`;
CREATE TABLE `auth_groups` (
DROP TABLE IF EXISTS `ingredients`;
CREATE TABLE `ingredients` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nombre` varchar(45) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime DEFAULT NULL,
`is_blocked` enum('S','N') NOT NULL DEFAULT 'N',
`is_assignable` enum('S','N') DEFAULT NULL,
`ingredient_id` int(11) DEFAULT NULL,
`recipe_local_id` int(11) DEFAULT NULL,
`used` enum('N','S') DEFAULT 'S',
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for auth_groups_roles
-- Records of ingredients
-- ----------------------------
DROP TABLE IF EXISTS `auth_groups_roles`;
CREATE TABLE `auth_groups_roles` (
`group_id` int(11) NOT NULL,
`role_id` int(11) NOT NULL,
PRIMARY KEY (`group_id`,`role_id`),
KEY `fk_auth_groups_roles_auth_roles1_idx` (`role_id`),
CONSTRAINT `fk_auth_groups_roles_auth_groups1` FOREIGN KEY (`group_id`) REFERENCES `auth_groups` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `fk_auth_groups_roles_auth_roles1` FOREIGN KEY (`role_id`) REFERENCES `auth_roles` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- ----------------------------
-- Table structure for auth_roles
-- Table structure for recipes
-- ----------------------------
DROP TABLE IF EXISTS `auth_roles`;
CREATE TABLE `auth_roles` (
DROP TABLE IF EXISTS `recipes`;
CREATE TABLE `recipes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`role` varchar(45) DEFAULT NULL,
`permission` varchar(45) DEFAULT NULL,
`is_assignable` char(1) NOT NULL DEFAULT 'S',
`orden` int(11) DEFAULT NULL,
`recipe_id` int(11) DEFAULT NULL,
`day_week` int(11) DEFAULT NULL,
`week_year` int(11) DEFAULT NULL,
`year` int(11) DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
`loaded` enum('N','S') DEFAULT 'N',
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for auth_users
-- Records of recipes
-- ----------------------------
DROP TABLE IF EXISTS `auth_users`;
CREATE TABLE `auth_users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(255) NOT NULL,
`username` varchar(255) NOT NULL,
`password` char(80) DEFAULT NULL,
`reset_pass_request` datetime DEFAULT NULL,
`salt` char(32) DEFAULT NULL,
`is_active` enum('S','N') NOT NULL DEFAULT 'S',
`is_confirmed` enum('S','N') NOT NULL DEFAULT 'S',
`nombre` varchar(45) DEFAULT NULL,
`apellidos` varchar(150) DEFAULT NULL,
`group_id` int(11) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_auth_users_auth_groups1_idx` (`group_id`),
CONSTRAINT `fk_auth_users_auth_groups1` FOREIGN KEY (`group_id`) REFERENCES `auth_groups` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Table structure for sessions
......@@ -93,3 +67,8 @@ CREATE TABLE `sessions` (
PRIMARY KEY (`session_id`),
UNIQUE KEY `PREVIOUS` (`previous_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
-- ----------------------------
-- Records of sessions
-- ----------------------------
INSERT INTO `sessions` VALUES ('70895b479218ec65bbbe4c5c8ce42588', 'c4afba0a99a39694d674b12aef25eadb', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36', '4869e012aa045958bdf5c461577cf02d', '1544453980', '1544453980', 'a:3:{i:0;a:7:{s:10:\"session_id\";s:32:\"70895b479218ec65bbbe4c5c8ce42588\";s:11:\"previous_id\";s:32:\"c4afba0a99a39694d674b12aef25eadb\";s:7:\"ip_hash\";s:32:\"4869e012aa045958bdf5c461577cf02d\";s:10:\"user_agent\";s:115:\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\";s:7:\"created\";i:1544453980;s:7:\"updated\";i:1544453980;s:7:\"payload\";s:0:\"\";}i:1;a:3:{s:7:\"empresa\";a:2:{s:12:\"nombre_corto\";s:9:\"INUTRALIA\";s:12:\"nombre_largo\";s:9:\"INUTRALIA\";}s:10:\"token_auth\";s:28:\"U3VwZXJMdWlzaXRvOmx1aXNpdG8=\";s:14:\"expire_session\";i:1544457580;}i:2;a:0:{}}');
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment