2024-12-27 15:17:18 +01:00
/* !999999- enable the sandbox mode */
2024-12-27 15:05:54 +01:00
-- MariaDB dump 10.19 Distrib 10.11.8-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: svrjs_mods
-- ------------------------------------------------------
-- Server version 10.11.8-MariaDB-0ubuntu0.24.04.1
-- This is a SQL script that intializes the database for SVR.JS Mods directory.
-- It's recommended to change the default password hash and email address.
2024-12-27 16:56:42 +01:00
-- Default administrator data:
-- - Username: svrjs
-- - Password: admin
-- - Email address: unknown@example.com
2024-12-27 15:05:54 +01: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 */ ;
/* !40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */ ;
/* !40103 SET TIME_ZONE='+00:00' */ ;
/* !40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */ ;
/* !40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */ ;
/* !40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */ ;
/* !40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */ ;
--
-- Table structure for table `categories`
--
DROP TABLE IF EXISTS ` categories ` ;
/* !40101 SET @saved_cs_client = @@character_set_client */ ;
/* !40101 SET character_set_client = utf8 */ ;
CREATE TABLE ` categories ` (
` id ` int ( 11 ) NOT NULL AUTO_INCREMENT ,
` name ` varchar ( 255 ) NOT NULL ,
` slug ` varchar ( 255 ) NOT NULL ,
PRIMARY KEY ( ` id ` ) ,
UNIQUE KEY ` slug ` ( ` slug ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ;
/* !40101 SET character_set_client = @saved_cs_client */ ;
--
-- Dumping data for table `categories`
--
LOCK TABLES ` categories ` WRITE ;
/* !40000 ALTER TABLE `categories` DISABLE KEYS */ ;
/* !40000 ALTER TABLE `categories` ENABLE KEYS */ ;
UNLOCK TABLES ;
--
-- Table structure for table `mods`
--
DROP TABLE IF EXISTS ` mods ` ;
/* !40101 SET @saved_cs_client = @@character_set_client */ ;
/* !40101 SET character_set_client = utf8 */ ;
CREATE TABLE ` mods ` (
` id ` int ( 11 ) NOT NULL AUTO_INCREMENT ,
` name ` varchar ( 255 ) NOT NULL ,
` slug ` varchar ( 255 ) NOT NULL ,
` description ` varchar ( 10000 ) DEFAULT NULL ,
` category ` int ( 11 ) NOT NULL ,
` link ` varchar ( 255 ) NOT NULL ,
` docs_link ` varchar ( 255 ) DEFAULT NULL ,
` user ` int ( 11 ) NOT NULL ,
` image_ext ` varchar ( 10 ) DEFAULT NULL ,
` is_paid ` int ( 11 ) NOT NULL DEFAULT 0 ,
` is_removed ` int ( 11 ) NOT NULL DEFAULT 0 ,
PRIMARY KEY ( ` id ` ) ,
UNIQUE KEY ` slug ` ( ` slug ` ) ,
FULLTEXT KEY ` name ` ( ` name ` , ` description ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ;
/* !40101 SET character_set_client = @saved_cs_client */ ;
--
-- Dumping data for table `mods`
--
LOCK TABLES ` mods ` WRITE ;
/* !40000 ALTER TABLE `mods` DISABLE KEYS */ ;
/* !40000 ALTER TABLE `mods` ENABLE KEYS */ ;
UNLOCK TABLES ;
--
-- Table structure for table `mods_pending`
--
DROP TABLE IF EXISTS ` mods_pending ` ;
/* !40101 SET @saved_cs_client = @@character_set_client */ ;
/* !40101 SET character_set_client = utf8 */ ;
CREATE TABLE ` mods_pending ` (
` id ` int ( 11 ) NOT NULL AUTO_INCREMENT ,
` name ` varchar ( 255 ) NOT NULL ,
` slug ` varchar ( 255 ) NOT NULL ,
` description ` varchar ( 10000 ) DEFAULT NULL ,
` category ` int ( 11 ) NOT NULL ,
` link ` varchar ( 255 ) NOT NULL ,
` docs_link ` varchar ( 255 ) DEFAULT NULL ,
` user ` int ( 11 ) NOT NULL ,
` image_ext ` varchar ( 10 ) DEFAULT NULL ,
` is_paid ` int ( 11 ) NOT NULL DEFAULT 0 ,
` is_rejected ` int ( 11 ) NOT NULL DEFAULT 0 ,
PRIMARY KEY ( ` id ` ) ,
UNIQUE KEY ` slug ` ( ` slug ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ;
/* !40101 SET character_set_client = @saved_cs_client */ ;
--
-- Dumping data for table `mods_pending`
--
LOCK TABLES ` mods_pending ` WRITE ;
/* !40000 ALTER TABLE `mods_pending` DISABLE KEYS */ ;
/* !40000 ALTER TABLE `mods_pending` ENABLE KEYS */ ;
UNLOCK TABLES ;
--
-- Table structure for table `requests_email`
--
DROP TABLE IF EXISTS ` requests_email ` ;
/* !40101 SET @saved_cs_client = @@character_set_client */ ;
/* !40101 SET character_set_client = utf8 */ ;
CREATE TABLE ` requests_email ` (
` id ` varchar ( 255 ) NOT NULL ,
` email ` varchar ( 255 ) NOT NULL ,
` user ` int ( 11 ) NOT NULL ,
` request_date ` datetime NOT NULL ,
PRIMARY KEY ( ` id ` ) USING BTREE ,
UNIQUE KEY ` user_id ` ( ` user ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ;
/* !40101 SET character_set_client = @saved_cs_client */ ;
--
-- Dumping data for table `requests_email`
--
LOCK TABLES ` requests_email ` WRITE ;
/* !40000 ALTER TABLE `requests_email` DISABLE KEYS */ ;
/* !40000 ALTER TABLE `requests_email` ENABLE KEYS */ ;
UNLOCK TABLES ;
--
-- Table structure for table `requests_password`
--
DROP TABLE IF EXISTS ` requests_password ` ;
/* !40101 SET @saved_cs_client = @@character_set_client */ ;
/* !40101 SET character_set_client = utf8 */ ;
CREATE TABLE ` requests_password ` (
` id ` varchar ( 255 ) NOT NULL ,
` user ` int ( 11 ) NOT NULL ,
` request_date ` datetime NOT NULL ,
PRIMARY KEY ( ` id ` ) USING BTREE ,
UNIQUE KEY ` user_id ` ( ` user ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ;
/* !40101 SET character_set_client = @saved_cs_client */ ;
--
-- Dumping data for table `requests_password`
--
LOCK TABLES ` requests_password ` WRITE ;
/* !40000 ALTER TABLE `requests_password` DISABLE KEYS */ ;
/* !40000 ALTER TABLE `requests_password` ENABLE KEYS */ ;
UNLOCK TABLES ;
--
-- Table structure for table `requests_register`
--
DROP TABLE IF EXISTS ` requests_register ` ;
/* !40101 SET @saved_cs_client = @@character_set_client */ ;
/* !40101 SET character_set_client = utf8 */ ;
CREATE TABLE ` requests_register ` (
` id ` varchar ( 255 ) NOT NULL ,
` user ` int ( 11 ) NOT NULL ,
PRIMARY KEY ( ` id ` ) USING BTREE ,
UNIQUE KEY ` user_id ` ( ` user ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ;
/* !40101 SET character_set_client = @saved_cs_client */ ;
--
-- Dumping data for table `requests_register`
--
LOCK TABLES ` requests_register ` WRITE ;
/* !40000 ALTER TABLE `requests_register` DISABLE KEYS */ ;
/* !40000 ALTER TABLE `requests_register` ENABLE KEYS */ ;
UNLOCK TABLES ;
--
-- Table structure for table `reviews`
--
DROP TABLE IF EXISTS ` reviews ` ;
/* !40101 SET @saved_cs_client = @@character_set_client */ ;
/* !40101 SET character_set_client = utf8 */ ;
CREATE TABLE ` reviews ` (
` id ` int ( 11 ) NOT NULL AUTO_INCREMENT ,
` user ` int ( 11 ) NOT NULL ,
` mod ` int ( 11 ) NOT NULL ,
` rating ` tinyint ( 4 ) NOT NULL ,
` review ` varchar ( 1000 ) NOT NULL ,
PRIMARY KEY ( ` id ` ) ,
UNIQUE KEY ` user_id ` ( ` user ` , ` mod ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ;
/* !40101 SET character_set_client = @saved_cs_client */ ;
--
-- Dumping data for table `reviews`
--
LOCK TABLES ` reviews ` WRITE ;
/* !40000 ALTER TABLE `reviews` DISABLE KEYS */ ;
/* !40000 ALTER TABLE `reviews` ENABLE KEYS */ ;
UNLOCK TABLES ;
--
-- Table structure for table `sessions`
--
DROP TABLE IF EXISTS ` sessions ` ;
/* !40101 SET @saved_cs_client = @@character_set_client */ ;
/* !40101 SET character_set_client = utf8 */ ;
CREATE TABLE ` sessions ` (
` id ` varchar ( 128 ) NOT NULL ,
` data ` text NOT NULL ,
PRIMARY KEY ( ` id ` )
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ;
/* !40101 SET character_set_client = @saved_cs_client */ ;
--
-- Dumping data for table `sessions`
--
LOCK TABLES ` sessions ` WRITE ;
/* !40000 ALTER TABLE `sessions` DISABLE KEYS */ ;
/* !40000 ALTER TABLE `sessions` ENABLE KEYS */ ;
UNLOCK TABLES ;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS ` users ` ;
/* !40101 SET @saved_cs_client = @@character_set_client */ ;
/* !40101 SET character_set_client = utf8 */ ;
CREATE TABLE ` users ` (
` id ` int ( 11 ) NOT NULL AUTO_INCREMENT ,
` username ` varchar ( 255 ) NOT NULL ,
` password ` varchar ( 255 ) NOT NULL ,
` email ` varchar ( 255 ) NOT NULL ,
` bio ` varchar ( 1000 ) DEFAULT NULL ,
` is_verified ` tinyint ( 1 ) NOT NULL DEFAULT 0 ,
` is_moderator ` tinyint ( 1 ) NOT NULL DEFAULT 0 ,
` is_suspended ` tinyint ( 1 ) NOT NULL DEFAULT 0 ,
` is_deleted ` tinyint ( 1 ) NOT NULL DEFAULT 0 ,
PRIMARY KEY ( ` id ` ) ,
UNIQUE KEY ` username ` ( ` username ` ) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci ;
/* !40101 SET character_set_client = @saved_cs_client */ ;
--
-- Dumping data for table `users`
--
-- It's recommended to change the default password hash and email address.
-- Replace "svrjs" with desired username, "$2y$10$1kVr2tcxGdbpL7/8aigzoO0FQvDLW2WxaThEd2L6PE1ykkn0T9nsS" with a password hash (you can hash it using "password_hash" function in PHP CLI), and "unknown@example.com" with your email address.
LOCK TABLES ` users ` WRITE ;
/* !40000 ALTER TABLE `users` DISABLE KEYS */ ;
INSERT INTO ` users ` VALUES
( 1 , ' svrjs ' , ' $2y$10$1kVr2tcxGdbpL7/8aigzoO0FQvDLW2WxaThEd2L6PE1ykkn0T9nsS ' , ' unknown@example.com ' , NULL , 1 , 1 , 0 , 0 ) ;
/* !40000 ALTER TABLE `users` ENABLE KEYS */ ;
UNLOCK TABLES ;
/* !40103 SET TIME_ZONE=@OLD_TIME_ZONE */ ;
/* !40101 SET SQL_MODE=@OLD_SQL_MODE */ ;
/* !40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */ ;
/* !40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */ ;
/* !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 */ ;
/* !40111 SET SQL_NOTES=@OLD_SQL_NOTES */ ;
-- Dump completed on 2024-12-27 15:02:30