text: -- phpMyAdmin SQL Dump
  -- version 4.6.5.2
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Generation Time: 06-Abr-2017 às 07:17
  -- Versão do servidor: 10.1.21-MariaDB
  -- PHP Version: 7.1.1
  
  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 utf8mb4 */;
  
  --
  -- Database: `db_registration`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Estrutura da tabela `addresses`
  --
  
  CREATE TABLE `addresses` (
    `id` int(11) NOT NULL,
    `street_address` varchar(255) NOT NULL,
    `location` varchar(255) NOT NULL,
    `country_id` int(11) NOT NULL,
    `user_id` int(11) NOT NULL,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `zipcode` varchar(10) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Extraindo dados da tabela `addresses`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Estrutura da tabela `countries`
  --
  
  CREATE TABLE `countries` (
    `id` int(11) NOT NULL,
    `name` varchar(255) NOT NULL,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Extraindo dados da tabela `countries`
  --
  
  INSERT INTO `countries` (`id`, `name`, `created_at`, `updated_at`) VALUES
  (1, 'Portugal', '2017-04-04 21:56:36', '0000-00-00 00:00:00'),
  (2, 'Brazil', '2017-04-04 21:56:36', '0000-00-00 00:00:00'),
  (3, 'Germany', '2017-04-04 21:56:36', '0000-00-00 00:00:00'),
  (4, 'Spain', '2017-04-04 21:56:36', '0000-00-00 00:00:00'),
  (5, 'Norway', '2017-04-04 21:56:36', '0000-00-00 00:00:00');
  
  -- --------------------------------------------------------
  
  --
  -- Estrutura da tabela `users`
  --
  
  CREATE TABLE `users` (
    `id` int(11) NOT NULL,
    `lastname` varchar(255) NOT NULL,
    `firstname` varchar(255) DEFAULT NULL,
    `email` varchar(255) DEFAULT NULL,
    `password` varchar(255) DEFAULT NULL,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
    `social_number` varchar(15) NOT NULL,
    `phone_number` varchar(50) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Extraindo dados da tabela `users`
  --
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `addresses`
  --
  ALTER TABLE `addresses`
    ADD PRIMARY KEY (`id`),
    ADD KEY `address_country_fk` (`country_id`),
    ADD KEY `address_user_fk` (`user_id`);
  
  --
  -- Indexes for table `countries`
  --
  ALTER TABLE `countries`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `addresses`
  --
  ALTER TABLE `addresses`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
  --
  -- AUTO_INCREMENT for table `countries`
  --
  ALTER TABLE `countries`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
  --
  -- AUTO_INCREMENT for table `users`
  --
  ALTER TABLE `users`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Limitadores para a tabela `addresses`
  --
  ALTER TABLE `addresses`
    ADD CONSTRAINT `address_country_fk` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
    ADD CONSTRAINT `address_user_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`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 */;
  