-- alter table SHIFT_STUDENT add column CREATED_ON timestamp NOT NULL default CURRENT_TIMESTAMP;

CREATE TABLE SHIFT_ENROLMENT (
  ID_INTERNAL int(11) NOT NULL auto_increment,
  KEY_ROOT_DOMAIN_OBJECT int(11) NOT NULL default '1',
  KEY_SHIFT int(11) NOT NULL default '0',
  KEY_REGISTRATION int(11) NOT NULL default '0',
  CREATED_ON timestamp NOT NULL default CURRENT_TIMESTAMP,
  PRIMARY KEY  (ID_INTERNAL),
  UNIQUE KEY U1 (KEY_SHIFT, KEY_REGISTRATION),
  KEY KEY_STUDENT (KEY_REGISTRATION),
  KEY KEY_SHIFT (KEY_SHIFT)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

select concat('insert into SHIFT_ENROLMENT(KEY_SHIFT,KEY_REGISTRATION) values(',
    KEY_SHIFT, ',', KEY_REGISTRATION, ');') as ""
from SHIFT_STUDENT;

