source: trunk/de.ugoe.cs.swe.memos/schema/memos-mysql.sql @ 6

Last change on this file since 6 was 3, checked in by zeiss, 15 years ago
File size: 3.1 KB
Line 
1-- phpMyAdmin SQL Dump
2-- version 3.2.2
3-- http://www.phpmyadmin.net
4--
5-- Host: localhost
6-- Erstellungszeit: 19. Oktober 2009 um 10:38
7-- Server Version: 5.0.51
8-- PHP-Version: 5.2.6-1+lenny3
9
10SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
11
12
13/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
14/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
15/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
16/*!40101 SET NAMES utf8 */;
17
18--
19-- Datenbank: `xprakt2`
20--
21
22-- --------------------------------------------------------
23
24--
25-- Tabellenstruktur fÃŒr Tabelle `Categories`
26--
27
28CREATE TABLE IF NOT EXISTS `Categories` (
29  `ID` int(10) unsigned NOT NULL auto_increment COMMENT 'unique primary key for Categories',
30  `Parent` int(10) unsigned default NULL COMMENT 'optional reference to parent category',
31  `Name` varchar(255) NOT NULL COMMENT 'non unique categorie description',
32  PRIMARY KEY  (`ID`),
33  KEY `FK_Parent` (`Parent`)
34) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC COMMENT='Stores memo Categories' AUTO_INCREMENT=776 ;
35
36-- --------------------------------------------------------
37
38--
39-- Tabellenstruktur fÃŒr Tabelle `Files`
40--
41
42CREATE TABLE IF NOT EXISTS `Files` (
43  `ID` int(10) unsigned NOT NULL auto_increment,
44  `Name` varchar(700) NOT NULL,
45  `Memo` int(10) unsigned NOT NULL,
46  `Content` longblob NOT NULL,
47  PRIMARY KEY  (`ID`),
48  KEY `FK_Memo` (`Memo`)
49) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC AUTO_INCREMENT=96 ;
50
51-- --------------------------------------------------------
52
53--
54-- Tabellenstruktur fÃŒr Tabelle `Memos`
55--
56
57CREATE TABLE IF NOT EXISTS `Memos` (
58  `ID` int(10) unsigned NOT NULL auto_increment,
59  `Title` varchar(255) default NULL,
60  `Content` text,
61  `Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
62  `Category` int(10) unsigned default NULL,
63  `LockedBy` varchar(255) default NULL,
64  `Author` varchar(255) NOT NULL,
65  `Draft` tinyint(1) NOT NULL,
66  `LockedAt` timestamp NULL default NULL,
67  PRIMARY KEY  (`ID`),
68  KEY `FK_Categories` (`Category`)
69) ENGINE=InnoDB  DEFAULT CHARSET=latin1 COMMENT='Stores individual Memos' AUTO_INCREMENT=642 ;
70
71-- --------------------------------------------------------
72
73--
74-- Tabellenstruktur fÃŒr Tabelle `Tagging`
75--
76
77CREATE TABLE IF NOT EXISTS `Tagging` (
78  `ID` int(10) unsigned NOT NULL auto_increment,
79  `Tag` varchar(255) NOT NULL,
80  `Memo` int(10) unsigned NOT NULL,
81  PRIMARY KEY  (`ID`),
82  UNIQUE KEY `Tag` (`Tag`,`Memo`),
83  KEY `FK_Memo` (`Memo`)
84) ENGINE=InnoDB  DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC COMMENT='Stores every tag for all Memos' AUTO_INCREMENT=490 ;
85
86--
87-- Constraints der exportierten Tabellen
88--
89
90--
91-- Constraints der Tabelle `Categories`
92--
93ALTER TABLE `Categories`
94  ADD CONSTRAINT `FK_Parent` FOREIGN KEY (`Parent`) REFERENCES `Categories` (`ID`);
95
96--
97-- Constraints der Tabelle `Memos`
98--
99ALTER TABLE `Memos`
100  ADD CONSTRAINT `FK_Categories` FOREIGN KEY (`Category`) REFERENCES `Categories` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE;
101
102--
103-- Constraints der Tabelle `Tagging`
104--
105ALTER TABLE `Tagging`
106  ADD CONSTRAINT `FK_Memo` FOREIGN KEY (`Memo`) REFERENCES `Memos` (`ID`) ON DELETE CASCADE ON UPDATE NO ACTION;
Note: See TracBrowser for help on using the repository browser.