diff --git a/SQL/paredu.sql b/SQL/paredu.sql new file mode 100644 index 0000000..600ca4e --- /dev/null +++ b/SQL/paredu.sql @@ -0,0 +1,224 @@ +-- phpMyAdmin SQL Dump +-- version 5.1.0 +-- https://www.phpmyadmin.net/ +-- +-- Host: localhost +-- Generation Time: Apr 08, 2021 at 09:29 PM +-- Server version: 10.3.27-MariaDB-0+deb10u1 +-- PHP Version: 7.3.27-1~deb10u1 + +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: `paredu` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `acctypes` +-- + +CREATE TABLE `acctypes` ( + `id` tinyint(11) NOT NULL, + `name_hun` text NOT NULL, + `name_eng` text NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `auth` +-- + +CREATE TABLE `auth` ( + `id` bigint(11) NOT NULL, + `username` text NOT NULL, + `fullname` text NOT NULL, + `password` text NOT NULL, + `type` tinyint(4) NOT NULL, + `connectedschoolids` text NOT NULL, + `connectedcompanyids` text NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `companies` +-- + +CREATE TABLE `companies` ( + `id` bigint(20) NOT NULL, + `name` text NOT NULL, + `type` text NOT NULL, + `spec` text NOT NULL, + `postalcode` tinytext NOT NULL, + `location` text NOT NULL, + `locationspec` text NOT NULL, + `phonenumber` text NOT NULL, + `emailaddress` text NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `companytypes` +-- + +CREATE TABLE `companytypes` ( + `abbr` text NOT NULL, + `hun` text NOT NULL, + `eng` text NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `events` +-- + +CREATE TABLE `events` ( + `eventid` bigint(20) NOT NULL, + `title` text NOT NULL, + `description` text NOT NULL, + `datetime` datetime NOT NULL, + `ownertype` int(11) NOT NULL, + `ownerid` int(11) NOT NULL, + `category` text NOT NULL, + `uploadedas_userid` text NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `faculties` +-- + +CREATE TABLE `faculties` ( + `facultyid` int(11) NOT NULL, + `schoolid` int(11) NOT NULL, + `facultyname` text NOT NULL, + `facultyspec` text NOT NULL, + `facultyphonenumber` text NOT NULL, + `facultyemail` text NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `schools` +-- + +CREATE TABLE `schools` ( + `id` bigint(20) NOT NULL, + `name` text NOT NULL, + `type` text NOT NULL, + `spec` text NOT NULL, + `postalcode` tinytext NOT NULL, + `location` text NOT NULL, + `locationspec` text NOT NULL, + `phonenumber` text NOT NULL, + `emailaddress` text NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `schooltypes` +-- + +CREATE TABLE `schooltypes` ( + `abbr` text NOT NULL, + `hun` text NOT NULL, + `eng` text NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- +-- Indexes for dumped tables +-- + +-- +-- Indexes for table `acctypes` +-- +ALTER TABLE `acctypes` + ADD PRIMARY KEY (`id`), + ADD UNIQUE KEY `id` (`id`); + +-- +-- Indexes for table `auth` +-- +ALTER TABLE `auth` + ADD PRIMARY KEY (`id`), + ADD UNIQUE KEY `id` (`id`); + +-- +-- Indexes for table `companies` +-- +ALTER TABLE `companies` + ADD PRIMARY KEY (`id`); + +-- +-- Indexes for table `companytypes` +-- +ALTER TABLE `companytypes` + ADD UNIQUE KEY `abbr` (`abbr`(30)); + +-- +-- Indexes for table `events` +-- +ALTER TABLE `events` + ADD PRIMARY KEY (`eventid`); + +-- +-- Indexes for table `faculties` +-- +ALTER TABLE `faculties` + ADD PRIMARY KEY (`facultyid`); + +-- +-- Indexes for table `schools` +-- +ALTER TABLE `schools` + ADD PRIMARY KEY (`id`), + ADD UNIQUE KEY `PRIMARY_2` (`id`); + +-- +-- Indexes for table `schooltypes` +-- +ALTER TABLE `schooltypes` + ADD UNIQUE KEY `abbr` (`abbr`(30)); + +-- +-- AUTO_INCREMENT for dumped tables +-- + +-- +-- AUTO_INCREMENT for table `auth` +-- +ALTER TABLE `auth` + MODIFY `id` bigint(11) NOT NULL AUTO_INCREMENT; + +-- +-- AUTO_INCREMENT for table `events` +-- +ALTER TABLE `events` + MODIFY `eventid` bigint(20) NOT NULL AUTO_INCREMENT; + +-- +-- AUTO_INCREMENT for table `faculties` +-- +ALTER TABLE `faculties` + MODIFY `facultyid` int(11) NOT NULL AUTO_INCREMENT; +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/SQL/paredu_chat.sql b/SQL/paredu_chat.sql new file mode 100644 index 0000000..a816e4a --- /dev/null +++ b/SQL/paredu_chat.sql @@ -0,0 +1,143 @@ +-- phpMyAdmin SQL Dump +-- version 4.9.0.1 +-- https://www.phpmyadmin.net/ +-- +-- Host: localhost +-- Generation Time: Apr 10, 2021 at 01:57 PM +-- Server version: 10.3.27-MariaDB-0+deb10u1 +-- PHP Version: 7.3.27-1~deb10u1 + +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: `paredu_chat` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `chats` +-- + +CREATE TABLE `chats` ( + `chat_id` int(4) NOT NULL, + `chat_user_id` int(3) NOT NULL, + `chat_user2_id` int(3) NOT NULL, + `chat_message` text NOT NULL, + `chat_sent_by` int(1) NOT NULL, + `chat_date` datetime NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `chats_from` +-- + +CREATE TABLE `chats_from` ( + `chat_id` int(4) NOT NULL, + `chat_user_id` int(4) NOT NULL, + `chat_user_from` int(4) NOT NULL, + `chat_type` varchar(10) NOT NULL DEFAULT 'received', + `chat_message` varchar(255) NOT NULL, + `chat_date` datetime NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `chats_to` +-- + +CREATE TABLE `chats_to` ( + `chat_id` int(4) NOT NULL, + `chat_to_user_id` int(4) NOT NULL, + `chat_user_id_to` int(4) NOT NULL, + `chat_type` varchar(10) NOT NULL DEFAULT 'sent', + `chat_message` varchar(255) NOT NULL, + `chat_date` datetime NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `users` +-- + +CREATE TABLE `users` ( + `user_id` int(3) NOT NULL, + `user_name` varchar(50) NOT NULL, + `users_pass` varchar(255) NOT NULL, + `user_picture` varchar(100) NOT NULL, + `user_status` int(1) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Indexes for dumped tables +-- + +-- +-- Indexes for table `chats` +-- +ALTER TABLE `chats` + ADD PRIMARY KEY (`chat_id`); + +-- +-- Indexes for table `chats_from` +-- +ALTER TABLE `chats_from` + ADD PRIMARY KEY (`chat_id`); + +-- +-- Indexes for table `chats_to` +-- +ALTER TABLE `chats_to` + ADD PRIMARY KEY (`chat_id`); + +-- +-- Indexes for table `users` +-- +ALTER TABLE `users` + ADD PRIMARY KEY (`user_id`); + +-- +-- AUTO_INCREMENT for dumped tables +-- + +-- +-- AUTO_INCREMENT for table `chats` +-- +ALTER TABLE `chats` + MODIFY `chat_id` int(4) NOT NULL AUTO_INCREMENT; + +-- +-- AUTO_INCREMENT for table `chats_from` +-- +ALTER TABLE `chats_from` + MODIFY `chat_id` int(4) NOT NULL AUTO_INCREMENT; + +-- +-- AUTO_INCREMENT for table `chats_to` +-- +ALTER TABLE `chats_to` + MODIFY `chat_id` int(4) NOT NULL AUTO_INCREMENT; + +-- +-- AUTO_INCREMENT for table `users` +-- +ALTER TABLE `users` + MODIFY `user_id` int(3) NOT NULL AUTO_INCREMENT; +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 */;