#771: Restructuring aidUSERINPUTLOG table
-------------------------+-----------------
 Reporter:  skaplun      |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  major        |  Milestone:
Component:  BibAuthorID  |    Version:
 Keywords:  uid sql      |
-------------------------+-----------------
 In the current definition of the {{{aidUSERINPUTLOG}}} table:
 {{{

 CREATE TABLE IF NOT EXISTS `aidUSERINPUTLOG` (
   `id` bigint(15) NOT NULL AUTO_INCREMENT,
   `transactionid` bigint(15) NOT NULL,
   `timestamp` datetime NOT NULL,
   `userinfo` varchar(255) NOT NULL,
   `personid` bigint(15) NOT NULL,
   `action` varchar(50) NOT NULL,
   `tag` varchar(50) NOT NULL,
   `value` varchar(200) NOT NULL,
   `comment` text,
   PRIMARY KEY (`id`),
   INDEX `transactionid-b` (`transactionid`),
   INDEX `timestamp-b` (`timestamp`),
   INDEX `userinfo-b` (`userinfo`),
   INDEX `personid-b` (`personid`),
   INDEX `action-b` (`action`),
   INDEX `tag-b` (`tag`),
   INDEX `value-b` (`value`)
 ) ENGINE=MyISAM;
 }}}

 {{{userinfo}}} is structured to be the concatenation of {{{user.id}}} and
 the current IP address.

 This convention is currently sub-optimal as it does not allow to directly
 reference the current user_id via SQL (e.g. to be used in JOINs). Moreover
 in case of merging two user accounts (e.g. because the external
 authentication system has discovered that two users in Invenio were
 actually the same, it is not possible to merge them via a single fast SQL
 query).

 It would be great if {{{userinfo}}} column was instead split between
 {{{id_user}}} column (implicitly matching user.id), and an ip column. The
 {{{id_user}}} column might be left to NULL in case of guests users.

-- 
Ticket URL: <http://invenio-software.org/ticket/771>
Invenio <http://invenio-software.org>

Reply via email to