Controlador de bodega
This commit is contained in:
@@ -334,8 +334,8 @@ create table bodega_egresos
|
||||
(
|
||||
unidades numeric not null,
|
||||
fecha timestamptz not null,
|
||||
ingrediente_id uuid references ingredientes,
|
||||
restaurante_id uuid references restaurantes,
|
||||
ingrediente_id uuid not null,
|
||||
restaurante_id uuid not null,
|
||||
created_at timestamptz not null default current_timestamp,
|
||||
updated_at timestamptz not null default current_timestamp,
|
||||
deleted_at timestamptz
|
||||
@@ -345,8 +345,8 @@ create table bodega_ingresos
|
||||
(
|
||||
unidades numeric not null,
|
||||
fecha timestamptz not null,
|
||||
ingrediente_id uuid references ingredientes,
|
||||
restaurante_id uuid references restaurantes,
|
||||
ingrediente_id uuid not null,
|
||||
restaurante_id uuid not null,
|
||||
created_at timestamptz not null default current_timestamp,
|
||||
updated_at timestamptz not null default current_timestamp,
|
||||
deleted_at timestamptz
|
||||
|
||||
11
database/modifications/04-remove-references-from-bodega.sql
Normal file
11
database/modifications/04-remove-references-from-bodega.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
alter table bodega_egresos drop constraint bodega_egresos_ingrediente_id_fkey;
|
||||
alter table bodega_egresos drop constraint bodega_egresos_restaurante_id_fkey;
|
||||
|
||||
alter table bodega_ingresos drop constraint bodega_ingresos_ingrediente_id_fkey;
|
||||
alter table bodega_ingresos drop constraint bodega_ingresos_restaurante_id_fkey;
|
||||
|
||||
alter table bodega_ingresos alter column restaurante_id set not null;
|
||||
alter table bodega_ingresos alter column ingrediente_id set not null;
|
||||
|
||||
alter table bodega_egresos alter column restaurante_id set not null;
|
||||
alter table bodega_egresos alter column ingrediente_id set not null;
|
||||
Reference in New Issue
Block a user