Creando orden de compra y aceptandolas

Esta por terminar la funcionalidad
This commit is contained in:
Daniel Cortés
2019-07-01 19:28:11 -04:00
parent e211385447
commit 6b4f55d752
30 changed files with 2043 additions and 841 deletions

View File

@@ -32,6 +32,7 @@ drop table if exists cliente_correo;
drop table if exists trabajador_direccion;
drop table if exists trabajador_telefono;
drop table if exists trabajador_correo;
drop table if exists orden_compra;
drop table if exists factura;
drop table if exists boleta;
drop table if exists compra;
@@ -292,6 +293,17 @@ create table boleta
inserted_at timestamp default CURRENT_TIMESTAMP
);
create table orden_compra
(
id int unsigned primary key auto_increment,
estado enum ('En Curso', 'Aceptada', 'Cancelada'),
compra_id int unsigned,
distribuidor_id int unsigned not null,
inserted_at timestamp default CURRENT_TIMESTAMP,
foreign key (distribuidor_id) references distribuidor (id) on delete restrict on update cascade,
foreign key (compra_id) references compra (id) on delete restrict on update cascade
);
create table compra
(
id int unsigned primary key auto_increment,
@@ -329,6 +341,14 @@ create table arriendo
foreign key (cliente_id) references cliente (id) on delete restrict on update cascade
);
create table libro_orden_compra
(
libro_id int unsigned,
orden_compra_id int unsigned,
foreign key (libro_id) references libro (id) on delete restrict on update cascade,
foreign key (orden_compra_id) references orden_compra (id) on delete restrict on update cascade
);
create table ejemplar_compra
(
ejemplar_id int unsigned,