Open geoff-maddock opened 8 years ago
Revisit this. I'll have to include the type of relation, which i've not implemented anywhere yet.
Not super useful, keep in backlog
Here's what was in my database schema. I'm removing this for now, but will revisit this issue in the future:
relation data relations of objects - not currently used none FI DROP BARE - NO * dupe of relations - DELETED
// Friend, Alias, Founder, Officer, Member, Fan * Might actually be relations instead of relation
relation_attribute no data key values for relation types - template for data? n/a FI KEEP? BARE - NO * not used currently - DELETED
relation_status data statuses for relations n/a n/a KEEP? BARE - YES? * not used currently - DELETED
// Request, Pending, Confirmed, Banned
relation_type data types of relations n/a n/a KEEP? BARE - YES? * not used currently
// User, Entity, Group
relations no data relations of objects - not currently used FCU FI KEEP? BARE - YES? * dupe for relation - pick one?
CREATE TABLE `relation_status` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(16) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
CREATE TABLE `relation_type` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(64) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
CREATE TABLE `relations` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`end_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`relation_type_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `relations_relation_type_index` (`relation_type_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Would need to add to implement this:
entity_user_relation entity_entity_relation
Revisit this to relate entities to other entities - do we need meta data?
Add a method to relate entities to other entities.