Commit 2d62653f authored by Georgios Tsakalos's avatar Georgios Tsakalos
Browse files

update school schema

parent f1362d5d
...@@ -242,12 +242,12 @@ INSERT INTO `itemcategory` VALUES (8,'ACCESS POINT'),(26,'LAPTOP'),(7,'MEDIA CON ...@@ -242,12 +242,12 @@ INSERT INTO `itemcategory` VALUES (8,'ACCESS POINT'),(26,'LAPTOP'),(7,'MEDIA CON
UNLOCK TABLES; UNLOCK TABLES;
-- --
-- Table structure for table `course` -- Table structure for table `lesson`
-- --
/*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `course` ( CREATE TABLE `lesson` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT, `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
...@@ -263,42 +263,43 @@ DROP TABLE IF EXISTS `lab`; ...@@ -263,42 +263,43 @@ DROP TABLE IF EXISTS `lab`;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lab` ( CREATE TABLE `lab` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT, `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`school_id` int(11) unsigned NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `type` int(11) unsigned DEFAULT NULL,
`type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `area` int(11) unsigned DEFAULT NULL,
`area` int(11) unsigned NOT NULL, `use_ext_program` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`attachment` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`use_in_program` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `use_in_program` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`use_ext_school` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `attachment` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`has_network`varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `has_network` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`has_server` tinyint(1) unsigned DEFAULT '0', `has_server` tinyint(1) unsigned DEFAULT NULL,
`responsible` int(11) unsigned DEFAULT NULL, `school_id` int(11) unsigned DEFAULT NULL,
`teacher_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `school_id` (`school_id`), KEY `index_foreignkey_lab_school` (`school_id`),
KEY `index_foreignkey_lab_teacher` (`responsible`), KEY `index_foreignkey_lab_teacher` (`teacher_id`),
CONSTRAINT `c_fk_lab_responsible` FOREIGN KEY (`responsible`) REFERENCES `teacher` (`id`), CONSTRAINT `c_fk_lab_school_id` FOREIGN KEY (`school_id`) REFERENCES `school` (`id`) ON DELETE SET NULL ON UPDATE SET NULL
CONSTRAINT `lab_ibfk_1` FOREIGN KEY (`school_id`) REFERENCES `school` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
-- Table structure for table `course_lab` -- Table structure for table `lesson_lab`
-- --
/*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `course_lab` (
CREATE TABLE `lab_lesson` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT, `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`course_id` int(11) unsigned DEFAULT NULL, `lesson_id` int(11) unsigned DEFAULT NULL,
`lab_id` int(11) unsigned DEFAULT NULL, `lab_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `UQ_5dc8c5a0ea81087a9c594a364e698c3295024b75` (`course_id`,`lab_id`), UNIQUE KEY `UQ_82ac3a020f1d21984f224331fbd99880f89b2e71` (`lab_id`,`lesson_id`),
KEY `index_foreignkey_course_lab_course` (`course_id`), KEY `index_foreignkey_lab_lesson_lesson` (`lesson_id`),
KEY `index_foreignkey_course_lab_lab` (`lab_id`), KEY `index_foreignkey_lab_lesson_lab` (`lab_id`),
CONSTRAINT `c_fk_course_lab_lab_id` FOREIGN KEY (`lab_id`) REFERENCES `lab` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `c_fk_lab_lesson_lab_id` FOREIGN KEY (`lab_id`) REFERENCES `lab` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `c_fk_course_lab_course_id` FOREIGN KEY (`course_id`) REFERENCES `course` (`id`) ON DELETE CASCADE ON UPDATE CASCADE CONSTRAINT `c_fk_lab_lesson_lesson_id` FOREIGN KEY (`lesson_id`) REFERENCES `lesson` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment