Ejecuta este SQL en Supabase → SQL Editor para habilitar sesiones de cocción y output de bidones:
-- Sesiones de escalado / cocción
CREATE TABLE IF NOT EXISTS sesiones_escalado (
id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
lote_id uuid REFERENCES lotes_lactarius(id) ON DELETE CASCADE,
fecha date NOT NULL,
tambores_sesion text,
litros_petroleo numeric(8,2),
n_factura text,
horas_proceso numeric(4,1),
responsable text,
observaciones text,
created_at timestamptz DEFAULT now()
);
ALTER TABLE sesiones_escalado ENABLE ROW LEVEL SECURITY;
DROP POLICY IF EXISTS "allow all" ON sesiones_escalado;
CREATE POLICY "allow all" ON sesiones_escalado FOR ALL USING (true) WITH CHECK (true);
-- Bidones de output por calidad
CREATE TABLE IF NOT EXISTS bidones_lactarius (
id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
lote_id uuid REFERENCES lotes_lactarius(id) ON DELETE CASCADE,
calidad text CHECK (calidad IN ('1°','2°','3°','tallos')) NOT NULL,
n_bidones integer NOT NULL,
kg_bidon numeric(6,2) NOT NULL,
kg_total numeric(8,2),
precio_usd numeric(8,2),
created_at timestamptz DEFAULT now()
);
ALTER TABLE bidones_lactarius ENABLE ROW LEVEL SECURITY;
DROP POLICY IF EXISTS "allow all" ON bidones_lactarius;
CREATE POLICY "allow all" ON bidones_lactarius FOR ALL USING (true) WITH CHECK (true);
| Tarja | Fecha | Proveedor | Kg neto | Cajas | Acción |
|---|---|---|---|---|---|
| Cargando... | |||||
Cargando...