
/*
* metadata
*       MetadataID
*       CatalogID
*       UID
*       TypeID
*       content
*/
CREATE TABLE `metadata` (
  `MetadataID` int(25) NOT NULL auto_increment,
  `CatalogID` int(25) default NULL,
  `UserID` varchar(255) collate utf8_unicode_ci default NULL,
  `TypeID` int(25) default NULL,
  `content` text collate utf8_unicode_ci,
  `created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  `modified` TIMESTAMP DEFAULT 0,
  PRIMARY KEY  (`MetadataID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
/*
CREATE TABLE metadata(
    MetadataID int(25) AUTO_INCREMENT PRIMARY KEY,
    CatalogID int(25),
    UserID varchar(255),
    TypeID int(25),
    content TEXT
) ENGINE=MyISAM CHARACTER set utf8 COLLATE utf8_unicode_ci;
*/
/*
* files
*       fileID
*       MetadataID
*       content
*       content_type
*/
CREATE TABLE files(
    FileID int(25) AUTO_INCREMENT PRIMARY KEY,
    MetadataID int(25),
    Content longblob,
    ContentType char(255),
    created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    modified TIMESTAMP DEFAULT 0
);
/*
* catalogs
*       CatalogID
*       CatalogName
*/
CREATE TABLE catalogs(
    CatalogID int(25) AUTO_INCREMENT PRIMARY KEY,
    CatalogName char(255)
);
/*
* types
*       TypeID
*       ClassName
*/
CREATE TABLE types(
    TypeID int(25) AUTO_INCREMENT PRIMARY KEY,
    ClassName varchar(255),
    NiceName varchar(255)
);
/*
* class File:
*       title
*       description
*/

/*
 *    Populate database
 */

insert into types values(1, 'ee.tlu.htk.waramu.types.Link', 'Link');
insert into types values(2, 'ee.tlu.htk.waramu.types.Reference', 'Reference');

insert into catalogs values (1, 'TLU');
insert into catalogs values (2, 'LeMill');
insert into catalogs values (3, 'test');
