ER della Discussione Informata



Inoltre le tabelle

sono collegate 'indirettamente' alla discussione informata in quanto ognuna di queste si può riferire nel proprio campo 'tool' o 'owner' allo strumento infodisc.



SQL delle tabelle:

CREATE TABLE `infodiscs` (
 `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
 `title` VARCHAR(255) NOT NULL,
 `description` TEXT NOT NULL,
 `status` TINYINT UNSIGNED NOT NULL,
 `infodisc_id` INTEGER UNSIGNED NOT NULL,
 `start` DATETIME NOT NULL,
 `end` DATETIME NOT NULL,
 `created` DATETIME NOT NULL,
 `modified` DATETIME NOT NULL,
PRIMARY KEY(`id`)
)
ENGINE = MYISAM;


CREATE TABLE  `infodiscs_posts` (
 `id` int(10) unsigned NOT NULL auto_increment,
 `parent_id` int(10) unsigned NOT NULL default '0',
 `title` text character set latin1 collate latin1_general_ci NOT NULL,
 `body` text character set latin1 collate latin1_general_ci NOT NULL,
 `status` tinyint(3) unsigned NOT NULL default '0',
 `created` datetime NOT NULL default '0000-00-00 00:00:00',
 `modified` datetime NOT NULL default '0000-00-00 00:00:00',
 `infodisc_id` int(10) unsigned NOT NULL default '0',
 `discussion_id` int(10) unsigned NOT NULL default '0',
 `user_id` int(10) unsigned NOT NULL default '0',
 `anonymous_id` int(10) unsigned NOT NULL default '0',
PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=52 DEFAULT CHARSET=latin1;


CREATE TABLE  `users` (
 `id` int(11) NOT NULL auto_increment,
 `username` varchar(255) NOT NULL default '',
 `password` varchar(36) NOT NULL default '',
 `first_name` varchar(255) default '',
 `last_name` varchar(255) default '',
 `email` varchar(255) NOT NULL default '',
 `showemail` tinyint(1) NOT NULL default '0',
 `admin` tinyint(1) NOT NULL default '0',
 `active` tinyint(1) NOT NULL default '0',
 `created` datetime default NULL,
 `modified` datetime default NULL,
PRIMARY KEY  (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `email` (`email`)
) ENGINE=MyISAM


CREATE TABLE IF NOT EXISTS geomap (
  id             INTEGER UNSIGNED  NOT NULL AUTO_INCREMENT,
  label          MEDIUMTEXT        ,
  boundingBox    GEOMETRY          NOT NULL,
  owner          MEDIUMTEXT        NOT NULL,
  owner_id       INTEGER           NOT NULL,
  maptype        MEDIUMTEXT        NOT NULL,
  PRIMARY KEY(id)
) CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=INNODB;