Mas validaciones
This commit is contained in:
@@ -7,8 +7,6 @@ drop view if exists bodega_actual cascade;
|
||||
|
||||
drop table if exists usuarios_restaurantes cascade;
|
||||
drop table if exists productores cascade;
|
||||
drop table if exists recaudadores cascade;
|
||||
drop table if exists administradores cascade;
|
||||
drop table if exists recetas cascade;
|
||||
drop table if exists facturas cascade;
|
||||
drop table if exists compra_ingredientes cascade;
|
||||
@@ -23,7 +21,6 @@ drop table if exists productos cascade;
|
||||
drop table if exists categorias cascade;
|
||||
drop table if exists zonas_produccion cascade;
|
||||
drop table if exists ventas cascade;
|
||||
drop table if exists meseros cascade;
|
||||
drop table if exists usuarios cascade;
|
||||
drop table if exists canales_venta cascade;
|
||||
drop table if exists sectores cascade;
|
||||
@@ -92,33 +89,6 @@ create table productores
|
||||
deleted_at timestamptz
|
||||
);
|
||||
|
||||
create table recaudadores
|
||||
(
|
||||
id uuid primary key default gen_random_uuid(),
|
||||
usuario_id uuid references usuarios,
|
||||
created_at timestamptz not null default current_timestamp,
|
||||
updated_at timestamptz not null default current_timestamp,
|
||||
deleted_at timestamptz
|
||||
);
|
||||
|
||||
create table meseros
|
||||
(
|
||||
id uuid primary key default gen_random_uuid(),
|
||||
usuario_id uuid references usuarios,
|
||||
created_at timestamptz not null default current_timestamp,
|
||||
updated_at timestamptz not null default current_timestamp,
|
||||
deleted_at timestamptz
|
||||
);
|
||||
|
||||
create table administradores
|
||||
(
|
||||
id uuid primary key default gen_random_uuid(),
|
||||
usuario_id uuid references usuarios,
|
||||
created_at timestamptz not null default current_timestamp,
|
||||
updated_at timestamptz not null default current_timestamp,
|
||||
deleted_at timestamptz
|
||||
);
|
||||
|
||||
create table ingredientes
|
||||
(
|
||||
id uuid primary key default gen_random_uuid(),
|
||||
@@ -277,7 +247,7 @@ create table ventas
|
||||
(
|
||||
id uuid primary key default gen_random_uuid(),
|
||||
tiempo_venta timestamptz,
|
||||
mesero_id uuid references meseros,
|
||||
usuario_id uuid references usuarios,
|
||||
canal_id uuid references canales_venta,
|
||||
restaurante_id uuid references restaurantes,
|
||||
medio_pago_id uuid references medios_pago,
|
||||
@@ -359,9 +329,6 @@ create index categorias_restaurante_id on categorias (restaurante_id);
|
||||
create index zonas_produccion_restaurante_id on zonas_produccion (restaurante_id);
|
||||
create index productores_usuario_id on productores (usuario_id);
|
||||
create index productores_zona_produccion_id on productores (zona_produccion_id);
|
||||
create index recaudadores_usuario_id on recaudadores (usuario_id);
|
||||
create index meseros_usuario_id on meseros (usuario_id);
|
||||
create index administradores_usuario_id on administradores (usuario_id);
|
||||
create index ingredientes_restaurante_id on ingredientes (restaurante_id);
|
||||
create index productos_categoria_id on productos (categoria_id);
|
||||
create index productos_zona_produccion_id on productos (zona_produccion_id);
|
||||
@@ -376,8 +343,8 @@ create index sectores_restaurante_id on sectores (restaurante_id);
|
||||
create index canales_venta_sector_id on canales_venta (sector_id);
|
||||
create index canales_venta_tipo_canal_id on canales_venta (tipo_canal_id);
|
||||
create index canales_venta_restaurante_id on canales_venta (restaurante_id);
|
||||
create index ventas_mesero_id on ventas (mesero_id);
|
||||
create index ventas_canal_id on ventas (canal_id);
|
||||
create index ventas_usuario_id on ventas (usuario_id);
|
||||
create index ventas_restaurante_id on ventas (restaurante_id);
|
||||
create index boletas_electronicas_venta_id on boletas_electronicas (venta_id);
|
||||
create index boletas_electronicas_restaurante_id on boletas_electronicas (restaurante_id);
|
||||
|
||||
Binary file not shown.
1
database/modifications/06-cajas-has-restaurant.sql
Normal file
1
database/modifications/06-cajas-has-restaurant.sql
Normal file
@@ -0,0 +1 @@
|
||||
alter table cajas add column restaurante_id uuid references restaurantes;
|
||||
Reference in New Issue
Block a user