
  -- script para crear la attendance_log_atl donde se guardara el log de sistencia
CREATE TABLE `attendance_log_atl` (
  `serial_atl` INT(11) NOT NULL AUTO_INCREMENT,
  `serial_usr` INT NULL,
  `serial_scd` INT(11) NULL DEFAULT NULL,
  `serial_sbp` INT NULL,
  `serial_sbc` INT NULL,
  `serial_osb` INT NULL,
  `date_atl` DATETIME NULL DEFAULT NULL,
  `status_atl` ENUM('ACTIVE', 'INACTIVE') NULL DEFAULT 'ACTIVE',
  PRIMARY KEY (`serial_atl`),
  INDEX `fk_user_atl_idx` (`serial_usr` ASC),
  INDEX `fk_schedule_atl_idx` (`serial_scd` ASC),
  INDEX `fk_subperiod_atl_idx` (`serial_sbp` ASC),
  INDEX `fk_sbc_atl_idx` (`serial_sbc` ASC),
  INDEX `fk_osb_atl_idx` (`serial_osb` ASC),
  CONSTRAINT `fk_user_atl`
    FOREIGN KEY (`serial_usr`)
    REFERENCES `user` (`serial_usr`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_schedule_atl`
    FOREIGN KEY (`serial_scd`)
    REFERENCES `schedule` (`serial_scd`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_subperiod_atl`
    FOREIGN KEY (`serial_sbp`)
    REFERENCES `subperiod` (`serial_sbp`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_sbc_atl`
    FOREIGN KEY (`serial_sbc`)
    REFERENCES `subject_course` (`serial_sbc`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_osb_atl`
    FOREIGN KEY (`serial_osb`)
    REFERENCES `optional_subject` (`serial_osb`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION);

-- para cambiar el primer registro de observaciones por 'OTRO'
INSERT INTO `observation` (`serial_scy`, `observation_osb`, `status_osb`) VALUES ('1', 'pivote', 'ACTIVE');
UPDATE `attendance` SET `serial_obs`='7' WHERE  `serial_obs`='6';
UPDATE `attendance` SET `serial_obs`='6' WHERE  `serial_obs`='1';
UPDATE `attendance` SET `serial_obs`='1' WHERE  `serial_obs`='7';

DELETE FROM `observation` WHERE `serial_obs`='7';
UPDATE `observation` SET `observation_osb`='OTRO' WHERE `serial_obs`='1';
UPDATE `observation` SET `observation_osb`='ENFERMERIA' WHERE `serial_obs`='6';


-- PROCESO Y PERMISO PARA VER EL REPORTE DE ASISTENCIA
INSERT INTO `process` (`serial_prc`, `prc_serial_prc`, `name_prc`, `link_prc`, `weight_prc`, `status_prc`) VALUES ('483', '365', 'Reportes', '#', '2', 'LOCKABLE');
INSERT INTO `process` (`serial_prc`, `prc_serial_prc`, `name_prc`, `link_prc`, `weight_prc`, `status_prc`) VALUES ('484', '483', 'Seguimiento Reporte asistencia', 'laravel/public/attendanceReport', '2', 'LOCKABLE');
 
insert into allowed_pages_by_process values('484','attendancereportcontroller@getindex');
insert into allowed_pages_by_process values('484','attendancereportcontroller@getprofiles');
insert into allowed_pages_by_process values('484','attendancereportcontroller@getsections');
insert into allowed_pages_by_process values('484','attendancereportcontroller@getlevels');
insert into allowed_pages_by_process values('484','attendancereportcontroller@getperiods');
insert into allowed_pages_by_process values('484','attendancereportcontroller@getsubperiods');
insert into allowed_pages_by_process values('484','attendancereportcontroller@postattendancereport');

