|
The following is a dump file of the table structure of the Recoin
repository as it was used in conjunction with the MySQLRepositoryManager for Recoin 0.3.
It can be used to create the necessary tables for a repository in a MySQL database.
Important: Make sure that the MySQL database supports InnoDB
tables. The MySQLRepositoryManager relies on foreign-key constraints to
delete items from the tables. If these are not enforced by the
database, the repository will become inconsistent.
-- phpMyAdmin SQL Dump
-- version 2.6.0-pl3
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 21, 2005 at 02:37 AM
-- Server version: 4.0.21
-- PHP Version: 5.0.0
--
-- Database: `recoin_repository`
-- --------------------------------------------------------
--
-- Table structure for table `attribute`
--
DROP TABLE IF EXISTS `attribute`;
CREATE TABLE `attribute` (
`component_id` int(11) NOT NULL default '0',
`module_id` int(11) default NULL,
`name` varchar(255) NOT NULL default '',
`value` varchar(255) default NULL,
`input_type` varchar(255) default NULL,
UNIQUE KEY `uidx_component_attribute` (`component_id`,`module_id`,`name`)
) TYPE=InnoDB;
-- --------------------------------------------------------
--
-- Table structure for table `component`
--
DROP TABLE IF EXISTS `component`;
CREATE TABLE `component` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
`description` mediumtext NOT NULL,
`classname` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=InnoDB;
-- --------------------------------------------------------
--
-- Table structure for table `component_to_module`
--
DROP TABLE IF EXISTS `component_to_module`;
CREATE TABLE `component_to_module` (
`component_id` int(11) NOT NULL default '0',
`module_id` int(11) NOT NULL default '0',
PRIMARY KEY (`component_id`,`module_id`),
KEY `idx_component_to_module_module_id` (`module_id`)
) TYPE=InnoDB;
-- --------------------------------------------------------
--
-- Table structure for table `component_to_support`
--
DROP TABLE IF EXISTS `component_to_support`;
CREATE TABLE `component_to_support` (
`component_id` int(11) NOT NULL default '0',
`input_id` int(11) NOT NULL default '0',
`output_id` int(11) default NULL,
KEY `idx_component_to_support_input_id` (`input_id`),
KEY `idx_component_to_support_output_id` (`output_id`),
KEY `uidx_component_to_support` (`component_id`,`input_id`,`output_id`)
) TYPE=InnoDB;
-- --------------------------------------------------------
--
-- Table structure for table `core`
--
DROP TABLE IF EXISTS `core`;
CREATE TABLE `core` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
`description` mediumtext,
PRIMARY KEY (`id`)
) TYPE=InnoDB;
-- --------------------------------------------------------
--
-- Table structure for table `module`
--
DROP TABLE IF EXISTS `module`;
CREATE TABLE `module` (
`id` int(11) NOT NULL auto_increment,
`activate` varchar(5) NOT NULL default 'false',
`name` varchar(255) NOT NULL default '',
`description` mediumtext,
`group_id` int(11) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `idx_module_group_id` (`group_id`)
) TYPE=InnoDB;
-- --------------------------------------------------------
--
-- Table structure for table `module_group`
--
DROP TABLE IF EXISTS `module_group`;
CREATE TABLE `module_group` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
`description` mediumtext,
`core_id` int(11) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `idx_group_core_id` (`core_id`)
) TYPE=InnoDB;
-- --------------------------------------------------------
--
-- Table structure for table `parameter`
--
DROP TABLE IF EXISTS `parameter`;
CREATE TABLE `parameter` (
`component_id` int(11) NOT NULL default '0',
`module_id` int(11) default NULL,
`name` varchar(255) NOT NULL default '',
`value` varchar(255) default NULL,
`input_type` varchar(255) default NULL,
UNIQUE KEY `uidx_component_parameter` (`component_id`,`name`,`module_id`),
KEY `idx_parameter_component_id` (`component_id`),
KEY `idx_parameter_module_id` (`module_id`)
) TYPE=InnoDB;
-- --------------------------------------------------------
--
-- Table structure for table `support`
--
DROP TABLE IF EXISTS `support`;
CREATE TABLE `support` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
`description` mediumtext,
`classname` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`),
UNIQUE KEY `uidx_support_classname` (`classname`)
) TYPE=InnoDB;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `attribute`
--
ALTER TABLE `attribute`
ADD CONSTRAINT `0_1595` FOREIGN KEY (`component_id`) REFERENCES
`component` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `component_to_module`
--
ALTER TABLE `component_to_module`
ADD CONSTRAINT `0_1588` FOREIGN KEY (`component_id`) REFERENCES
`component` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `0_1590` FOREIGN KEY (`module_id`) REFERENCES
`module` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `component_to_support`
--
ALTER TABLE `component_to_support`
ADD CONSTRAINT `0_1627` FOREIGN KEY (`component_id`) REFERENCES
`component` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `0_1629` FOREIGN KEY (`input_id`) REFERENCES
`support` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `0_1631` FOREIGN KEY (`output_id`) REFERENCES
`support` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `module`
--
ALTER TABLE `module`
ADD CONSTRAINT `0_1574` FOREIGN KEY (`group_id`) REFERENCES
`module_group` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `module_group`
--
ALTER TABLE `module_group`
ADD CONSTRAINT `0_1570` FOREIGN KEY (`core_id`) REFERENCES
`core` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `parameter`
--
ALTER TABLE `parameter`
ADD CONSTRAINT `parameter_ibfk_3` FOREIGN KEY (`component_id`)
REFERENCES `component` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `parameter_ibfk_4` FOREIGN KEY (`module_id`)
REFERENCES `module` (`id`) ON DELETE CASCADE;
|