Browse Source

added example databse

master
Keanu D?lle 2 years ago
parent
commit
5a8c0b39e0
  1. 7
      .idea/dictionaries/anghenfil.xml
  2. 0
      erms-config.toml
  3. 335
      example-database.sql
  4. 1
      lang/de-DE
  5. 0
      src/lang/parse.rs

7
.idea/dictionaries/anghenfil.xml

@ -0,0 +1,7 @@
<component name="ProjectDictionaryState">
<dictionary name="anghenfil">
<words>
<w>unparsable</w>
</words>
</dictionary>
</component>

0
ERMS-config.toml → erms-config.toml

335
example-database.sql

@ -0,0 +1,335 @@
-- MariaDB dump 10.17 Distrib 10.4.11-MariaDB, for Linux (x86_64)
--
-- Host: 127.0.0.1 Database: ERMS
-- ------------------------------------------------------
-- Server version 10.4.11-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 `communication_email_addresses`
--
DROP TABLE IF EXISTS `communication_email_addresses`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `communication_email_addresses` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`f_users_id` int(11) NOT NULL,
`email` varchar(320) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`visibility` tinyint(4) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `communication_email_addresses_users_id_fk` (`f_users_id`),
CONSTRAINT `communication_email_addresses_users_id_fk` FOREIGN KEY (`f_users_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `communication_email_addresses`
--
LOCK TABLES `communication_email_addresses` WRITE;
/*!40000 ALTER TABLE `communication_email_addresses` DISABLE KEYS */;
INSERT INTO `communication_email_addresses` (`id`, `f_users_id`, `email`, `description`, `visibility`) VALUES (1,1,'test@anghenfil.de','abc1',0),(2,1,'+12 1234567899999990','Festnetz',1),(3,1,'test3@anghenfil.de','abc3',1);
/*!40000 ALTER TABLE `communication_email_addresses` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `communication_phone_numbers`
--
DROP TABLE IF EXISTS `communication_phone_numbers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `communication_phone_numbers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`f_users_id` int(11) NOT NULL,
`country_prefix` int(11) DEFAULT NULL,
`number` bigint(20) NOT NULL,
`description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`visibility` tinyint(4) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `communication_phone_numbers_users_id_fk` (`f_users_id`),
CONSTRAINT `communication_phone_numbers_users_id_fk` FOREIGN KEY (`f_users_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `communication_phone_numbers`
--
LOCK TABLES `communication_phone_numbers` WRITE;
/*!40000 ALTER TABLE `communication_phone_numbers` DISABLE KEYS */;
INSERT INTO `communication_phone_numbers` (`id`, `f_users_id`, `country_prefix`, `number`, `description`, `visibility`) VALUES (1,1,49,15732013570,'Handy Privat',2),(2,1,12,1234567899999990,'Festnetz',1);
/*!40000 ALTER TABLE `communication_phone_numbers` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `driving_licenses_types`
--
DROP TABLE IF EXISTS `driving_licenses_types`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `driving_licenses_types` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `driving_licenses_types`
--
LOCK TABLES `driving_licenses_types` WRITE;
/*!40000 ALTER TABLE `driving_licenses_types` DISABLE KEYS */;
INSERT INTO `driving_licenses_types` (`id`, `name`, `description`) VALUES (1,'B',NULL),(2,'B96',NULL),(3,'BE',NULL),(4,'A1',NULL),(5,'A2',NULL),(6,'A',NULL),(7,'AM',NULL),(8,'C1',NULL),(9,'C1E',NULL),(10,'C',NULL),(11,'CE',NULL),(12,'D1',NULL),(13,'D1E',NULL),(14,'D',NULL),(15,'DE',NULL),(16,'L',NULL),(17,'T',NULL);
/*!40000 ALTER TABLE `driving_licenses_types` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `group_permissions`
--
DROP TABLE IF EXISTS `group_permissions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `group_permissions` (
`f_group_id` int(11) NOT NULL,
`f_permission_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`value` tinyint(1) NOT NULL,
PRIMARY KEY (`f_group_id`,`f_permission_id`),
KEY `group_permissions_permissions_id_fk` (`f_permission_id`),
CONSTRAINT `group_permissions_groups_id_fk` FOREIGN KEY (`f_group_id`) REFERENCES `groups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `group_permissions_permissions_id_fk` FOREIGN KEY (`f_permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `group_permissions`
--
LOCK TABLES `group_permissions` WRITE;
/*!40000 ALTER TABLE `group_permissions` DISABLE KEYS */;
INSERT INTO `group_permissions` (`f_group_id`, `f_permission_id`, `value`) VALUES (1,'*',1),(2,'modules.view.events',1),(2,'modules.view.portal',1);
/*!40000 ALTER TABLE `group_permissions` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `groups`
--
DROP TABLE IF EXISTS `groups`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `groups` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`priority` smallint(6) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `groups`
--
LOCK TABLES `groups` WRITE;
/*!40000 ALTER TABLE `groups` DISABLE KEYS */;
INSERT INTO `groups` (`id`, `name`, `description`, `priority`) VALUES (1,'administrator','Globaler Administrator',0),(2,'user','Standard Benutzer',0);
/*!40000 ALTER TABLE `groups` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `permissions`
--
DROP TABLE IF EXISTS `permissions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `permissions` (
`id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `permissions`
--
LOCK TABLES `permissions` WRITE;
/*!40000 ALTER TABLE `permissions` DISABLE KEYS */;
INSERT INTO `permissions` (`id`, `description`) VALUES ('*',NULL),('modules.*',NULL),('modules.edit.*',NULL),('modules.view.*',NULL),('modules.view.events',NULL),('modules.view.portal',NULL),('modules.view.resources',NULL);
/*!40000 ALTER TABLE `permissions` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user_permissions`
--
DROP TABLE IF EXISTS `user_permissions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_permissions` (
`f_user_id` int(11) NOT NULL,
`f_permission_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`value` tinyint(1) NOT NULL,
PRIMARY KEY (`f_user_id`,`f_permission_id`),
KEY `user_permissions_permissions_id_fk` (`f_permission_id`),
CONSTRAINT `user_permissions_permissions_id_fk` FOREIGN KEY (`f_permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `user_permissions_users_id_fk` FOREIGN KEY (`f_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user_permissions`
--
LOCK TABLES `user_permissions` WRITE;
/*!40000 ALTER TABLE `user_permissions` DISABLE KEYS */;
/*!40000 ALTER TABLE `user_permissions` 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,
`password_hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email` varchar(320) CHARACTER SET utf8 DEFAULT NULL,
`firstname` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`lastname` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`date_of_birth` date DEFAULT NULL,
`birthplace` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`sex` tinyint(1) DEFAULT 0,
`academic_title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`salutation` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`formal_salutation` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`personnel_number` int(11) DEFAULT NULL,
`street` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`street_number` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`postcode` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`place` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`language` varchar(8) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `users_user_personnel_number_uindex` (`personnel_number`),
UNIQUE KEY `users_email_uindex` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='User Table';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `users`
--
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` (`id`, `password_hash`, `email`, `firstname`, `lastname`, `date_of_birth`, `birthplace`, `sex`, `academic_title`, `salutation`, `formal_salutation`, `personnel_number`, `street`, `street_number`, `postcode`, `place`, `language`) VALUES (1,'$argon2i$v=19$m=4096,t=3,p=1$aG83Qmt0eG93T0cwaVlycEZGUlR2cWZmcUwwNmIw$AgnYCSS+Ueg5hzYSRCd8svDSI7TX9YMbn4DCRZxJlF8','max@mustermann.de','Max','Mustermann','1988-01-02','Berlin',1,'','Lieber','Herr',21,'Musterstr.','20','12345','Berlin',NULL);
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `users_groups`
--
DROP TABLE IF EXISTS `users_groups`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users_groups` (
`f_user_id` int(11) NOT NULL,
`f_group_id` int(11) NOT NULL,
PRIMARY KEY (`f_user_id`,`f_group_id`),
KEY `users_groups_groups_id_fk` (`f_group_id`),
CONSTRAINT `users_groups_groups_id_fk` FOREIGN KEY (`f_group_id`) REFERENCES `groups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `users_groups_users_id_fk` FOREIGN KEY (`f_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `users_groups`
--
LOCK TABLES `users_groups` WRITE;
/*!40000 ALTER TABLE `users_groups` DISABLE KEYS */;
INSERT INTO `users_groups` (`f_user_id`, `f_group_id`) VALUES (1,1),(1,2);
/*!40000 ALTER TABLE `users_groups` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `users_licenses`
--
DROP TABLE IF EXISTS `users_licenses`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users_licenses` (
`f_user_id` int(11) NOT NULL,
`f_driving_license_type` int(11) DEFAULT NULL,
PRIMARY KEY (`f_user_id`),
KEY `f_driving_license_type` (`f_driving_license_type`),
CONSTRAINT `f_driving_license_type` FOREIGN KEY (`f_driving_license_type`) REFERENCES `driving_licenses_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `f_user_id` FOREIGN KEY (`f_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `users_licenses`
--
LOCK TABLES `users_licenses` WRITE;
/*!40000 ALTER TABLE `users_licenses` DISABLE KEYS */;
/*!40000 ALTER TABLE `users_licenses` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `vehicles`
--
DROP TABLE IF EXISTS `vehicles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `vehicles` (
`id` int(11) NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`type` tinyint(1) NOT NULL DEFAULT 0,
`identifier` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `vehicles`
--
LOCK TABLES `vehicles` WRITE;
/*!40000 ALTER TABLE `vehicles` DISABLE KEYS */;
/*!40000 ALTER TABLE `vehicles` 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 2020-01-10 12:56:17

1
lang/de-DE

@ -0,0 +1 @@
navigation_resourcen = Ressourcen

0
src/lang/parse.rs

Loading…
Cancel
Save