text: -- phpMyAdmin SQL Dump
  -- version 4.0.4
  -- http://www.phpmyadmin.net
  --
  -- Máquina: localhost
  -- Versão do servidor: 5.6.12-log
  -- versão do PHP: 5.4.12
  
  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 */;
  
  --
  -- Base de Dados: `animais`
  --
  CREATE DATABASE IF NOT EXISTS `animais` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
  USE `animais`;
  
  -- --------------------------------------------------------
  
  --
  -- Estrutura da tabela `animal`
  --
  
  CREATE TABLE IF NOT EXISTS `animal` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `animal_type_id` int(11) NOT NULL,
    `status_id` int(11) NOT NULL,
    `location` varchar(255) NOT NULL,
    `name` varchar(255) NOT NULL,
    `extra_information` text,
    `username_id` int(11) NOT NULL,
    `updated_at` datetime NOT NULL,
    `created_at` datetime DEFAULT NULL,
    `photo` varchar(255) DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `status_idx` (`status_id`),
    KEY `username_idx` (`username_id`),
    KEY `animal_type_idx` (`animal_type_id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ;
  
  -- --------------------------------------------------------
  
  --
  -- Estrutura da tabela `animal_type`
  --
  
  CREATE TABLE IF NOT EXISTS `animal_type` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(45) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
  
  -- --------------------------------------------------------
  
  --
  -- Estrutura da tabela `blog`
  --
  
  CREATE TABLE IF NOT EXISTS `blog` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `subject` varchar(255) NOT NULL,
    `body` text NOT NULL,
    `created_at` datetime NOT NULL,
    `updated_at` datetime NOT NULL,
    `username_id` int(11) NOT NULL,
    PRIMARY KEY (`id`),
    KEY `username_idx` (`username_id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
  
  -- --------------------------------------------------------
  
  --
  -- Estrutura da tabela `contact`
  --
  
  CREATE TABLE IF NOT EXISTS `contact` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `email_from` varchar(255) NOT NULL,
    `name_from` varchar(255) NOT NULL,
    `ip_address_from` varchar(255) NOT NULL,
    `subject` varchar(45) NOT NULL,
    `body` text NOT NULL,
    `created_at` datetime NOT NULL,
    `phone_number` varchar(45) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;
  
  -- --------------------------------------------------------
  
  --
  -- Estrutura da tabela `role`
  --
  
  CREATE TABLE IF NOT EXISTS `role` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(45) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
  
  -- --------------------------------------------------------
  
  --
  -- Estrutura da tabela `status`
  --
  
  CREATE TABLE IF NOT EXISTS `status` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(45) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
  
  -- --------------------------------------------------------
  
  --
  -- Estrutura da tabela `user`
  --
  
  CREATE TABLE IF NOT EXISTS `user` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(255) NOT NULL,
    `email` varchar(255) NOT NULL,
    `password` varchar(255) NOT NULL,
    `role_id` int(11) DEFAULT NULL,
    `phone_number` varchar(45) NOT NULL,
    `authKey` varchar(255) DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `role_idx` (`role_id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Limitadores para a tabela `animal`
  --
  ALTER TABLE `animal`
    ADD CONSTRAINT `animal_type` FOREIGN KEY (`animal_type_id`) REFERENCES `animal_type` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    ADD CONSTRAINT `status` FOREIGN KEY (`status_id`) REFERENCES `status` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    ADD CONSTRAINT `username` FOREIGN KEY (`username_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
  
  --
  -- Limitadores para a tabela `blog`
  --
  ALTER TABLE `blog`
    ADD CONSTRAINT `username_` FOREIGN KEY (`username_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
  
  --
  -- Limitadores para a tabela `user`
  --
  ALTER TABLE `user`
    ADD CONSTRAINT `role` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
  
  /*!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 */;
  