Agregados ejemplares de libros al sistema

This commit is contained in:
Daniel Cortés
2019-05-13 19:58:50 -04:00
parent 6ffb2d6b64
commit 0187e71187
15 changed files with 280 additions and 308 deletions

View File

@@ -26,6 +26,7 @@ drop table if exists libro_idioma;
drop table if exists libro_categoria;
drop table if exists libro_autor;
drop table if exists libro;
drop table if exists ejemplar;
drop table if exists editorial;
drop table if exists idioma;
drop table if exists categoria;
@@ -72,15 +73,22 @@ create table idioma
create table libro
(
id int unsigned primary key auto_increment,
serie varchar(255) unique not null,
isbn varchar(255) not null,
isbn varchar(255) not null,
titulo varchar(255) default null,
numero_paginas int not null,
precio_referencia int not null,
numero_paginas int not null,
precio_referencia int not null,
ano_publicacion int default null,
editorial_id int unsigned not null,
estado_id int unsigned default 1,
foreign key (editorial_id) references editorial (id) on delete restrict on update cascade,
editorial_id int unsigned not null,
foreign key (editorial_id) references editorial (id) on delete restrict on update cascade
);
create table ejemplar
(
id int unsigned primary key auto_increment,
serie varchar(255) not null,
libro_id int unsigned not null,
estado_id int unsigned default 1,
foreign key (libro_id) references libro (id) on delete restrict on update cascade,
foreign key (estado_id) references estado (id) on delete restrict on update cascade
);