SYNCRO/sql/cr_pelis_tbl.sql
2021-09-12 22:53:35 +02:00

59 lines
1.2 KiB
SQL

# drop the "pelis" table if it exists, then recreate it
DROP TABLE IF EXISTS pelis;
CREATE TABLE pelis
(
# /********************\
#|* Datos Básicos *|
# \********************/
id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
owner SMALLINT,
Genero ENUM( "SIN CLASIFICAR",
"Acción",
"Animación",
"Aventuras",
"Bélica",
"Biografía",
"Catástrofe",
"C.Ficción",
"Fantástico",
"Cine Negro",
"Comedia",
"Dib.Animado",
"Documental",
"Drama",
"Histórica",
"Intriga",
"Musical",
"Melodrama",
"Oeste",
"Terror",
"Picantes"
) DEFAULT "SIN CLASIFICAR",
Status ENUM( "OK",
"Para Alquilar",
"Ripeando",
"Por llegar"
),
Titulo VARCHAR(30) NOT NULL,
FechaRip DATE,
Duracion TIME,
NumCDs SMALLINT DEFAULT '1',
Comentarios TEXT,
Imagen BLOB,
filetype VARCHAR(50),
imgH SMALLINT,
imgW SMALLINT,
# /************************\
#|* CLAVES PK, SK *|
# \************************/
PRIMARY KEY (id),
);
# Cargamos otros datos suministrados por defecto...
# LOAD DATA LOCAL INFILE "pelis.txt" INTO TABLE personas;