diff --git a/Tubes2/db/ojek_account.sql b/Tubes2/db/ojek_account.sql new file mode 100644 index 0000000000000000000000000000000000000000..7467243c2af696351b7607116c14d711c7191d6b --- /dev/null +++ b/Tubes2/db/ojek_account.sql @@ -0,0 +1,70 @@ +-- phpMyAdmin SQL Dump +-- version 4.7.0 +-- https://www.phpmyadmin.net/ +-- +-- Host: 127.0.0.1 +-- Generation Time: Nov 04, 2017 at 07:58 AM +-- Server version: 10.1.25-MariaDB +-- PHP Version: 5.6.31 + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +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: `ojek_account` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `account` +-- + +CREATE TABLE `account` ( + `username` varchar(30) NOT NULL, + `email` varchar(50) NOT NULL, + `password` varchar(30) NOT NULL, + `access_token` varchar(20) DEFAULT NULL, + `expire` bigint(20) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `account` +-- + +INSERT INTO `account` (`username`, `email`, `password`, `access_token`, `expire`) VALUES +('dimjervin', 'marjer03dim@gmail.com', 'dimjer', '', 0), +('vinjerdim', 'marjer17dim@gmail.com', 'vinjer', '', 0); + +-- +-- Indexes for dumped tables +-- + +-- +-- Indexes for table `account` +-- +ALTER TABLE `account` + ADD PRIMARY KEY (`username`); + +-- +-- Constraints for dumped tables +-- + +-- +-- Constraints for table `account` +-- +ALTER TABLE `account` + ADD CONSTRAINT `username_constraint` FOREIGN KEY (`username`) REFERENCES `ojek_online`.`account` (`username`) ON DELETE CASCADE ON UPDATE CASCADE; +COMMIT; + +/*!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 */; diff --git a/Tubes2/db/ojek_online.sql b/Tubes2/db/ojek_online.sql new file mode 100644 index 0000000000000000000000000000000000000000..dec80d93bca0a339db2247ed699ce7586cafc979 --- /dev/null +++ b/Tubes2/db/ojek_online.sql @@ -0,0 +1,112 @@ +-- phpMyAdmin SQL Dump +-- version 4.7.0 +-- https://www.phpmyadmin.net/ +-- +-- Host: 127.0.0.1 +-- Generation Time: Nov 04, 2017 at 07:58 AM +-- Server version: 10.1.25-MariaDB +-- PHP Version: 5.6.31 + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +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: `ojek_online` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `account` +-- + +CREATE TABLE `account` ( + `account_id` int(11) NOT NULL, + `full_name` varchar(50) NOT NULL, + `username` varchar(30) NOT NULL, + `email` varchar(50) NOT NULL, + `phone` varchar(20) NOT NULL, + `is_driver` tinyint(1) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `account` +-- + +INSERT INTO `account` (`account_id`, `full_name`, `username`, `email`, `phone`, `is_driver`) VALUES +(1, 'Marvin Jerremy', 'vinjerdim', 'marjer17dim@gmail.com', '081322198520', 1), +(2, 'Jerremy Budiman', 'dimjervin', 'marjer03dim@gmail.com', '081322198520', 0); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `transaction` +-- + +CREATE TABLE `transaction` ( + `transaction_id` int(11) NOT NULL, + `passenger_id` int(11) DEFAULT NULL, + `driver_id` int(11) DEFAULT NULL, + `pick_location` varchar(50) NOT NULL, + `dest_location` varchar(50) NOT NULL, + `date` date NOT NULL, + `stars` tinyint(4) NOT NULL, + `review` text NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Indexes for dumped tables +-- + +-- +-- Indexes for table `account` +-- +ALTER TABLE `account` + ADD PRIMARY KEY (`account_id`), + ADD UNIQUE KEY `username` (`username`); + +-- +-- Indexes for table `transaction` +-- +ALTER TABLE `transaction` + ADD PRIMARY KEY (`transaction_id`), + ADD KEY `driver_id_constraint` (`driver_id`), + ADD KEY `passenger_id_constraint` (`passenger_id`); + +-- +-- AUTO_INCREMENT for dumped tables +-- + +-- +-- AUTO_INCREMENT for table `account` +-- +ALTER TABLE `account` + MODIFY `account_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; +-- +-- AUTO_INCREMENT for table `transaction` +-- +ALTER TABLE `transaction` + MODIFY `transaction_id` int(11) NOT NULL AUTO_INCREMENT; +-- +-- Constraints for dumped tables +-- + +-- +-- Constraints for table `transaction` +-- +ALTER TABLE `transaction` + ADD CONSTRAINT `driver_id_constraint` FOREIGN KEY (`driver_id`) REFERENCES `account` (`account_id`) ON DELETE SET NULL ON UPDATE CASCADE, + ADD CONSTRAINT `passenger_id_constraint` FOREIGN KEY (`passenger_id`) REFERENCES `account` (`account_id`) ON DELETE SET NULL ON UPDATE CASCADE; +COMMIT; + +/*!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 */;