CREATE TABLE libdb_relationships ( id CHAR(20) NOT NULL, referer_table VARCHAR(50) NOT NULL, referer_id CHAR(20) NOT NULL, relationship_type_id CHAR(20) NOT NULL, referent_table VARCHAR(50) NOT NULL, referent_id CHAR(20) NOT NULL, INDEX (referer_id,referent_id) ) TYPE=MyISAM; CREATE TABLE libdb_relationships_types ( id CHAR(20) NOT NULL PRIMARY KEY, name VARCHAR(100) NOT NULL, subject VARCHAR(100) NOT NULL, object VARCHAR(100) NOT NULL, description TINYTEXT NOT NULL ) TYPE=MyISAM; INSERT INTO libdb_relationships_types VALUES ( 'EPFxZ1WjoTD2xCT9dm2c', 'Work <=> Work', 'is related to', 'is related to', 'This defines a relationship \(of an indeterminate nature\) between two works.' ); INSERT INTO libdb_relationships_types VALUES ( 'maQE6fKhSdeIejeVuB1h', 'Concept <=> Entity', 'is a concept of', 'has concept', 'This relationships defines the connection between a concept and another entity.' ); INSERT INTO libdb_relationships_types VALUES ( 'RmRHNJZVJgGvYzjDm3a1', 'Object <=> Entity', 'is an object of', 'has object', 'This relationships defines the connection between an object and another entity.' ); INSERT INTO libdb_relationships_types VALUES ( 'P25g2NMfd9lmNpU876gr', 'Place <=> Entity', 'is a place of', 'has place', 'This relationships defines the connection between a place and another entity.' ); INSERT INTO libdb_relationships_types VALUES ( 'A1Bt2vIYQbd7aOdakHGC', 'Event <=> Entity', 'is an event of', 'has event', 'This relationships defines the connection between an event and another entity.' );