Creando orden de compra y aceptandolas
Esta por terminar la funcionalidad
This commit is contained in:
20
create.sql
20
create.sql
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user