Agregados ejemplares de libros al sistema
This commit is contained in:
22
script.sql
22
script.sql
@@ -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
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user