class_management_system

Senior Project - Spring 2019
Log | Files | Refs | README

commit fc0391ba88ce62e98aa00360fd94a8d1ab995e6f
parent a463777c6bfc2c43383cfe5330b8cc9947749300
Author: John Kubach <johnkubach@gmail.com>
Date:   Sat, 23 Feb 2019 11:23:42 -0500

Update database

Database structure based off of version 3.0 of our er / schema diagrams.

Diffstat:
Mdatabase/db.sql | 369+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------
1 file changed, 307 insertions(+), 62 deletions(-)

diff --git a/database/db.sql b/database/db.sql @@ -1,62 +1,307 @@ -<?xml version="1.0"?> -<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> -<database name="senior_project"> - <table_structure name="consult_letter"> - <field Field="consult_letter_id" Type="smallint(5) unsigned" Null="NO" Key="PRI" Extra="auto_increment" Comment="" /> - <field Field="consult_letter_file_path" Type="varchar(255)" Null="NO" Key="" Extra="" Comment="" /> - <field Field="consult_letter_parent" Type="smallint(5) unsigned" Null="YES" Key="" Default="NULL" Extra="" Comment="" /> - <key Table="consult_letter" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="consult_letter_id" Collation="A" Cardinality="0" Null="" Index_type="BTREE" Comment="" Index_comment="" /> - <options Name="consult_letter" Engine="InnoDB" Version="10" Row_format="Dynamic" Rows="0" Avg_row_length="0" Data_length="16384" Max_data_length="0" Index_length="0" Data_free="0" Auto_increment="2" Create_time="2019-02-12 02:00:29" Update_time="2019-02-12 02:00:29" Collation="utf8mb4_unicode_ci" Create_options="" Comment="" Max_index_length="0" Temporary="N" /> - </table_structure> - <table_structure name="cover_sheet"> - <field Field="cover_id" Type="smallint(5) unsigned" Null="NO" Key="PRI" Extra="auto_increment" Comment="" /> - <field Field="cover_file_path" Type="varchar(255)" Null="NO" Key="" Extra="" Comment="" /> - <field Field="cover_parent" Type="smallint(5) unsigned" Null="YES" Key="" Default="NULL" Extra="" Comment="" /> - <key Table="cover_sheet" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="cover_id" Collation="A" Cardinality="0" Null="" Index_type="BTREE" Comment="" Index_comment="" /> - <options Name="cover_sheet" Engine="InnoDB" Version="10" Row_format="Dynamic" Rows="0" Avg_row_length="0" Data_length="16384" Max_data_length="0" Index_length="0" Data_free="0" Auto_increment="2" Create_time="2019-02-12 02:00:02" Update_time="2019-02-12 02:00:02" Collation="utf8mb4_unicode_ci" Create_options="" Comment="" Max_index_length="0" Temporary="N" /> - </table_structure> - <table_structure name="library_form"> - <field Field="library_form_id" Type="smallint(5) unsigned" Null="NO" Key="PRI" Extra="auto_increment" Comment="" /> - <field Field="library_form_file_path" Type="varchar(255)" Null="NO" Key="" Extra="" Comment="" /> - <key Table="library_form" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="library_form_id" Collation="A" Cardinality="1" Null="" Index_type="BTREE" Comment="" Index_comment="" /> - <options Name="library_form" Engine="InnoDB" Version="10" Row_format="Dynamic" Rows="1" Avg_row_length="16384" Data_length="16384" Max_data_length="0" Index_length="0" Data_free="0" Auto_increment="2" Create_time="2019-02-10 23:36:22" Update_time="2019-02-11 00:11:41" Collation="utf8mb4_unicode_ci" Create_options="" Comment="" Max_index_length="0" Temporary="N" /> - </table_structure> - <table_structure name="proposal"> - <field Field="proposal_id" Type="smallint(5) unsigned" Null="NO" Key="PRI" Extra="auto_increment" Comment="" /> - <field Field="parent_proposal" Type="smallint(5) unsigned" Null="YES" Key="" Default="NULL" Extra="" Comment="" /> - <field Field="proposal_name" Type="varchar(50)" Null="NO" Key="" Extra="" Comment="" /> - <field Field="cover_sheet" Type="smallint(5) unsigned" Null="NO" Key="MUL" Extra="" Comment="" /> - <field Field="template" Type="smallint(5) unsigned" Null="NO" Key="MUL" Extra="" Comment="" /> - <field Field="library_form" Type="smallint(5) unsigned" Null="NO" Key="MUL" Extra="" Comment="" /> - <field Field="consult_letter" Type="smallint(5) unsigned" Null="NO" Key="MUL" Extra="" Comment="" /> - <field Field="author" Type="smallint(5) unsigned" Null="NO" Key="MUL" Extra="" Comment="" /> - <field Field="date" Type="datetime" Null="NO" Key="" Extra="" Comment="" /> - <field Field="accepted" Type="tinyint(4)" Null="NO" Key="" Default="0" Extra="" Comment="" /> - <field Field="need_library_form" Type="tinyint(4)" Null="NO" Key="" Extra="" Comment="" /> - <field Field="cover_type" Type="char(1)" Null="NO" Key="" Extra="" Comment="" /> - <field Field="template_type" Type="char(1)" Null="NO" Key="" Extra="" Comment="" /> - <key Table="proposal" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="proposal_id" Collation="A" Cardinality="1" Null="" Index_type="BTREE" Comment="" Index_comment="" /> - <key Table="proposal" Non_unique="1" Key_name="fk_cover_sheet" Seq_in_index="1" Column_name="cover_sheet" Collation="A" Cardinality="1" Null="" Index_type="BTREE" Comment="" Index_comment="" /> - <key Table="proposal" Non_unique="1" Key_name="fk_template" Seq_in_index="1" Column_name="template" Collation="A" Cardinality="1" Null="" Index_type="BTREE" Comment="" Index_comment="" /> - <key Table="proposal" Non_unique="1" Key_name="fk_library_form" Seq_in_index="1" Column_name="library_form" Collation="A" Cardinality="1" Null="" Index_type="BTREE" Comment="" Index_comment="" /> - <key Table="proposal" Non_unique="1" Key_name="fk_consult_letter" Seq_in_index="1" Column_name="consult_letter" Collation="A" Cardinality="1" Null="" Index_type="BTREE" Comment="" Index_comment="" /> - <key Table="proposal" Non_unique="1" Key_name="fk_author" Seq_in_index="1" Column_name="author" Collation="A" Cardinality="1" Null="" Index_type="BTREE" Comment="" Index_comment="" /> - <options Name="proposal" Engine="InnoDB" Version="10" Row_format="Dynamic" Rows="1" Avg_row_length="16384" Data_length="16384" Max_data_length="0" Index_length="81920" Data_free="0" Auto_increment="2" Create_time="2019-02-11 01:03:55" Collation="utf8mb4_unicode_ci" Create_options="" Comment="" Max_index_length="0" Temporary="N" /> - </table_structure> - <table_structure name="template"> - <field Field="template_id" Type="smallint(5) unsigned" Null="NO" Key="PRI" Extra="auto_increment" Comment="" /> - <field Field="template_file_path" Type="varchar(255)" Null="NO" Key="" Extra="" Comment="" /> - <key Table="template" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="template_id" Collation="A" Cardinality="1" Null="" Index_type="BTREE" Comment="" Index_comment="" /> - <options Name="template" Engine="InnoDB" Version="10" Row_format="Dynamic" Rows="1" Avg_row_length="16384" Data_length="16384" Max_data_length="0" Index_length="0" Data_free="0" Auto_increment="2" Create_time="2019-02-10 23:35:40" Update_time="2019-02-11 00:10:58" Collation="utf8mb4_unicode_ci" Create_options="" Comment="" Max_index_length="0" Temporary="N" /> - </table_structure> - <table_structure name="user"> - <field Field="user_id" Type="smallint(5) unsigned" Null="NO" Key="PRI" Extra="auto_increment" Comment="" /> - <field Field="first_name" Type="varchar(20)" Null="NO" Key="" Extra="" Comment="" /> - <field Field="middle_name" Type="varchar(20)" Null="YES" Key="" Default="NULL" Extra="" Comment="" /> - <field Field="last_name" Type="varchar(20)" Null="NO" Key="" Extra="" Comment="" /> - <field Field="email" Type="varchar(30)" Null="NO" Key="" Extra="" Comment="" /> - <key Table="user" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="user_id" Collation="A" Cardinality="1" Null="" Index_type="BTREE" Comment="" Index_comment="" /> - <options Name="user" Engine="InnoDB" Version="10" Row_format="Dynamic" Rows="1" Avg_row_length="16384" Data_length="16384" Max_data_length="0" Index_length="0" Data_free="0" Auto_increment="2" Create_time="2019-02-10 22:52:38" Update_time="2019-02-11 00:15:41" Collation="utf8mb4_unicode_ci" Create_options="" Comment="" Max_index_length="0" Temporary="N" /> - </table_structure> -</database> -</mysqldump> +-- MySQL dump 10.17 Distrib 10.3.12-MariaDB, for Linux (x86_64) +-- +-- Host: localhost Database: senior_project +-- ------------------------------------------------------ +-- Server version 10.3.12-MariaDB + +/*!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 `consult_letter` +-- + +DROP TABLE IF EXISTS `consult_letter`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `consult_letter` ( + `consult_letter_id` smallint(6) NOT NULL, + `employee_id` smallint(6) NOT NULL, + `proposal_id` smallint(6) NOT NULL, + PRIMARY KEY (`consult_letter_id`), + KEY `employee_id` (`employee_id`), + KEY `proposal_id` (`proposal_id`), + CONSTRAINT `consult_letter_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `employee` (`employee_id`), + CONSTRAINT `consult_letter_ibfk_2` FOREIGN KEY (`proposal_id`) REFERENCES `proposal` (`proposal_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `consult_letter` +-- + +LOCK TABLES `consult_letter` WRITE; +/*!40000 ALTER TABLE `consult_letter` DISABLE KEYS */; +/*!40000 ALTER TABLE `consult_letter` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `consult_letter_revision` +-- + +DROP TABLE IF EXISTS `consult_letter_revision`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `consult_letter_revision` ( + `consult_letter_id` smallint(6) NOT NULL, + `consult_letter_file_path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `consult_letter_date` date NOT NULL, + KEY `consult_letter_id` (`consult_letter_id`), + CONSTRAINT `consult_letter_revision_ibfk_1` FOREIGN KEY (`consult_letter_id`) REFERENCES `consult_letter` (`consult_letter_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `consult_letter_revision` +-- + +LOCK TABLES `consult_letter_revision` WRITE; +/*!40000 ALTER TABLE `consult_letter_revision` DISABLE KEYS */; +/*!40000 ALTER TABLE `consult_letter_revision` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `cover_sheet` +-- + +DROP TABLE IF EXISTS `cover_sheet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `cover_sheet` ( + `cover_sheet_id` smallint(6) NOT NULL, + PRIMARY KEY (`cover_sheet_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `cover_sheet` +-- + +LOCK TABLES `cover_sheet` WRITE; +/*!40000 ALTER TABLE `cover_sheet` DISABLE KEYS */; +/*!40000 ALTER TABLE `cover_sheet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `cover_sheet_revision` +-- + +DROP TABLE IF EXISTS `cover_sheet_revision`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `cover_sheet_revision` ( + `cover_sheet_id` smallint(6) NOT NULL, + `cover_sheet_file_path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `cover_sheet_date` date NOT NULL, + KEY `cover_sheet_id` (`cover_sheet_id`), + CONSTRAINT `cover_sheet_revision_ibfk_1` FOREIGN KEY (`cover_sheet_id`) REFERENCES `cover_sheet` (`cover_sheet_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `cover_sheet_revision` +-- + +LOCK TABLES `cover_sheet_revision` WRITE; +/*!40000 ALTER TABLE `cover_sheet_revision` DISABLE KEYS */; +/*!40000 ALTER TABLE `cover_sheet_revision` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `employee` +-- + +DROP TABLE IF EXISTS `employee`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `employee` ( + `employee_id` smallint(6) NOT NULL AUTO_INCREMENT, + `first_name` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, + `middle_name` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `last_name` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, + `email` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL, + `department` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL, + `curricular_consultant` tinyint(4) NOT NULL, + PRIMARY KEY (`employee_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `employee` +-- + +LOCK TABLES `employee` WRITE; +/*!40000 ALTER TABLE `employee` DISABLE KEYS */; +/*!40000 ALTER TABLE `employee` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `library_form` +-- + +DROP TABLE IF EXISTS `library_form`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `library_form` ( + `library_form_id` smallint(6) NOT NULL, + PRIMARY KEY (`library_form_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `library_form` +-- + +LOCK TABLES `library_form` WRITE; +/*!40000 ALTER TABLE `library_form` DISABLE KEYS */; +/*!40000 ALTER TABLE `library_form` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `library_form_revision` +-- + +DROP TABLE IF EXISTS `library_form_revision`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `library_form_revision` ( + `library_form_id` smallint(6) NOT NULL, + `library_form_file_path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `library_form_date` date NOT NULL, + KEY `library_form_id` (`library_form_id`), + CONSTRAINT `library_form_revision_ibfk_1` FOREIGN KEY (`library_form_id`) REFERENCES `library_form` (`library_form_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `library_form_revision` +-- + +LOCK TABLES `library_form_revision` WRITE; +/*!40000 ALTER TABLE `library_form_revision` DISABLE KEYS */; +/*!40000 ALTER TABLE `library_form_revision` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `proposal` +-- + +DROP TABLE IF EXISTS `proposal`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `proposal` ( + `proposal_id` smallint(6) NOT NULL AUTO_INCREMENT, + `cover_sheet_id` smallint(6) DEFAULT NULL, + `template_id` smallint(6) DEFAULT NULL, + `library_form_id` smallint(6) DEFAULT NULL, + `proposal_date` date NOT NULL, + `revision_note` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `proposal_title` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `proposal_description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `need_library_form` char(1) COLLATE utf8mb4_unicode_ci NOT NULL, + `template_type` char(1) COLLATE utf8mb4_unicode_ci NOT NULL, + PRIMARY KEY (`proposal_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `proposal` +-- + +LOCK TABLES `proposal` WRITE; +/*!40000 ALTER TABLE `proposal` DISABLE KEYS */; +/*!40000 ALTER TABLE `proposal` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `sponsor` +-- + +DROP TABLE IF EXISTS `sponsor`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `sponsor` ( + `proposal_id` smallint(6) NOT NULL, + `employee_id` smallint(6) NOT NULL, + `is_author` tinyint(4) NOT NULL, + KEY `proposal_id` (`proposal_id`), + KEY `employee_id` (`employee_id`), + CONSTRAINT `sponsor_ibfk_1` FOREIGN KEY (`proposal_id`) REFERENCES `proposal` (`proposal_id`), + CONSTRAINT `sponsor_ibfk_2` FOREIGN KEY (`employee_id`) REFERENCES `employee` (`employee_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `sponsor` +-- + +LOCK TABLES `sponsor` WRITE; +/*!40000 ALTER TABLE `sponsor` DISABLE KEYS */; +/*!40000 ALTER TABLE `sponsor` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `template` +-- + +DROP TABLE IF EXISTS `template`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `template` ( + `template_id` smallint(6) NOT NULL, + PRIMARY KEY (`template_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `template` +-- + +LOCK TABLES `template` WRITE; +/*!40000 ALTER TABLE `template` DISABLE KEYS */; +/*!40000 ALTER TABLE `template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `template_revision` +-- + +DROP TABLE IF EXISTS `template_revision`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `template_revision` ( + `template_id` smallint(6) NOT NULL, + `template_file_path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `template_date` date NOT NULL, + KEY `template_id` (`template_id`), + CONSTRAINT `template_revision_ibfk_1` FOREIGN KEY (`template_id`) REFERENCES `template` (`template_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `template_revision` +-- + +LOCK TABLES `template_revision` WRITE; +/*!40000 ALTER TABLE `template_revision` DISABLE KEYS */; +/*!40000 ALTER TABLE `template_revision` 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 2019-02-20 20:12:58