CREATE DATABASE  IF NOT EXISTS `provi_teste_db` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `provi_teste_db`;
--
-- Host: 3.86.164.89    Database: provi_teste_db
-- ------------------------------------------------------


--
-- Table structure for table `Adresses`
--

CREATE TABLE `Adresses` (
  `cep` varchar(100) NOT NULL,
  `street` varchar(255) NOT NULL,
  `number` varchar(255) NOT NULL,
  `complement` varchar(255) NOT NULL,
  `city` varchar(255) NOT NULL,
  `state` varchar(255) NOT NULL,
  `user_id` varchar(255) NOT NULL,
  `updated_at` varchar(100) NOT NULL,
  `created_at` varchar(100) NOT NULL,
  `street_api` varchar(255) NOT NULL,
  `city_api` varchar(255) NOT NULL,
  `state_api` varchar(255) NOT NULL,
  `divergence_api` tinyint(4) NOT NULL,
  PRIMARY KEY (`cep`,`user_id`,`street`,`number`,`complement`,`city`,`state`),
  KEY `Adress_FK_idx` (`user_id`),
  CONSTRAINT `Adress_FK` FOREIGN KEY (`user_id`) REFERENCES `Users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `Adresses`
--

INSERT INTO `Adresses` VALUES ('01001000','Praça da Sé','255','casa','São paulo','MG','e822a7e0-cc26-47a7-9e08-58c581442310','11/03/2020 20-51-36','Phone_Numbers','Praça da Sé','São Paulo','SP',1),('01001000','Praça da Sé','255','casa','São paulo','SP','e822a7e0-cc26-47a7-9e08-58c581442310','11/03/2020 20-48-44','Phone_Numbers','Praça da Sé','São Paulo','SP',0);



CREATE DATABASE  IF NOT EXISTS `provi_teste_db` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `provi_teste_db`;
--
-- Host: 3.86.164.89    Database: provi_teste_db
-- ------------------------------------------------------


--
-- Table structure for table `Birthdays`
--

CREATE TABLE `Birthdays` (
  `birthday` varchar(100) NOT NULL,
  `user_id` varchar(255) NOT NULL,
  `updated_at` varchar(100) NOT NULL,
  `created_at` varchar(100) NOT NULL,
  PRIMARY KEY (`birthday`,`user_id`),
  KEY `Birthday_FK_idx` (`user_id`),
  CONSTRAINT `Birthday_FK` FOREIGN KEY (`user_id`) REFERENCES `Users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `Birthdays`
--

INSERT INTO `Birthdays` VALUES ('03/10/1986','e822a7e0-cc26-47a7-9e08-58c581442310','11/03/2020 20-48-23','11/03/2020 20-48-23'),('10/10/1990','e822a7e0-cc26-47a7-9e08-58c581442310','11/03/2020 20-50-52','11/03/2020 20-50-52');



CREATE DATABASE  IF NOT EXISTS `provi_teste_db` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `provi_teste_db`;
--
-- Host: 3.86.164.89    Database: provi_teste_db
-- ------------------------------------------------------


--
-- Table structure for table `Cpfs`
--

CREATE TABLE `Cpfs` (
  `cpf` varchar(100) NOT NULL,
  `user_id` varchar(255) NOT NULL,
  `updated_at` varchar(100) NOT NULL,
  `created_at` varchar(100) NOT NULL,
  PRIMARY KEY (`cpf`),
  UNIQUE KEY `cpf_UNIQUE` (`cpf`),
  KEY `Cpf_FK` (`user_id`),
  CONSTRAINT `Cpf_FK` FOREIGN KEY (`user_id`) REFERENCES `Users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `Cpfs`
--

INSERT INTO `Cpfs` VALUES ('212.106.758-20','da9bcf54-5303-4a4f-8cad-9d9e71268f5b','11/03/2020 20-50-00','11/03/2020 20-50-00'),('382.575.379-42','e822a7e0-cc26-47a7-9e08-58c581442310','11/03/2020 20-47-58','11/03/2020 20-47-58');



CREATE DATABASE  IF NOT EXISTS `provi_teste_db` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `provi_teste_db`;
--
-- Host: 3.86.164.89    Database: provi_teste_db
-- ------------------------------------------------------


--
-- Table structure for table `Full_Names`
--

CREATE TABLE `Full_Names` (
  `first_name` varchar(255) NOT NULL,
  `last_name` varchar(255) NOT NULL,
  `user_id` varchar(255) NOT NULL,
  `updated_at` varchar(100) NOT NULL,
  `created_at` varchar(100) NOT NULL,
  PRIMARY KEY (`user_id`,`last_name`,`first_name`),
  CONSTRAINT `Full_Names_FK` FOREIGN KEY (`user_id`) REFERENCES `Users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `Full_Names`
--

INSERT INTO `Full_Names` VALUES ('Ana','Maria','da9bcf54-5303-4a4f-8cad-9d9e71268f5b','11/03/2020 20-50-33','11/03/2020 20-50-33'),('Leonardo','Carvalho Nogueira','e822a7e0-cc26-47a7-9e08-58c581442310','11/03/2020 20-48-15','11/03/2020 20-48-15');



CREATE DATABASE  IF NOT EXISTS `provi_teste_db` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `provi_teste_db`;
--
-- Host: 3.86.164.89    Database: provi_teste_db
-- ------------------------------------------------------


--
-- Table structure for table `Loans`
--

CREATE TABLE `Loans` (
  `total_amount` decimal(10,2) NOT NULL,
  `user_id` varchar(255) NOT NULL,
  `updated_at` varchar(100) NOT NULL,
  `created_at` varchar(100) NOT NULL,
  PRIMARY KEY (`total_amount`,`user_id`),
  KEY `Loans_PK_idx` (`user_id`),
  CONSTRAINT `Loans_PK` FOREIGN KEY (`user_id`) REFERENCES `Users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `Loans`
--

INSERT INTO `Loans` VALUES (10000.00,'e822a7e0-cc26-47a7-9e08-58c581442310','11/03/2020 20-48-48','11/03/2020 20-48-48'),(20000.00,'e822a7e0-cc26-47a7-9e08-58c581442310','11/03/2020 20-51-48','11/03/2020 20-51-48');



CREATE DATABASE  IF NOT EXISTS `provi_teste_db` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `provi_teste_db`;
--
-- Host: 3.86.164.89    Database: provi_teste_db
-- ------------------------------------------------------


--
-- Table structure for table `Phone_Numbers`
--

CREATE TABLE `Phone_Numbers` (
  `phone_number` varchar(100) NOT NULL,
  `user_id` varchar(255) NOT NULL,
  `updated_at` varchar(100) NOT NULL,
  `created_at` varchar(100) NOT NULL,
  PRIMARY KEY (`phone_number`,`user_id`),
  UNIQUE KEY `phone_number_UNIQUE` (`phone_number`),
  KEY `Phone_Number_FK_idx` (`user_id`),
  CONSTRAINT `Phone_Number_FK` FOREIGN KEY (`user_id`) REFERENCES `Users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `Phone_Numbers`
--

INSERT INTO `Phone_Numbers` VALUES ('999888777','e822a7e0-cc26-47a7-9e08-58c581442310','11/03/2020 20-51-23','11/03/2020 20-51-23'),('999999999','e822a7e0-cc26-47a7-9e08-58c581442310','11/03/2020 20-48-28','11/03/2020 20-48-28');



CREATE DATABASE  IF NOT EXISTS `provi_teste_db` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `provi_teste_db`;
--
-- Host: 3.86.164.89    Database: provi_teste_db
-- ------------------------------------------------------



