This repository has been archived by the owner on Oct 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb_basismodel.sql
96 lines (75 loc) · 2.32 KB
/
db_basismodel.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
-- phpMyAdmin SQL Dump
-- version 3.3.7deb5build0.10.10.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 11, 2011 at 03:25 PM
-- Server version: 5.1.49
-- PHP Version: 5.3.3-1ubuntu9.3
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `php_ma-jaarboek`
--
-- --------------------------------------------------------
--
-- Table structure for table `leerling`
--
CREATE TABLE IF NOT EXISTS `leerling` (
`leerling_id` int(2) unsigned zerofill NOT NULL COMMENT 'leerlingnummer',
`voornaam` varchar(33) NOT NULL,
`tussenvoegsels` varchar(33) DEFAULT NULL,
`achternaam` varchar(33) NOT NULL,
`richting` int(1) NOT NULL,
`beschrijving` varchar(222) NOT NULL,
`wachtwoord` char(32) CHARACTER SET ascii DEFAULT NULL,
`avatar` varchar(33) NOT NULL,
PRIMARY KEY (`leerling_id`),
KEY `richting` (`richting`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `leerling`
--
-- --------------------------------------------------------
--
-- Table structure for table `project`
--
CREATE TABLE IF NOT EXISTS `project` (
`project_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`leerling_id` int(2) unsigned zerofill NOT NULL,
`naam` varchar(33) NOT NULL,
`beschrijving` varchar(222) NOT NULL,
`image` varchar(33) DEFAULT NULL,
`external_link` varchar(222) DEFAULT NULL,
PRIMARY KEY (`project_id`),
KEY `leerling_id` (`leerling_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `project`
--
-- --------------------------------------------------------
--
-- Table structure for table `projectdata`
--
CREATE TABLE IF NOT EXISTS `projectdata` (
`project_id` int(10) unsigned NOT NULL,
`data_id` int(1) unsigned NOT NULL,
`locatie` varchar(33) NOT NULL,
`mimetype` varchar(33) NOT NULL,
PRIMARY KEY (`project_id`,`data_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `projectdata`
--
--
-- Constraints for dumped tables
--
--
-- Constraints for table `project`
--
ALTER TABLE `project`
ADD CONSTRAINT `project_ibfk_1` FOREIGN KEY (`leerling_id`) REFERENCES `leerling` (`leerling_id`) ON UPDATE CASCADE;
--
-- Constraints for table `projectdata`
--
ALTER TABLE `projectdata`
ADD CONSTRAINT `projectdata_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `project` (`project_id`) ON DELETE CASCADE ON UPDATE CASCADE;