· 6 years ago · Jul 05, 2019, 12:06 AM
1`if ($this->IsEnum())
2 {
3 // enum size is in the format 'val1','val2',...
4 $this->Size = explode("','", substr($sizesign[0],1,-1) );
5 $this->MaxSize = 0;
6 }
7 else
8 {
9 $this->Size = $sizesign[0];
10 // size may be saved for decimals as "n,n" so we need to convert that to an int
11 $tmp = explode(",",$this->Size);
12 $this->MaxSize = count($tmp) > 1 ? ($tmp[0] + $tmp[1]) : $this->Size;
13 }`
14
15`CREATE TABLE IF NOT EXISTS `mydb`.`professor` (
16`professor_id` INT NOT NULL AUTO_INCREMENT,
17`professor_nome` VARCHAR(45) NOT NULL,
18`professor_dias_disponiveis_semana` SET('SEGUNDA', 'TERÇA', 'QUARTA', 'QUINTA', 'SEXTA') NOT NULL,
19`professor_carga_horaria_semanal` DOUBLE NOT NULL,
20`professor_turnos` SET('MATUTINO', 'VESPERTINO', 'NOTURNO') NOT NULL,
21PRIMARY KEY (`professor_id`))
22ENGINE = InnoDB;`