From 31251ffa76cd8197c0299f4abbdd511deb70872a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladimir=20T=C3=A1mara=20Pati=C3=B1o?= Date: Mon, 22 Jan 2024 10:52:47 -0500 Subject: [PATCH] Arregla ruta --- app/views/layouts/application.html.erb | 4 +- db/structure.sql | 312 ++++++++++++++----------- 2 files changed, 182 insertions(+), 134 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 60cd1cd..b0f8cd4 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -83,11 +83,11 @@ <%= opcion_menu 'Colectivos', msip.orgsociales_path, desplegable: true %> <% if session[:capturacaso_acordeon] %> - <%= opcion_menu 'Ficha caso vertical ✓', '/fichacasovertical', + <%= opcion_menu 'Ficha caso vertical ✓', 'fichacasovertical', desplegable: true, id: 'fichacasovertical' %> <% else %> - <%= opcion_menu 'Ficha caso vertical', '/fichacasovertical', + <%= opcion_menu 'Ficha caso vertical', 'fichacasovertical', desplegable: true, id: 'fichacasovertical' %> <% end %> diff --git a/db/structure.sql b/db/structure.sql index 7c1273a..a82c642 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -704,7 +704,7 @@ CREATE VIEW public.cben1 AS subv.victima_id, subv.persona_id, 1 AS npersona, - victima.etnia_id + 'total'::text AS total FROM public.sivel2_gen_caso caso, public.sivel2_gen_victima victima, ( SELECT sivel2_gen_victima.persona_id, @@ -712,7 +712,7 @@ CREATE VIEW public.cben1 AS FROM public.sivel2_gen_victima GROUP BY sivel2_gen_victima.persona_id) subv, public.msip_persona persona - WHERE ((subv.victima_id = victima.id) AND (caso.id = victima.caso_id) AND ((persona.anionac IS NULL) OR (persona.anionac = ANY (ARRAY[1937, 1938, 1939, 1941, 1943, 1944, 1945, 1947, 1948, 1949, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008]))) AND (victima.etnia_id = ANY (ARRAY[2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109])) AND ((((EXTRACT(year FROM caso.fecha))::text || '-'::text) || lpad((EXTRACT(month FROM caso.fecha))::text, 2, '0'::text)) = ANY (ARRAY['2002-01'::text, '2002-02'::text, '2002-03'::text, '2002-04'::text, '2002-05'::text, '2002-06'::text, '2002-07'::text, '2002-08'::text, '2002-09'::text, '2002-10'::text, '2002-11'::text, '2002-12'::text, '2003-01'::text, '2003-02'::text, '2003-03'::text, '2003-04'::text, '2003-05'::text, '2003-06'::text, '2003-07'::text, '2003-08'::text, '2003-09'::text, '2003-10'::text, '2003-11'::text, '2003-12'::text, '2004-01'::text, '2004-02'::text, '2004-03'::text, '2004-04'::text, '2004-05'::text, '2004-06'::text, '2004-07'::text, '2004-08'::text, '2004-09'::text, '2004-10'::text, '2004-11'::text, '2004-12'::text, '2005-01'::text, '2005-02'::text, '2005-03'::text, '2005-04'::text, '2005-05'::text, '2005-06'::text, '2005-07'::text, '2005-08'::text, '2005-09'::text, '2005-10'::text, '2005-11'::text, '2005-12'::text, '2006-01'::text, '2006-02'::text, '2006-03'::text, '2006-04'::text, '2006-05'::text, '2006-06'::text, '2006-07'::text, '2006-08'::text, '2006-09'::text, '2006-10'::text, '2006-11'::text, '2006-12'::text, '2007-01'::text, '2007-02'::text, '2007-03'::text, '2007-04'::text, '2007-05'::text, '2007-06'::text, '2007-07'::text, '2007-08'::text, '2007-09'::text, '2007-10'::text, '2007-11'::text, '2007-12'::text, '2008-01'::text, '2008-02'::text, '2008-03'::text, '2008-04'::text, '2008-05'::text, '2008-06'::text, '2008-07'::text, '2008-08'::text, '2008-09'::text, '2008-10'::text, '2008-11'::text, '2008-12'::text, '2009-01'::text, '2009-02'::text, '2009-03'::text, '2009-04'::text, '2009-05'::text, '2009-06'::text, '2009-07'::text, '2009-08'::text, '2009-09'::text, '2009-10'::text, '2009-11'::text, '2009-12'::text, '2010-01'::text, '2010-02'::text, '2010-03'::text, '2010-04'::text, '2010-05'::text, '2010-06'::text, '2010-07'::text, '2010-08'::text, '2010-09'::text, '2010-10'::text, '2010-11'::text, '2010-12'::text, '2011-01'::text, '2011-02'::text, '2011-03'::text, '2011-04'::text, '2011-05'::text, '2011-06'::text, '2011-07'::text, '2011-08'::text, '2011-09'::text, '2011-10'::text, '2011-11'::text, '2011-12'::text, '2012-01'::text, '2012-02'::text, '2012-03'::text, '2012-04'::text, '2012-05'::text, '2012-06'::text, '2012-07'::text, '2012-08'::text, '2012-09'::text, '2012-10'::text, '2012-11'::text, '2012-12'::text, '2013-01'::text, '2013-02'::text, '2013-03'::text, '2013-04'::text, '2013-05'::text, '2013-06'::text, '2013-07'::text, '2013-08'::text, '2013-09'::text, '2013-10'::text, '2013-11'::text, '2013-12'::text, '2014-01'::text, '2014-02'::text, '2014-03'::text, '2014-04'::text, '2014-05'::text, '2014-06'::text, '2014-07'::text, '2014-08'::text, '2014-09'::text, '2014-10'::text, '2014-11'::text, '2014-12'::text, '2015-01'::text, '2015-02'::text, '2015-03'::text, '2015-04'::text, '2015-05'::text, '2015-06'::text, '2015-07'::text, '2015-08'::text, '2015-09'::text, '2015-10'::text, '2015-11'::text, '2015-12'::text, '2016-01'::text, '2016-02'::text, '2016-03'::text, '2016-04'::text, '2016-05'::text, '2016-06'::text, '2016-12'::text, '2017-01'::text, '2017-02'::text, '2017-03'::text, '2017-04'::text, '2017-05'::text, '2017-06'::text, '2017-07'::text, '2017-08'::text, '2017-09'::text, '2017-10'::text, '2017-11'::text, '2017-12'::text, '2018-01'::text, '2018-02'::text, '2018-03'::text, '2018-04'::text, '2018-05'::text, '2018-06'::text, '2018-07'::text, '2018-08'::text, '2018-09'::text, '2018-10'::text, '2018-11'::text, '2018-12'::text, '2019-01'::text, '2019-02'::text, '2019-03'::text, '2019-04'::text, '2019-05'::text, '2019-06'::text, '2019-07'::text, '2019-08'::text, '2019-09'::text, '2019-10'::text, '2019-11'::text, '2019-12'::text, '2020-01'::text, '2020-02'::text, '2020-03'::text, '2020-04'::text, '2020-05'::text, '2020-06'::text, '2020-07'::text, '2020-08'::text, '2020-09'::text, '2020-10'::text, '2020-11'::text, '2020-12'::text, '2021-01'::text, '2021-02'::text, '2021-03'::text, '2021-04'::text, '2021-05'::text, '2021-06'::text, '2021-07'::text, '2021-08'::text, '2021-09'::text, '2021-10'::text, '2021-11'::text, '2021-12'::text, '2022-01'::text, '2022-02'::text, '2022-03'::text, '2022-04'::text, '2022-05'::text, '2022-06'::text, '2022-07'::text, '2022-08'::text, '2022-09'::text, '2022-10'::text, '2022-11'::text, '2022-12'::text, '2023-01'::text, '2023-02'::text, '2023-03'::text, '216-03'::text])) AND (victima.organizacion_id = ANY (ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118])) AND (victima.profesion_id = ANY (ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116])) AND (victima.rangoedad_id = ANY (ARRAY[1, 2, 3, 4, 5, 6])) AND (victima.sectorsocial_id = ANY (ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123])) AND (persona.sexo = ANY (ARRAY['F'::bpchar, 'M'::bpchar, 'S'::bpchar])) AND (persona.id = victima.persona_id)); + WHERE ((subv.victima_id = victima.id) AND (caso.id = victima.caso_id) AND (persona.id = victima.persona_id)); -- @@ -887,7 +887,7 @@ CREATE VIEW public.cben2 AS cben1.victima_id, cben1.persona_id, cben1.npersona, - cben1.etnia_id, + cben1.total, ubicacion.departamento_id, departamento.deplocal_cod AS departamento_divipola, departamento.nombre AS departamento_nombre, @@ -903,7 +903,109 @@ CREATE VIEW public.cben2 AS LEFT JOIN public.msip_departamento departamento ON ((ubicacion.departamento_id = departamento.id))) LEFT JOIN public.msip_municipio municipio ON ((ubicacion.municipio_id = municipio.id))) LEFT JOIN public.msip_centropoblado centropoblado ON ((ubicacion.centropoblado_id = centropoblado.id))) - GROUP BY cben1.caso_id, cben1.victima_id, cben1.persona_id, cben1.npersona, cben1.etnia_id, ubicacion.departamento_id, departamento.deplocal_cod, departamento.nombre, ubicacion.municipio_id, ((departamento.deplocal_cod * 1000) + municipio.munlocal_cod), municipio.nombre, ubicacion.centropoblado_id, centropoblado.cplocal_cod, centropoblado.nombre; + GROUP BY cben1.caso_id, cben1.victima_id, cben1.persona_id, cben1.npersona, cben1.total, ubicacion.departamento_id, departamento.deplocal_cod, departamento.nombre, ubicacion.municipio_id, ((departamento.deplocal_cod * 1000) + municipio.munlocal_cod), municipio.nombre, ubicacion.centropoblado_id, centropoblado.cplocal_cod, centropoblado.nombre; + + +-- +-- Name: sivel2_gen_acto_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.sivel2_gen_acto_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: sivel2_gen_acto; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.sivel2_gen_acto ( + presponsable_id integer NOT NULL, + categoria_id integer NOT NULL, + persona_id integer NOT NULL, + caso_id integer NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone, + id integer DEFAULT nextval('public.sivel2_gen_acto_id_seq'::regclass) NOT NULL +); + + +-- +-- Name: sivel2_gen_categoria; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.sivel2_gen_categoria ( + id integer NOT NULL, + fechacreacion date DEFAULT CURRENT_DATE NOT NULL, + fechadeshabilitacion date, + pconsolidado_id integer, + contadaen integer, + tipocat character(1) DEFAULT 'I'::bpchar, + nombre character varying(500) COLLATE public.es_co_utf_8, + created_at timestamp without time zone, + updated_at timestamp without time zone, + observaciones character varying(5000), + supracategoria_id integer, + CONSTRAINT categoria_check CHECK (((fechadeshabilitacion IS NULL) OR (fechadeshabilitacion >= fechacreacion))), + CONSTRAINT categoria_tipocat_check CHECK (((tipocat = 'I'::bpchar) OR (tipocat = 'C'::bpchar) OR (tipocat = 'O'::bpchar))) +); + + +-- +-- Name: sivel2_gen_supracategoria_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.sivel2_gen_supracategoria_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: sivel2_gen_supracategoria; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.sivel2_gen_supracategoria ( + codigo integer, + nombre character varying(500) NOT NULL COLLATE public.es_co_utf_8, + fechacreacion date NOT NULL, + fechadeshabilitacion date, + tviolencia_id character varying(1) NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone, + observaciones character varying(5000), + id integer DEFAULT nextval('public.sivel2_gen_supracategoria_id_seq'::regclass) NOT NULL, + CONSTRAINT supracategoria_check CHECK (((fechadeshabilitacion IS NULL) OR (fechadeshabilitacion >= fechacreacion))) +); + + +-- +-- Name: cvt1; Type: VIEW; Schema: public; Owner: - +-- + +CREATE VIEW public.cvt1 AS + SELECT DISTINCT acto.caso_id, + acto.persona_id, + acto.categoria_id, + supracategoria.tviolencia_id, + categoria.nombre AS categoria, + ubicacion.departamento_id, + departamento.deplocal_cod AS departamento_divipola, + departamento.nombre AS departamento_nombre + FROM (((((((public.sivel2_gen_acto acto + JOIN public.sivel2_gen_caso caso ON ((acto.caso_id = caso.id))) + JOIN public.sivel2_gen_categoria categoria ON ((acto.categoria_id = categoria.id))) + JOIN public.sivel2_gen_supracategoria supracategoria ON ((categoria.supracategoria_id = supracategoria.id))) + JOIN public.sivel2_gen_victima victima ON (((victima.persona_id = acto.persona_id) AND (victima.caso_id = caso.id)))) + JOIN public.msip_persona persona ON ((persona.id = acto.persona_id))) + LEFT JOIN public.msip_ubicacion ubicacion ON ((caso.ubicacion_id = ubicacion.id))) + LEFT JOIN public.msip_departamento departamento ON ((ubicacion.departamento_id = departamento.id))) + WHERE (categoria.id = ANY (ARRAY[427, 297, 527, 397, 197, 777, 296, 776, 426, 196, 526, 396, 15, 25, 35, 73, 45, 55, 65, 92, 50, 40, 1110, 1100, 1000, 67, 801, 90, 112, 46, 16, 26, 57, 37, 80, 85, 66, 64, 109, 703, 38, 49, 18, 59, 706, 28, 501, 401, 904, 502, 331, 231, 17, 402, 705, 62, 906, 104, 107, 713, 101, 76, 302, 21, 11, 27, 102, 3010, 902, 3000, 903, 34, 103, 24, 14, 301, 30, 10, 20, 522, 192, 422, 772, 292, 392, 63, 93, 910, 395, 195, 425, 775, 295, 525, 714, 78, 424, 774, 524, 394, 194, 294, 89, 105, 905, 86, 701, 2000, 211, 111, 68, 113, 114, 108, 141, 341, 241, 715, 704, 702, 23, 53, 13, 43, 33, 88, 98, 115, 84, 709, 711, 707, 708, 710, 87, 97, 717, 917, 716, 916, 106, 110, 117, 91, 95, 718, 773, 393, 193, 523, 293, 423, 48, 58, 75, 116, 69, 41, 74, 47, 56, 36, 22, 72, 12, 118, 521, 191, 421, 771, 291, 391, 39, 520, 29, 19, 77, 420, 712])); -- @@ -2831,33 +2933,6 @@ CREATE SEQUENCE public.sivel2_gen_actividadoficio_id_seq ALTER SEQUENCE public.sivel2_gen_actividadoficio_id_seq OWNED BY public.sivel2_gen_actividadoficio.id; --- --- Name: sivel2_gen_acto_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.sivel2_gen_acto_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: sivel2_gen_acto; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.sivel2_gen_acto ( - presponsable_id integer NOT NULL, - categoria_id integer NOT NULL, - persona_id integer NOT NULL, - caso_id integer NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone, - id integer DEFAULT nextval('public.sivel2_gen_acto_id_seq'::regclass) NOT NULL -); - - -- -- Name: sivel2_gen_actocolectivo_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- @@ -3200,27 +3275,6 @@ CREATE TABLE public.sivel2_gen_caso_usuario ( ); --- --- Name: sivel2_gen_categoria; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.sivel2_gen_categoria ( - id integer NOT NULL, - fechacreacion date DEFAULT CURRENT_DATE NOT NULL, - fechadeshabilitacion date, - pconsolidado_id integer, - contadaen integer, - tipocat character(1) DEFAULT 'I'::bpchar, - nombre character varying(500) COLLATE public.es_co_utf_8, - created_at timestamp without time zone, - updated_at timestamp without time zone, - observaciones character varying(5000), - supracategoria_id integer, - CONSTRAINT categoria_check CHECK (((fechadeshabilitacion IS NULL) OR (fechadeshabilitacion >= fechacreacion))), - CONSTRAINT categoria_tipocat_check CHECK (((tipocat = 'I'::bpchar) OR (tipocat = 'C'::bpchar) OR (tipocat = 'O'::bpchar))) -); - - -- -- Name: sivel2_gen_combatiente; Type: TABLE; Schema: public; Owner: - -- @@ -3294,36 +3348,6 @@ CREATE TABLE public.sivel2_gen_presponsable ( ); --- --- Name: sivel2_gen_supracategoria_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.sivel2_gen_supracategoria_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: sivel2_gen_supracategoria; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.sivel2_gen_supracategoria ( - codigo integer, - nombre character varying(500) NOT NULL COLLATE public.es_co_utf_8, - fechacreacion date NOT NULL, - fechadeshabilitacion date, - tviolencia_id character varying(1) NOT NULL, - created_at timestamp without time zone, - updated_at timestamp without time zone, - observaciones character varying(5000), - id integer DEFAULT nextval('public.sivel2_gen_supracategoria_id_seq'::regclass) NOT NULL, - CONSTRAINT supracategoria_check CHECK (((fechadeshabilitacion IS NULL) OR (fechadeshabilitacion >= fechacreacion))) -); - - -- -- Name: sivel2_gen_conscaso1; Type: VIEW; Schema: public; Owner: - -- @@ -3679,6 +3703,80 @@ CREATE TABLE public.sivel2_gen_iglesia ( ); +-- +-- Name: usuario_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.usuario_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: usuario; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.usuario ( + nusuario character varying(15) NOT NULL, + nombre character varying(50) COLLATE public.es_co_utf_8, + descripcion character varying(50), + rol integer DEFAULT 4, + password character varying(64) DEFAULT ''::character varying, + idioma character varying(6) DEFAULT 'es_CO'::character varying NOT NULL, + id integer DEFAULT nextval('public.usuario_id_seq'::regclass) NOT NULL, + fechacreacion date DEFAULT CURRENT_DATE NOT NULL, + fechadeshabilitacion date, + email character varying(255) DEFAULT ''::character varying NOT NULL, + encrypted_password character varying(255) DEFAULT ''::character varying NOT NULL, + sign_in_count integer DEFAULT 0 NOT NULL, + failed_attempts integer, + unlock_token character varying(64), + locked_at timestamp without time zone, + reset_password_token character varying, + reset_password_sent_at timestamp without time zone, + remember_created_at timestamp without time zone, + current_sign_in_at timestamp without time zone, + last_sign_in_at timestamp without time zone, + current_sign_in_ip character varying, + last_sign_in_ip character varying, + created_at timestamp without time zone, + updated_at timestamp without time zone, + oficina_id integer, + tema_id integer, + observadorffechaini date, + observadorffechafin date, + CONSTRAINT usuario_check CHECK (((fechadeshabilitacion IS NULL) OR (fechadeshabilitacion >= fechacreacion))), + CONSTRAINT usuario_rol_check CHECK ((rol >= 1)) +); + + +-- +-- Name: sivel2_gen_iniciador; Type: VIEW; Schema: public; Owner: - +-- + +CREATE VIEW public.sivel2_gen_iniciador AS + SELECT s3.caso_id, + s3.fechainicio, + s3.usuario_id, + usuario.nusuario + FROM public.usuario, + ( SELECT s2.caso_id, + s2.fechainicio, + min(s2.usuario_id) AS usuario_id + FROM public.sivel2_gen_caso_usuario s2, + ( SELECT f1.caso_id, + min(f1.fechainicio) AS m + FROM public.sivel2_gen_caso_usuario f1 + GROUP BY f1.caso_id) c + WHERE ((s2.caso_id = c.caso_id) AND (s2.fechainicio = c.m)) + GROUP BY s2.caso_id, s2.fechainicio + ORDER BY s2.caso_id, s2.fechainicio) s3 + WHERE (usuario.id = s3.usuario_id); + + -- -- Name: sivel2_gen_intervalo_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- @@ -4201,56 +4299,6 @@ CREATE SEQUENCE public.tipoamenaza_id_seq ALTER SEQUENCE public.tipoamenaza_id_seq OWNED BY public.tipoamenaza.id; --- --- Name: usuario_id_seq; Type: SEQUENCE; Schema: public; Owner: - --- - -CREATE SEQUENCE public.usuario_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - --- --- Name: usuario; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.usuario ( - nusuario character varying(15) NOT NULL, - nombre character varying(50) COLLATE public.es_co_utf_8, - descripcion character varying(50), - rol integer DEFAULT 4, - password character varying(64) DEFAULT ''::character varying, - idioma character varying(6) DEFAULT 'es_CO'::character varying NOT NULL, - id integer DEFAULT nextval('public.usuario_id_seq'::regclass) NOT NULL, - fechacreacion date DEFAULT CURRENT_DATE NOT NULL, - fechadeshabilitacion date, - email character varying(255) DEFAULT ''::character varying NOT NULL, - encrypted_password character varying(255) DEFAULT ''::character varying NOT NULL, - sign_in_count integer DEFAULT 0 NOT NULL, - failed_attempts integer, - unlock_token character varying(64), - locked_at timestamp without time zone, - reset_password_token character varying, - reset_password_sent_at timestamp without time zone, - remember_created_at timestamp without time zone, - current_sign_in_at timestamp without time zone, - last_sign_in_at timestamp without time zone, - current_sign_in_ip character varying, - last_sign_in_ip character varying, - created_at timestamp without time zone, - updated_at timestamp without time zone, - oficina_id integer, - tema_id integer, - observadorffechaini date, - observadorffechafin date, - CONSTRAINT usuario_check CHECK (((fechadeshabilitacion IS NULL) OR (fechadeshabilitacion >= fechacreacion))), - CONSTRAINT usuario_rol_check CHECK ((rol >= 1)) -); - - -- -- Name: victimacoldef; Type: TABLE; Schema: public; Owner: - --