113 lines
2.9 KiB
SQL
113 lines
2.9 KiB
SQL
-- phpMyAdmin SQL Dump
|
|
-- version 5.2.1
|
|
-- https://www.phpmyadmin.net/
|
|
--
|
|
-- Host: 127.0.0.1
|
|
-- Generation Time: Dec 19, 2025 at 10:19 AM
|
|
-- Server version: 10.4.32-MariaDB
|
|
-- PHP Version: 8.2.12
|
|
|
|
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
|
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: `users_db`
|
|
--
|
|
CREATE DATABASE IF NOT EXISTS `users_db` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
|
USE `users_db`;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `scores`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `scores`;
|
|
CREATE TABLE `scores` (
|
|
`id` int(11) NOT NULL,
|
|
`user_id` int(11) NOT NULL,
|
|
`score` int(11) NOT NULL,
|
|
`difficulty` varchar(20) NOT NULL DEFAULT 'Easy',
|
|
`played_at` timestamp NOT NULL DEFAULT current_timestamp()
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `users`
|
|
--
|
|
|
|
DROP TABLE IF EXISTS `users`;
|
|
CREATE TABLE `users` (
|
|
`id` int(11) NOT NULL,
|
|
`username` varchar(255) NOT NULL,
|
|
`email` varchar(255) NOT NULL,
|
|
`password` varchar(255) NOT NULL
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
|
|
|
--
|
|
-- Dumping data for table `users`
|
|
--
|
|
|
|
INSERT INTO `users` (`id`, `username`, `email`, `password`) VALUES
|
|
(1, 'notnoot', 'nathanhandoko473@gmail.com', '$2y$10$kP3iVldzpmzAYXJ/rbE9ZecVDptBDGGQM/DXA55/HKROXVgUXsDxi'),
|
|
(2, 'nathan', 'nathan-h.inf25@ukwms.ac.id', '$2y$10$SXRMgB7.tFDquOfEOe2ek.4r2MWJx5q2G6ShwZ7EjFu0vjDXuGWim'),
|
|
(3, 'cuss', 'giashintaspm96@gmail.com', '$2y$10$MO6bOfbBd0UEU93naFv8r.GKlnm9jQOzvnLw76n33ZAUfYRbcrqDy'),
|
|
(4, 'lynayrl', 'evelynadigloria24@gmail.com', '$2y$10$qQ/17DiHA2AlGZ87oUPiB.6m.2zaI2kExIR2oBPWoJEco3ds0sjPC');
|
|
|
|
--
|
|
-- Indexes for dumped tables
|
|
--
|
|
|
|
--
|
|
-- Indexes for table `scores`
|
|
--
|
|
ALTER TABLE `scores`
|
|
ADD PRIMARY KEY (`id`),
|
|
ADD KEY `user_id` (`user_id`);
|
|
|
|
--
|
|
-- Indexes for table `users`
|
|
--
|
|
ALTER TABLE `users`
|
|
ADD PRIMARY KEY (`id`),
|
|
ADD UNIQUE KEY `email_unique` (`email`);
|
|
|
|
--
|
|
-- AUTO_INCREMENT for dumped tables
|
|
--
|
|
|
|
--
|
|
-- AUTO_INCREMENT for table `scores`
|
|
--
|
|
ALTER TABLE `scores`
|
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
|
|
|
|
--
|
|
-- AUTO_INCREMENT for table `users`
|
|
--
|
|
ALTER TABLE `users`
|
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
|
|
|
|
--
|
|
-- Constraints for dumped tables
|
|
--
|
|
|
|
--
|
|
-- Constraints for table `scores`
|
|
--
|
|
ALTER TABLE `scores`
|
|
ADD CONSTRAINT `scores_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE 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 */;
|