CREATE TABLE `students_list` (
  `serial_stl` INT NOT NULL AUTO_INCREMENT,
  `name_stl` VARCHAR(45) NULL,
  `description_stl` TEXT NULL,
  `validation_stl` TEXT NULL,
  `result_stl` TEXT NULL,
  `parameters_stl` TEXT NULL,
  `status_stl` VARCHAR(45) NULL,
  PRIMARY KEY (`serial_stl`));

ALTER TABLE `students_list` 
ADD COLUMN `created_at` DATETIME NULL AFTER `status_stl`,
ADD COLUMN `updated_at` DATETIME NULL AFTER `created_at`;


CREATE TABLE `text_email_students_list` (
  `serial_txs` INT NOT NULL AUTO_INCREMENT,
  `serial_txn` INT NULL,
  `serial_stl` INT NULL,
  `status_txs` ENUM('ACTIVE', 'INACTIVE') NULL DEFAULT 'ACTIVE',
  PRIMARY KEY (`serial_txs`),
  INDEX `fk_txs_txn_idx` (`serial_txn` ASC),
  INDEX `fk_txs_stl_idx` (`serial_stl` ASC),
  CONSTRAINT `fk_txs_txn`
    FOREIGN KEY (`serial_txn`)
    REFERENCES `text_email` (`serial_txn`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_txs_stl`
    FOREIGN KEY (`serial_stl`)
    REFERENCES `students_list` (`serial_stl`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION);

ALTER TABLE `text_email_students_list` 
ADD COLUMN `created_at` DATETIME NULL AFTER `status_txs`,
ADD COLUMN `updated_at` DATETIME NULL AFTER `created_at`;


ALTER TABLE `text_email` 
ADD COLUMN `description_txn` VARCHAR(500) NULL AFTER `alias_txn`,
ADD COLUMN `header_img_txn` VARCHAR(500) NULL AFTER `vars_email_txn`,
ADD COLUMN `footer_img_txn` VARCHAR(500) NULL AFTER `header_img_txn`;


ALTER TABLE `students_list` 
CHANGE COLUMN `name_stl` `name_stl` VARCHAR(250) NULL DEFAULT NULL ,
CHANGE COLUMN `status_stl` `status_stl` ENUM('ACTIVE', 'INACTIVE') NULL DEFAULT NULL ;

insert into allowed_pages_by_process values(865,'textemailcontroller@gettextemail');
insert into allowed_pages_by_process values(865,'textemailcontroller@gettextemailinfo');
insert into allowed_pages_by_process values(865,'textemailcontroller@gettextemailinfodelete');
insert into allowed_pages_by_process values(865,'textemailcontroller@postsave');
insert into allowed_pages_by_process values(865,'textemailcontroller@postsaveimages');

insert into allowed_pages_by_process values(865,'studentlistcontroller@getstudentslist');
insert into allowed_pages_by_process values(865,'studentlistcontroller@getstudentslistinfo');
insert into allowed_pages_by_process values(865,'studentlistcontroller@getstudentslistinfodelete');
insert into allowed_pages_by_process values(865,'studentlistcontroller@postsave');
insert into allowed_pages_by_process values(865,'studentlistcontroller@getstundentslists');

