--
--

\restrict D0ba9PkpnZJ42iCNbJKQrU7GOlESeU90SS6AGHXjaLmZr86V0w4f8k1DIYBgFju


SELECT pg_catalog.set_config('search_path', '', false);

--
-- Name: activity_id_seq_1; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.activity_id_seq_1
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.activity_id_seq_1 OWNER TO alfabravo_user;



--
-- Name: activity; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.activity (
    id integer DEFAULT nextval('public.activity_id_seq_1'::regclass) NOT NULL,
    user_id integer,
    employee_id integer,
    file character varying(255),
    observation text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    activity_date timestamp(6) without time zone,
    completed boolean,
    question character varying(255),
    type_id integer,
    actions text,
    incidence_id integer,
    office_id integer,
    zone_id integer
);


ALTER TABLE public.activity OWNER TO alfabravo_user;

--
-- Name: activity_log_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.activity_log_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.activity_log_id_seq OWNER TO alfabravo_user;

--
-- Name: activity_log; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.activity_log (
    id bigint DEFAULT nextval('public.activity_log_id_seq'::regclass) NOT NULL,
    log_name character varying(191),
    description text NOT NULL,
    subject_type character varying(191),
    subject_id bigint,
    causer_type character varying(191),
    causer_id bigint,
    properties json,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    batch_uuid text
);


ALTER TABLE public.activity_log OWNER TO alfabravo_user;

--
-- Name: activity_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.activity_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.activity_type_id_seq OWNER TO alfabravo_user;

--
-- Name: activity_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.activity_type (
    id integer DEFAULT nextval('public.activity_type_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.activity_type OWNER TO alfabravo_user;

--
-- Name: agenda_event_id_seq_1; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.agenda_event_id_seq_1
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.agenda_event_id_seq_1 OWNER TO alfabravo_user;

--
-- Name: agenda_event; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.agenda_event (
    id integer DEFAULT nextval('public.agenda_event_id_seq_1'::regclass) NOT NULL,
    name character varying(255),
    description text,
    ubication text,
    color character varying(255),
    fullday boolean,
    start timestamp(6) without time zone,
    "end" timestamp(6) without time zone,
    user_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    remote boolean,
    url character varying(255)
);


ALTER TABLE public.agenda_event OWNER TO alfabravo_user;

--
-- Name: allergy_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.allergy_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.allergy_id_seq OWNER TO alfabravo_user;

--
-- Name: allergy; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.allergy (
    id integer DEFAULT nextval('public.allergy_id_seq'::regclass) NOT NULL,
    name character varying(300),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone,
    description character varying(1000)
);


ALTER TABLE public.allergy OWNER TO alfabravo_user;

--
-- Name: alm_attributes_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.alm_attributes_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.alm_attributes_id_seq OWNER TO alfabravo_user;

--
-- Name: alm_attributes; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.alm_attributes (
    id bigint DEFAULT nextval('public.alm_attributes_id_seq'::regclass) NOT NULL,
    name character varying(191) NOT NULL,
    slug character varying(191) NOT NULL,
    type character varying(191) DEFAULT 'text'::character varying NOT NULL,
    "unique" boolean DEFAULT false NOT NULL,
    required boolean DEFAULT false NOT NULL,
    primary_view boolean DEFAULT false NOT NULL,
    can_request boolean DEFAULT false NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.alm_attributes OWNER TO alfabravo_user;

--
-- Name: alm_attributes_alm_categories_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.alm_attributes_alm_categories_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.alm_attributes_alm_categories_id_seq OWNER TO alfabravo_user;

--
-- Name: alm_attributes_alm_categories; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.alm_attributes_alm_categories (
    id bigint DEFAULT nextval('public.alm_attributes_alm_categories_id_seq'::regclass) NOT NULL,
    alm_attributes_id bigint NOT NULL,
    alm_categories_id bigint NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    order_item integer
);


ALTER TABLE public.alm_attributes_alm_categories OWNER TO alfabravo_user;

--
-- Name: alm_attributes_alm_products_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.alm_attributes_alm_products_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.alm_attributes_alm_products_id_seq OWNER TO alfabravo_user;

--
-- Name: alm_attributes_alm_products; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.alm_attributes_alm_products (
    id bigint DEFAULT nextval('public.alm_attributes_alm_products_id_seq'::regclass) NOT NULL,
    alm_attributes_id bigint NOT NULL,
    alm_product_id bigint NOT NULL,
    attr_value character varying(255) NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.alm_attributes_alm_products OWNER TO alfabravo_user;

--
-- Name: alm_catalogos_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.alm_catalogos_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.alm_catalogos_id_seq OWNER TO alfabravo_user;

--
-- Name: alm_catalogos; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.alm_catalogos (
    id bigint DEFAULT nextval('public.alm_catalogos_id_seq'::regclass) NOT NULL,
    category_id bigint NOT NULL,
    almacen_id bigint NOT NULL,
    name character varying(191) NOT NULL,
    image character varying(191) NOT NULL,
    code character varying(191) NOT NULL,
    min integer DEFAULT 3,
    max integer DEFAULT 5,
    counter integer DEFAULT 0,
    date_in timestamp(0) without time zone,
    expire_time timestamp(0) without time zone,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.alm_catalogos OWNER TO alfabravo_user;

--
-- Name: alm_categories_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.alm_categories_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.alm_categories_id_seq OWNER TO alfabravo_user;

--
-- Name: alm_categories; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.alm_categories (
    id bigint DEFAULT nextval('public.alm_categories_id_seq'::regclass) NOT NULL,
    category_parent character varying(191) NOT NULL,
    category character varying(191) NOT NULL,
    image character varying(191),
    route character varying(191) NOT NULL,
    groupable boolean DEFAULT false,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    has_inventory boolean DEFAULT false,
    exp_recursive boolean DEFAULT false,
    category_parent_l1 character varying(100),
    category_parent_l1_descr character varying(200)
);


ALTER TABLE public.alm_categories OWNER TO alfabravo_user;

--
-- Name: alm_categories_alm_request_orders_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.alm_categories_alm_request_orders_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.alm_categories_alm_request_orders_id_seq OWNER TO alfabravo_user;

--
-- Name: alm_categories_alm_request_orders; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.alm_categories_alm_request_orders (
    id bigint DEFAULT nextval('public.alm_categories_alm_request_orders_id_seq'::regclass) NOT NULL,
    alm_categories_id bigint NOT NULL,
    alm_request_order_id bigint NOT NULL,
    counter integer DEFAULT 1 NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.alm_categories_alm_request_orders OWNER TO alfabravo_user;

--
-- Name: alm_deliveries_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.alm_deliveries_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.alm_deliveries_id_seq OWNER TO alfabravo_user;

--
-- Name: alm_log_entries_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.alm_log_entries_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.alm_log_entries_id_seq OWNER TO alfabravo_user;

--
-- Name: alm_log_entries; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.alm_log_entries (
    id bigint DEFAULT nextval('public.alm_log_entries_id_seq'::regclass) NOT NULL,
    enterprise_id bigint NOT NULL,
    sales_order_unit_measure_id bigint NOT NULL,
    unit_cost double precision NOT NULL,
    groupable integer NOT NULL,
    counter_in integer NOT NULL,
    date_in timestamp(0) without time zone NOT NULL,
    expire_time character varying(191),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone,
    almacen_id integer
);


ALTER TABLE public.alm_log_entries OWNER TO alfabravo_user;

--
-- Name: alm_log_entry_alm_product_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.alm_log_entry_alm_product_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.alm_log_entry_alm_product_id_seq OWNER TO alfabravo_user;

--
-- Name: alm_log_entry_alm_product; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.alm_log_entry_alm_product (
    id bigint DEFAULT nextval('public.alm_log_entry_alm_product_id_seq'::regclass) NOT NULL,
    alm_log_entry_id bigint NOT NULL,
    alm_product_id bigint NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.alm_log_entry_alm_product OWNER TO alfabravo_user;

--
-- Name: alm_movement_alm_products_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.alm_movement_alm_products_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.alm_movement_alm_products_id_seq OWNER TO alfabravo_user;

--
-- Name: alm_movement_alm_products; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.alm_movement_alm_products (
    id bigint DEFAULT nextval('public.alm_movement_alm_products_id_seq'::regclass) NOT NULL,
    alm_movement_id bigint NOT NULL,
    alm_product_id bigint NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    counter integer DEFAULT 1
);


ALTER TABLE public.alm_movement_alm_products OWNER TO alfabravo_user;

--
-- Name: alm_movements_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.alm_movements_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.alm_movements_id_seq OWNER TO alfabravo_user;

--
-- Name: alm_movements; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.alm_movements (
    id bigint DEFAULT nextval('public.alm_movements_id_seq'::regclass) NOT NULL,
    order_serial character varying(191) NOT NULL,
    details text NOT NULL,
    date timestamp(0) without time zone NOT NULL,
    status character varying(191) DEFAULT 'pendiente'::character varying NOT NULL,
    alm_movementable_id bigint,
    alm_movementable_type character varying(191),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    alm_originable_id integer,
    alm_originable_type character varying(191),
    user_id integer,
    pedido_id integer,
    recibe character varying(191)
);


ALTER TABLE public.alm_movements OWNER TO alfabravo_user;

--
-- Name: alm_orders_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.alm_orders_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.alm_orders_id_seq OWNER TO alfabravo_user;

--
-- Name: alm_orders; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.alm_orders (
    id bigint DEFAULT nextval('public.alm_orders_id_seq'::regclass) NOT NULL,
    provider_id bigint NOT NULL,
    almacen_id bigint NOT NULL,
    order_date timestamp(0) without time zone NOT NULL,
    cost double precision NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.alm_orders OWNER TO alfabravo_user;

--
-- Name: alm_pedidos_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.alm_pedidos_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.alm_pedidos_id_seq OWNER TO alfabravo_user;

--
-- Name: alm_pedidos; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.alm_pedidos (
    id bigint DEFAULT nextval('public.alm_pedidos_id_seq'::regclass) NOT NULL,
    alm_request_order_id bigint NOT NULL,
    enterprise_id bigint NOT NULL,
    details text NOT NULL,
    counter integer DEFAULT 1 NOT NULL,
    modificator character varying(191),
    status character varying(191),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone
);


ALTER TABLE public.alm_pedidos OWNER TO alfabravo_user;

--
-- Name: alm_products_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.alm_products_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.alm_products_id_seq OWNER TO alfabravo_user;

--
-- Name: alm_products; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.alm_products (
    id bigint DEFAULT nextval('public.alm_products_id_seq'::regclass) NOT NULL,
    name character varying(191) NOT NULL,
    category_id bigint NOT NULL,
    traceable boolean DEFAULT false,
    groupable integer DEFAULT 0,
    assignedtoable_type character varying(191),
    assignedtoable_id bigint,
    assignedtoable_details character varying(191),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone,
    enterprise_prefix character varying(5),
    enterprise_inventory character varying(10)
);


ALTER TABLE public.alm_products OWNER TO alfabravo_user;

--
-- Name: alm_request_orders_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.alm_request_orders_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.alm_request_orders_id_seq OWNER TO alfabravo_user;

--
-- Name: alm_request_orders; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.alm_request_orders (
    id bigint DEFAULT nextval('public.alm_request_orders_id_seq'::regclass) NOT NULL,
    employee_id bigint NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    identificador character varying(191) NOT NULL,
    user_id bigint NOT NULL,
    status character varying(191) NOT NULL,
    date_in timestamp(0) without time zone,
    almacen_id integer
);


ALTER TABLE public.alm_request_orders OWNER TO alfabravo_user;

--
-- Name: almacens_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.almacens_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.almacens_id_seq OWNER TO alfabravo_user;

--
-- Name: almacens; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.almacens (
    id bigint DEFAULT nextval('public.almacens_id_seq'::regclass) NOT NULL,
    name character varying(191) NOT NULL,
    code character varying(191) NOT NULL,
    location character varying(191),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.almacens OWNER TO alfabravo_user;

--
-- Name: app_module_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.app_module_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.app_module_id_seq OWNER TO alfabravo_user;

--
-- Name: app_module; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.app_module (
    id integer DEFAULT nextval('public.app_module_id_seq'::regclass) NOT NULL,
    title character varying(255),
    description text,
    is_enabled boolean,
    "position" integer,
    icon character varying,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    belong_to_core boolean
);


ALTER TABLE public.app_module OWNER TO alfabravo_user;

--
-- Name: area_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.area_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.area_id_seq OWNER TO alfabravo_user;

--
-- Name: area; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.area (
    id integer DEFAULT nextval('public.area_id_seq'::regclass) NOT NULL,
    parent_id integer,
    name character varying(300),
    description character varying(1000),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone,
    level integer
);


ALTER TABLE public.area OWNER TO alfabravo_user;

--
-- Name: id_bank_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.id_bank_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.id_bank_seq OWNER TO alfabravo_user;

--
-- Name: bank; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.bank (
    id integer DEFAULT nextval('public.id_bank_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.bank OWNER TO alfabravo_user;

--
-- Name: base_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.base_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.base_id_seq OWNER TO alfabravo_user;

--
-- Name: base; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.base (
    id integer DEFAULT nextval('public.base_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description character varying(500),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    address character varying(255),
    city_id integer,
    cp character varying(255),
    telephone character varying(255),
    movil character varying(255),
    email character varying(255),
    deleted_at timestamp(6) without time zone,
    responsable character varying(300),
    notes text
);


ALTER TABLE public.base OWNER TO alfabravo_user;

--
-- Name: id_bonus_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.id_bonus_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.id_bonus_seq OWNER TO alfabravo_user;

--
-- Name: bonus; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.bonus (
    id integer DEFAULT nextval('public.id_bonus_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    to_client boolean DEFAULT false,
    percent boolean DEFAULT false,
    invalidator character varying(255)
);


ALTER TABLE public.bonus OWNER TO alfabravo_user;

--
-- Name: id_bonus_client_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.id_bonus_client_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.id_bonus_client_seq OWNER TO alfabravo_user;

--
-- Name: bonus_client; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.bonus_client (
    id integer DEFAULT nextval('public.id_bonus_client_seq'::regclass) NOT NULL,
    amount real,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    bonus_id integer,
    client_id integer
);


ALTER TABLE public.bonus_client OWNER TO alfabravo_user;

--
-- Name: bonus_employee_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.bonus_employee_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.bonus_employee_id_seq OWNER TO alfabravo_user;

--
-- Name: bonus_employee; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.bonus_employee (
    id integer DEFAULT nextval('public.bonus_employee_id_seq'::regclass) NOT NULL,
    amount real,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    employee_id integer,
    bonus_id integer,
    description text
);


ALTER TABLE public.bonus_employee OWNER TO alfabravo_user;

--
-- Name: brand_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.brand_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.brand_id_seq OWNER TO alfabravo_user;

--
-- Name: capacitation_responsible_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.capacitation_responsible_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.capacitation_responsible_id_seq OWNER TO alfabravo_user;

--
-- Name: capacitation_responsible; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.capacitation_responsible (
    id integer DEFAULT nextval('public.capacitation_responsible_id_seq'::regclass) NOT NULL,
    name character varying(255),
    user_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.capacitation_responsible OWNER TO alfabravo_user;

--
-- Name: category_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.category_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.category_id_seq OWNER TO alfabravo_user;

--
-- Name: category; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.category (
    id integer DEFAULT nextval('public.category_id_seq'::regclass) NOT NULL,
    name character varying(500),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    slug character varying(500),
    in_home boolean,
    in_menu boolean,
    is_active boolean,
    image character varying(255),
    description text,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.category OWNER TO alfabravo_user;

--
-- Name: chat_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.chat_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.chat_id_seq OWNER TO alfabravo_user;

--
-- Name: chat; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.chat (
    id integer DEFAULT nextval('public.chat_id_seq'::regclass) NOT NULL,
    from_user integer,
    to_user integer,
    text text,
    is_read boolean,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    resources text,
    deleted_by text
);


ALTER TABLE public.chat OWNER TO alfabravo_user;

--
-- Name: citizenship; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.citizenship (
    pais_nac character varying(255),
    gentilicio_nac character varying(255),
    iso_nac character varying(255) NOT NULL
);


ALTER TABLE public.citizenship OWNER TO alfabravo_user;

--
-- Name: city; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.city (
    id integer NOT NULL,
    name character varying(255),
    state_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone
);


ALTER TABLE public.city OWNER TO alfabravo_user;

--
-- Name: client_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.client_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.client_id_seq OWNER TO alfabravo_user;

--
-- Name: client; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.client (
    id integer DEFAULT nextval('public.client_id_seq'::regclass) NOT NULL,
    name character varying(255),
    email character varying(255),
    address text,
    is_fisical boolean,
    is_active boolean,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    postal_code character varying(255),
    deleted_at timestamp(6) without time zone,
    rfc character varying,
    client_group_id integer,
    invoice_days character varying,
    contacts text,
    description text,
    full_name text,
    giro integer,
    type integer,
    type_specific integer,
    origen character varying(255),
    employees_name character varying(512),
    country_id integer,
    state_id integer,
    city_id integer,
    services text,
    patterns_records text,
    sat_access_key text,
    enterprise_id integer,
    desactivated boolean,
    user_upload integer
);


ALTER TABLE public.client OWNER TO alfabravo_user;

--
-- Name: client_agenda_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.client_agenda_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.client_agenda_id_seq OWNER TO alfabravo_user;

--
-- Name: client_agenda; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.client_agenda (
    id integer DEFAULT nextval('public.client_agenda_id_seq'::regclass) NOT NULL,
    name character varying(255),
    client_id integer,
    color character varying(255),
    created_at timestamp(6) without time zone,
    update_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.client_agenda OWNER TO alfabravo_user;

--
-- Name: client_agenda_event_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.client_agenda_event_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.client_agenda_event_id_seq OWNER TO alfabravo_user;

--
-- Name: client_agenda_event; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.client_agenda_event (
    id integer DEFAULT nextval('public.client_agenda_event_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    ubication text,
    color character varying(255),
    fullday boolean,
    start timestamp(6) without time zone,
    "end" timestamp(6) without time zone,
    client_agenda_id integer,
    user_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    remote boolean,
    url character varying(255),
    client_id integer
);


ALTER TABLE public.client_agenda_event OWNER TO alfabravo_user;

--
-- Name: client_conditions_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.client_conditions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.client_conditions_id_seq OWNER TO alfabravo_user;

--
-- Name: client_conditions; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.client_conditions (
    id integer DEFAULT nextval('public.client_conditions_id_seq'::regclass) NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    months character varying(10),
    weeks character varying(10),
    days character varying(10),
    specificday character varying(10),
    infos_service_id integer,
    details character varying(600)
);


ALTER TABLE public.client_conditions OWNER TO alfabravo_user;

--
-- Name: client_cotization_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.client_cotization_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.client_cotization_id_seq OWNER TO alfabravo_user;

--
-- Name: client_cotization; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.client_cotization (
    id integer DEFAULT nextval('public.client_cotization_id_seq'::regclass) NOT NULL,
    service integer,
    vigency_date timestamp without time zone,
    amount real,
    summary text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    client_id integer
);


ALTER TABLE public.client_cotization OWNER TO alfabravo_user;

--
-- Name: client_expense_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.client_expense_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.client_expense_id_seq OWNER TO alfabravo_user;

--
-- Name: client_expense; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.client_expense (
    id integer DEFAULT nextval('public.client_expense_id_seq'::regclass) NOT NULL,
    client_id integer,
    expenses_id integer,
    resource_type_id integer,
    amount real,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    notes text,
    register_date timestamp(0) without time zone,
    expense_photo character varying(255),
    expense_id integer
);


ALTER TABLE public.client_expense OWNER TO alfabravo_user;

--
-- Name: client_files_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.client_files_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.client_files_id_seq OWNER TO alfabravo_user;

--
-- Name: client_files; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.client_files (
    client_files_id integer DEFAULT nextval('public.client_files_id_seq'::regclass) NOT NULL,
    filename character varying(255),
    client_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    file_type_id integer,
    expiration_date timestamp(6) without time zone,
    document_name text,
    user_upload integer
);


ALTER TABLE public.client_files OWNER TO alfabravo_user;

--
-- Name: client_group_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.client_group_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.client_group_id_seq OWNER TO alfabravo_user;

--
-- Name: client_group; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.client_group (
    id integer DEFAULT nextval('public.client_group_id_seq'::regclass) NOT NULL,
    name character varying(255),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(6) without time zone,
    description text,
    parent integer
);


ALTER TABLE public.client_group OWNER TO alfabravo_user;

--
-- Name: client_prospect_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.client_prospect_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.client_prospect_type_id_seq OWNER TO alfabravo_user;

--
-- Name: client_prospect_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.client_prospect_type (
    id integer DEFAULT nextval('public.client_prospect_type_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.client_prospect_type OWNER TO alfabravo_user;

--
-- Name: client_reason_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.client_reason_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.client_reason_id_seq OWNER TO alfabravo_user;

--
-- Name: client_reason; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.client_reason (
    id integer DEFAULT nextval('public.client_reason_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    client_reason_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.client_reason OWNER TO alfabravo_user;

--
-- Name: client_user; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.client_user (
    client_id integer NOT NULL,
    user_id integer NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.client_user OWNER TO alfabravo_user;

--
-- Name: cloud_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.cloud_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cloud_id_seq OWNER TO alfabravo_user;

--
-- Name: cloud; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.cloud (
    id integer DEFAULT nextval('public.cloud_id_seq'::regclass) NOT NULL,
    name character varying(255),
    realname character varying(255),
    path text,
    size integer,
    filetime timestamp(6) without time zone,
    public_file boolean,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    user_id integer,
    type character varying(255),
    metadata text,
    access text,
    public_shared character varying(255),
    cloud_type_document_id integer
);


ALTER TABLE public.cloud OWNER TO alfabravo_user;

--
-- Name: cloud_group_id_seq2; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.cloud_group_id_seq2
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cloud_group_id_seq2 OWNER TO alfabravo_user;

--
-- Name: cloud_group; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.cloud_group (
    id integer DEFAULT nextval('public.cloud_group_id_seq2'::regclass) NOT NULL,
    name character varying(255),
    slug character varying(255),
    user_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    color character varying(255)
);


ALTER TABLE public.cloud_group OWNER TO alfabravo_user;

--
-- Name: cloud_group_member_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.cloud_group_member_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cloud_group_member_id_seq OWNER TO alfabravo_user;

--
-- Name: cloud_group_member; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.cloud_group_member (
    id integer DEFAULT nextval('public.cloud_group_member_id_seq'::regclass) NOT NULL,
    user_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    cloud_group_id integer
);


ALTER TABLE public.cloud_group_member OWNER TO alfabravo_user;

--
-- Name: cloud_iso_9000_id_seq_1; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.cloud_iso_9000_id_seq_1
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cloud_iso_9000_id_seq_1 OWNER TO alfabravo_user;

--
-- Name: cloud_iso_9000; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.cloud_iso_9000 (
    id integer DEFAULT nextval('public.cloud_iso_9000_id_seq_1'::regclass) NOT NULL,
    name character varying(255),
    realname character varying(255),
    path text,
    size integer,
    filetime timestamp(6) without time zone,
    public_file boolean,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    user_id integer,
    type character varying(255),
    metadata text,
    access text,
    public_shared character varying(255),
    cloud_type_document_id integer
);


ALTER TABLE public.cloud_iso_9000 OWNER TO alfabravo_user;

--
-- Name: cloud_item_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.cloud_item_permissions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cloud_item_permissions_id_seq OWNER TO alfabravo_user;

--
-- Name: cloud_item_permissions; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.cloud_item_permissions (
    id integer DEFAULT nextval('public.cloud_item_permissions_id_seq'::regclass) NOT NULL,
    item_id integer,
    model_id integer,
    author_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    permissions integer,
    share_type integer,
    inherit boolean
);


ALTER TABLE public.cloud_item_permissions OWNER TO alfabravo_user;

--
-- Name: cloud_item_share_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.cloud_item_share_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cloud_item_share_id_seq OWNER TO alfabravo_user;

--
-- Name: cloud_item_shared; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.cloud_item_shared (
    id integer DEFAULT nextval('public.cloud_item_share_id_seq'::regclass) NOT NULL,
    item_id integer,
    share_type integer,
    model_id integer,
    author_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    permissions integer,
    start_share_date timestamp without time zone,
    end_share_date timestamp without time zone
);


ALTER TABLE public.cloud_item_shared OWNER TO alfabravo_user;

--
-- Name: cloud_type_document_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.cloud_type_document_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cloud_type_document_id_seq OWNER TO alfabravo_user;

--
-- Name: cloud_type_document; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.cloud_type_document (
    id integer DEFAULT nextval('public.cloud_type_document_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    user_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at time without time zone
);


ALTER TABLE public.cloud_type_document OWNER TO alfabravo_user;

--
-- Name: cloud_type_document_has_item_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.cloud_type_document_has_item_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cloud_type_document_has_item_id_seq OWNER TO alfabravo_user;

--
-- Name: cloud_type_document_has_item; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.cloud_type_document_has_item (
    id integer DEFAULT nextval('public.cloud_type_document_has_item_id_seq'::regclass) NOT NULL,
    cloud_type_document_id integer,
    "position" integer,
    required boolean,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    type_id integer,
    name character varying(255)
);


ALTER TABLE public.cloud_type_document_has_item OWNER TO alfabravo_user;

--
-- Name: contract_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.contract_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.contract_id_seq OWNER TO alfabravo_user;

--
-- Name: cost_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.cost_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.cost_id_seq OWNER TO alfabravo_user;

--
-- Name: cost; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.cost (
    id integer DEFAULT nextval('public.cost_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    user_id integer
);


ALTER TABLE public.cost OWNER TO alfabravo_user;

--
-- Name: country; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.country (
    id integer NOT NULL,
    name character varying(255),
    key character varying(255),
    key_number integer,
    phone_prefix integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone
);


ALTER TABLE public.country OWNER TO alfabravo_user;

--
-- Name: country_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.country_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.country_id_seq OWNER TO alfabravo_user;

--
-- Name: country_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.country_id_seq OWNED BY public.country.id;


--
-- Name: coupon_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.coupon_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.coupon_id_seq OWNER TO alfabravo_user;

--
-- Name: coupon; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.coupon (
    id integer DEFAULT nextval('public.coupon_id_seq'::regclass) NOT NULL,
    code character varying(255),
    description text,
    product_id integer,
    val double precision,
    kind integer,
    started_at timestamp(0) without time zone,
    finished_at timestamp(0) without time zone,
    is_active boolean,
    is_multiple boolean,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.coupon OWNER TO alfabravo_user;

--
-- Name: course_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.course_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.course_id_seq OWNER TO alfabravo_user;

--
-- Name: course; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.course (
    id integer DEFAULT nextval('public.course_id_seq'::regclass) NOT NULL,
    name text,
    modality integer,
    description text,
    trainer integer,
    external_trainer text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    start_date timestamp without time zone,
    ending_date timestamp with time zone
);


ALTER TABLE public.course OWNER TO alfabravo_user;

--
-- Name: course_employee_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.course_employee_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.course_employee_id_seq OWNER TO alfabravo_user;

--
-- Name: course_employee; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.course_employee (
    id integer DEFAULT nextval('public.course_employee_id_seq'::regclass) NOT NULL,
    course_id integer,
    employee_id integer,
    start_date timestamp without time zone,
    evaluation integer,
    observations text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    ending_date timestamp without time zone
);


ALTER TABLE public.course_employee OWNER TO alfabravo_user;

--
-- Name: coverage_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.coverage_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.coverage_id_seq OWNER TO alfabravo_user;

--
-- Name: coverage; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.coverage (
    id integer DEFAULT nextval('public.coverage_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description character varying(500),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.coverage OWNER TO alfabravo_user;

--
-- Name: dia_padre_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.dia_padre_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.dia_padre_id_seq OWNER TO alfabravo_user;

--
-- Name: dia_padre; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.dia_padre (
    id integer DEFAULT nextval('public.dia_padre_id_seq'::regclass) NOT NULL,
    filename text,
    employee_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    message text,
    ofrenda integer
);


ALTER TABLE public.dia_padre OWNER TO alfabravo_user;

--
-- Name: id_discount_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.id_discount_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.id_discount_seq OWNER TO alfabravo_user;

--
-- Name: discount; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.discount (
    id integer DEFAULT nextval('public.id_discount_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    percent boolean DEFAULT false
);


ALTER TABLE public.discount OWNER TO alfabravo_user;

--
-- Name: id_discount_employee_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.id_discount_employee_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.id_discount_employee_seq OWNER TO alfabravo_user;

--
-- Name: discount_employee; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.discount_employee (
    id integer DEFAULT nextval('public.id_discount_employee_seq'::regclass) NOT NULL,
    amount real,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    discount_id integer,
    employee_id integer,
    description text,
    fixed_fee_count integer,
    last_fee_amount real,
    total_amount real,
    user_id integer
);


ALTER TABLE public.discount_employee OWNER TO alfabravo_user;

--
-- Name: document_category_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.document_category_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.document_category_id_seq OWNER TO alfabravo_user;

--
-- Name: document_category; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.document_category (
    id integer DEFAULT nextval('public.document_category_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.document_category OWNER TO alfabravo_user;

--
-- Name: type_document_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.type_document_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.type_document_id_seq OWNER TO alfabravo_user;

--
-- Name: document_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.document_type (
    id integer DEFAULT nextval('public.type_document_id_seq'::regclass) NOT NULL,
    name character varying(255),
    no_document integer,
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    module character varying(255),
    is_required boolean,
    is_public boolean,
    document_category_id integer,
    "position" real,
    user_modified_id integer,
    user_id integer
);


ALTER TABLE public.document_type OWNER TO alfabravo_user;

--
-- Name: employee_seq_id; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_seq_id
    START WITH 4
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.employee_seq_id OWNER TO alfabravo_user;

--
-- Name: employee; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee (
    id integer DEFAULT nextval('public.employee_seq_id'::regclass) NOT NULL,
    personal_id integer,
    employee_contract_id integer,
    code_of_conduct character varying(255),
    employee_letter character varying(255),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    schedule character varying(1000),
    number character varying(255),
    documents text,
    no_payroll boolean,
    default_assistance boolean,
    username text,
    password text,
    direct_superior integer,
    capacitation_responsible integer
);


ALTER TABLE public.employee OWNER TO alfabravo_user;

--
-- Name: employee_asistence; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_asistence (
    id integer NOT NULL,
    employee_id integer,
    attachment character varying(255),
    gps_coordinate character varying(255),
    date_check_in timestamp(6) without time zone,
    status integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    date_check_out timestamp(6) without time zone,
    ubication_id integer,
    client_id integer,
    phone_features character varying(255),
    attachment_check_out character varying(255),
    phone_features_check_out character varying(255),
    status_check_out integer,
    gps_coordinate_check_out character varying(255),
    phone_features_checkout character varying(255),
    user_id integer,
    reason_denied text
);


ALTER TABLE public.employee_asistence OWNER TO alfabravo_user;

--
-- Name: employee_asistence_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_asistence_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.employee_asistence_id_seq OWNER TO alfabravo_user;

--
-- Name: employee_asistence_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.employee_asistence_id_seq OWNED BY public.employee_asistence.id;


--
-- Name: employee_attention_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_attention_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.employee_attention_id_seq OWNER TO alfabravo_user;

--
-- Name: employee_attention; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_attention (
    id integer DEFAULT nextval('public.employee_attention_id_seq'::regclass) NOT NULL,
    employee_id integer,
    type_id integer,
    description text,
    attended_by integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    status smallint,
    dedicated_time integer,
    attended_date timestamp without time zone
);


ALTER TABLE public.employee_attention OWNER TO alfabravo_user;

--
-- Name: employee_attention_status_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_attention_status_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.employee_attention_status_seq OWNER TO alfabravo_user;

--
-- Name: employee_attention_status; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_attention_status (
    id integer DEFAULT nextval('public.employee_attention_status_seq'::regclass) NOT NULL,
    employee_attention_id integer,
    status integer,
    attachment character varying(255),
    observations text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    user_id integer
);


ALTER TABLE public.employee_attention_status OWNER TO alfabravo_user;

--
-- Name: employee_attention_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_attention_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.employee_attention_type_id_seq OWNER TO alfabravo_user;

--
-- Name: employee_attention_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_attention_type (
    id integer DEFAULT nextval('public.employee_attention_type_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.employee_attention_type OWNER TO alfabravo_user;

--
-- Name: employee_bank_data; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_bank_data (
    id integer NOT NULL,
    employee_id integer,
    bank_id integer,
    account_number character varying(255),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    interbank_key character varying(255),
    card_number character varying(255),
    observations character varying(255)
);


ALTER TABLE public.employee_bank_data OWNER TO alfabravo_user;

--
-- Name: employee_bank_data_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_bank_data_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.employee_bank_data_id_seq OWNER TO alfabravo_user;

--
-- Name: employee_bank_data_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.employee_bank_data_id_seq OWNED BY public.employee_bank_data.id;


--
-- Name: employee_discharge_reason_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_discharge_reason_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.employee_discharge_reason_id_seq OWNER TO alfabravo_user;

--
-- Name: employee_discharge_reason; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_discharge_reason (
    id integer DEFAULT nextval('public.employee_discharge_reason_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.employee_discharge_reason OWNER TO alfabravo_user;

--
-- Name: employee_eventual_payment_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_eventual_payment_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.employee_eventual_payment_id_seq OWNER TO alfabravo_user;

--
-- Name: employee_eventual_payment; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_eventual_payment (
    id integer DEFAULT nextval('public.employee_eventual_payment_id_seq'::regclass) NOT NULL,
    employee_id integer,
    amount real,
    date timestamp without time zone,
    reazon text,
    service_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    days integer
);


ALTER TABLE public.employee_eventual_payment OWNER TO alfabravo_user;

--
-- Name: employee_files_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_files_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.employee_files_id_seq OWNER TO alfabravo_user;

--
-- Name: employee_files; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_files (
    employee_files_id integer DEFAULT nextval('public.employee_files_id_seq'::regclass) NOT NULL,
    filename character varying(255),
    employee_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    file_type_id integer,
    expiration_date timestamp(6) without time zone,
    document_name text,
    user_upload integer,
    user_deleted integer,
    file_ntype_id integer,
    extras text
);


ALTER TABLE public.employee_files OWNER TO alfabravo_user;

--
-- Name: user_ubication_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.user_ubication_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.user_ubication_id_seq OWNER TO alfabravo_user;

--
-- Name: employee_office_zone; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_office_zone (
    id integer DEFAULT nextval('public.user_ubication_id_seq'::regclass) NOT NULL,
    zone_id integer,
    office_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    employee_id integer,
    type integer
);


ALTER TABLE public.employee_office_zone OWNER TO alfabravo_user;

--
-- Name: employee_request_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_request_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.employee_request_id_seq OWNER TO alfabravo_user;

--
-- Name: employee_request; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_request (
    id integer DEFAULT nextval('public.employee_request_id_seq'::regclass) NOT NULL,
    type integer,
    employee_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    starting_period timestamp without time zone,
    ending_period timestamp without time zone,
    reazon text,
    employee_requested_to integer
);


ALTER TABLE public.employee_request OWNER TO alfabravo_user;

--
-- Name: employee_salary; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_salary (
    id integer NOT NULL,
    employee_id integer,
    external character varying(255),
    aspel character varying(255),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone
);


ALTER TABLE public.employee_salary OWNER TO alfabravo_user;

--
-- Name: employee_salary_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_salary_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.employee_salary_id_seq OWNER TO alfabravo_user;

--
-- Name: employee_salary_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.employee_salary_id_seq OWNED BY public.employee_salary.id;


--
-- Name: employee_security_secretary_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_security_secretary_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.employee_security_secretary_id_seq OWNER TO alfabravo_user;

--
-- Name: employee_security_secretary; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_security_secretary (
    id integer DEFAULT nextval('public.employee_security_secretary_id_seq'::regclass) NOT NULL,
    enterprise_id integer,
    up_ssp_date timestamp without time zone,
    assign_date timestamp without time zone,
    status_id integer,
    original_letter boolean,
    validation_letter boolean,
    attachment character varying,
    created_at timestamp without time zone,
    deleted_at timestamp without time zone,
    updated_at timestamp without time zone,
    employee_id integer,
    user_id integer,
    antecentes_penales boolean,
    antecentes_penales_file text,
    cip boolean,
    ss_adate_estatal timestamp without time zone,
    estado_id integer,
    rnsp boolean,
    rnsp_file text,
    cip_file text
);


ALTER TABLE public.employee_security_secretary OWNER TO alfabravo_user;

--
-- Name: employee_security_secretary_status_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_security_secretary_status_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.employee_security_secretary_status_id_seq OWNER TO alfabravo_user;

--
-- Name: employee_security_secretary_status; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_security_secretary_status (
    id integer DEFAULT nextval('public.employee_security_secretary_status_id_seq'::regclass) NOT NULL,
    name character varying(255),
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.employee_security_secretary_status OWNER TO alfabravo_user;

--
-- Name: employee_seq_id_type; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_seq_id_type
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.employee_seq_id_type OWNER TO alfabravo_user;

--
-- Name: employee_social_study_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_social_study_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.employee_social_study_id_seq OWNER TO alfabravo_user;

--
-- Name: employee_social_study; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_social_study (
    id integer DEFAULT nextval('public.employee_social_study_id_seq'::regclass) NOT NULL,
    employee_id integer,
    data text,
    files text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    user_id integer
);


ALTER TABLE public.employee_social_study OWNER TO alfabravo_user;

--
-- Name: employee_status_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_status_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.employee_status_id_seq OWNER TO alfabravo_user;

--
-- Name: employee_status; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_status (
    id integer DEFAULT nextval('public.employee_status_id_seq'::regclass) NOT NULL,
    name character varying,
    code character varying,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone,
    show_summary boolean DEFAULT false,
    color character varying(300)
);


ALTER TABLE public.employee_status OWNER TO alfabravo_user;

--
-- Name: employee_status_day_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_status_day_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.employee_status_day_id_seq OWNER TO alfabravo_user;

--
-- Name: employee_status_day; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_status_day (
    id integer DEFAULT nextval('public.employee_status_day_id_seq'::regclass) NOT NULL,
    employee_id integer,
    employee_status_id integer,
    user_id integer,
    notes text,
    register_date timestamp(0) without time zone,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone,
    assistance boolean,
    elementtype character varying(255),
    elementtype_id integer,
    client_id integer,
    client_extra_id integer
);


ALTER TABLE public.employee_status_day OWNER TO alfabravo_user;

--
-- Name: employee_symbology_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_symbology_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.employee_symbology_id_seq OWNER TO alfabravo_user;

--
-- Name: employee_terms_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_terms_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.employee_terms_id_seq OWNER TO alfabravo_user;

--
-- Name: employee_terms; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_terms (
    id integer DEFAULT nextval('public.employee_terms_id_seq'::regclass) NOT NULL,
    terms_id integer,
    employee_id integer,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.employee_terms OWNER TO alfabravo_user;

--
-- Name: employee_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_type (
    id integer DEFAULT nextval('public.employee_seq_id_type'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.employee_type OWNER TO alfabravo_user;

--
-- Name: id_ubication_history_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.id_ubication_history_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.id_ubication_history_seq OWNER TO alfabravo_user;

--
-- Name: employee_ubication; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_ubication (
    id_employee_ubication integer DEFAULT nextval('public.id_ubication_history_seq'::regclass) NOT NULL,
    id_employee integer,
    ubication_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    client_id integer,
    salary real,
    schedule character varying(1000),
    productivity_salary real,
    phone character varying(255),
    start_working_date date,
    end_working_date date,
    employee_type_id integer,
    enterprise_id integer,
    work_position_id integer,
    emails character varying(1000),
    user_id integer,
    is_imss boolean,
    imss_date date,
    is_armed boolean,
    discharge_reason_id integer,
    discharge_description text,
    payroll_software_id integer,
    payroll_number character varying(100),
    employee_number integer,
    payroll_type integer,
    personal_type integer,
    area_id integer,
    guard_type_id integer,
    support_service_id integer,
    direction_id integer,
    new_area_id integer,
    new_work_position_id integer,
    imss_date_discharge timestamp(6) without time zone
);


ALTER TABLE public.employee_ubication OWNER TO alfabravo_user;

--
-- Name: employee_weapon_registry_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.employee_weapon_registry_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.employee_weapon_registry_id_seq OWNER TO alfabravo_user;

--
-- Name: employee_weapon_registry; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.employee_weapon_registry (
    id integer DEFAULT nextval('public.employee_weapon_registry_id_seq'::regclass) NOT NULL,
    weapon_model_id integer,
    weapon_type_id integer,
    weapon_caliber_id integer,
    weapon_autority_id integer,
    enrollment character varying(255),
    registration_folio character varying(255),
    due_date timestamp(0) without time zone,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone,
    employee_id integer
);


ALTER TABLE public.employee_weapon_registry OWNER TO alfabravo_user;

--
-- Name: enterprise_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.enterprise_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.enterprise_id_seq OWNER TO alfabravo_user;

--
-- Name: enterprise; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.enterprise (
    id integer DEFAULT nextval('public.enterprise_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description character varying(500),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(6) without time zone,
    prefix character varying(50),
    desactivated boolean,
    ssp boolean
);


ALTER TABLE public.enterprise OWNER TO alfabravo_user;

--
-- Name: enterprise_document_category_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.enterprise_document_category_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.enterprise_document_category_id_seq OWNER TO alfabravo_user;

--
-- Name: enterprise_document_category; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.enterprise_document_category (
    id integer DEFAULT nextval('public.enterprise_document_category_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.enterprise_document_category OWNER TO alfabravo_user;

--
-- Name: enterprise_file_share_user_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.enterprise_file_share_user_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.enterprise_file_share_user_id_seq OWNER TO alfabravo_user;

--
-- Name: enterprise_file_share_user; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.enterprise_file_share_user (
    id integer DEFAULT nextval('public.enterprise_file_share_user_id_seq'::regclass) NOT NULL,
    user_id integer,
    file_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    user_by integer,
    until timestamp without time zone
);


ALTER TABLE public.enterprise_file_share_user OWNER TO alfabravo_user;

--
-- Name: enterprise_file_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.enterprise_file_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.enterprise_file_type_id_seq OWNER TO alfabravo_user;

--
-- Name: enterprise_file_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.enterprise_file_type (
    id integer DEFAULT nextval('public.enterprise_file_type_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    module character varying(255),
    is_required boolean,
    is_public boolean,
    document_category_id integer,
    nname text,
    "position" integer,
    no_document integer,
    modules text
);


ALTER TABLE public.enterprise_file_type OWNER TO alfabravo_user;

--
-- Name: enterprise_files_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.enterprise_files_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.enterprise_files_id_seq OWNER TO alfabravo_user;

--
-- Name: enterprise_files; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.enterprise_files (
    files_id integer DEFAULT nextval('public.enterprise_files_id_seq'::regclass) NOT NULL,
    filename character varying(255),
    enterprise_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    file_type_id integer,
    expiration_date timestamp(6) without time zone,
    document_name text
);


ALTER TABLE public.enterprise_files OWNER TO alfabravo_user;

--
-- Name: enterprise_product_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.enterprise_product_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.enterprise_product_id_seq OWNER TO alfabravo_user;

--
-- Name: enterprise_product; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.enterprise_product (
    id integer DEFAULT nextval('public.enterprise_product_id_seq'::regclass) NOT NULL,
    product_id integer,
    enterprise_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.enterprise_product OWNER TO alfabravo_user;

--
-- Name: exam_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.exam_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.exam_id_seq OWNER TO alfabravo_user;

--
-- Name: exam; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.exam (
    id smallint DEFAULT nextval('public.exam_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.exam OWNER TO alfabravo_user;

--
-- Name: exp_dates_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.exp_dates_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.exp_dates_id_seq OWNER TO alfabravo_user;

--
-- Name: exp_dates; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.exp_dates (
    id integer DEFAULT nextval('public.exp_dates_id_seq'::regclass) NOT NULL,
    exp_recursive_id integer,
    date timestamp(0) without time zone,
    amount_plan double precision,
    status integer,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.exp_dates OWNER TO alfabravo_user;

--
-- Name: exp_pedido_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.exp_pedido_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.exp_pedido_id_seq OWNER TO alfabravo_user;

--
-- Name: exp_pedido; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.exp_pedido (
    id integer DEFAULT nextval('public.exp_pedido_id_seq'::regclass) NOT NULL,
    exp_request_id integer,
    itemable_id integer,
    itemable_type character varying(191),
    provider_id integer,
    count integer,
    sales_order_unit_measure_id integer,
    unit_cost double precision,
    iva double precision,
    total_cost double precision,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.exp_pedido OWNER TO alfabravo_user;

--
-- Name: exp_recursive_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.exp_recursive_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.exp_recursive_id_seq OWNER TO alfabravo_user;

--
-- Name: exp_recursive; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.exp_recursive (
    id integer DEFAULT nextval('public.exp_recursive_id_seq'::regclass) NOT NULL,
    months character varying(10),
    weeks character varying(10),
    days character varying(10),
    specificday character varying(10),
    details character varying(600),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    element_type character varying(191),
    element_id integer,
    days_to_alert integer,
    pay_back_debts boolean,
    name character varying(191)
);


ALTER TABLE public.exp_recursive OWNER TO alfabravo_user;

--
-- Name: rent_services_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.rent_services_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.rent_services_id_seq OWNER TO alfabravo_user;

--
-- Name: exp_rent_service; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.exp_rent_service (
    id integer DEFAULT nextval('public.rent_services_id_seq'::regclass) NOT NULL,
    category character varying(100),
    name character varying(100),
    description character varying(600),
    exp_recursive boolean DEFAULT false,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone
);


ALTER TABLE public.exp_rent_service OWNER TO alfabravo_user;

--
-- Name: exp_request_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.exp_request_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.exp_request_id_seq OWNER TO alfabravo_user;

--
-- Name: exp_request; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.exp_request (
    id integer DEFAULT nextval('public.exp_request_id_seq'::regclass) NOT NULL,
    enterprise_prefix character varying(10),
    enterprise_folio integer,
    date timestamp(0) without time zone,
    requesterable_id integer,
    requesterable_type character varying(191),
    concept character varying(191),
    user_id integer,
    enterprise_id integer,
    status integer,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.exp_request OWNER TO alfabravo_user;

--
-- Name: expenses_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.expenses_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.expenses_id_seq OWNER TO alfabravo_user;

--
-- Name: expenses; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.expenses (
    id integer DEFAULT nextval('public.expenses_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    module character varying(255)
);


ALTER TABLE public.expenses OWNER TO alfabravo_user;

--
-- Name: external_service_provider_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.external_service_provider_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.external_service_provider_id_seq OWNER TO alfabravo_user;

--
-- Name: external_service_provider; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.external_service_provider (
    id integer DEFAULT nextval('public.external_service_provider_id_seq'::regclass) NOT NULL,
    name character varying,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone
);


ALTER TABLE public.external_service_provider OWNER TO alfabravo_user;

--
-- Name: external_service_provider_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.external_service_provider_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.external_service_provider_type_id_seq OWNER TO alfabravo_user;

--
-- Name: external_service_provider_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.external_service_provider_type (
    id integer DEFAULT nextval('public.external_service_provider_type_id_seq'::regclass) NOT NULL,
    external_service_provider_id integer,
    external_service_type_id integer,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone
);


ALTER TABLE public.external_service_provider_type OWNER TO alfabravo_user;

--
-- Name: external_service_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.external_service_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.external_service_type_id_seq OWNER TO alfabravo_user;

--
-- Name: external_service_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.external_service_type (
    id integer DEFAULT nextval('public.external_service_type_id_seq'::regclass) NOT NULL,
    name character varying,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone
);


ALTER TABLE public.external_service_type OWNER TO alfabravo_user;

--
-- Name: failed_jobs; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.failed_jobs (
    id bigint NOT NULL,
    uuid character varying(255) NOT NULL,
    connection text NOT NULL,
    queue text NOT NULL,
    payload text NOT NULL,
    exception text NOT NULL,
    failed_at timestamp(0) without time zone DEFAULT now() NOT NULL
);


ALTER TABLE public.failed_jobs OWNER TO alfabravo_user;

--
-- Name: failed_jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.failed_jobs_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.failed_jobs_id_seq OWNER TO alfabravo_user;

--
-- Name: failed_jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.failed_jobs_id_seq OWNED BY public.failed_jobs.id;


--
-- Name: file_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.file_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.file_type_id_seq OWNER TO alfabravo_user;

--
-- Name: file_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.file_type (
    id integer DEFAULT nextval('public.file_type_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    module character varying(255),
    is_required boolean,
    is_public boolean,
    document_category_id integer,
    nname text,
    "position" integer,
    no_document integer,
    modules text
);


ALTER TABLE public.file_type OWNER TO alfabravo_user;

--
-- Name: fixed_cost_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.fixed_cost_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.fixed_cost_id_seq OWNER TO alfabravo_user;

--
-- Name: fixed_cost; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.fixed_cost (
    id integer DEFAULT nextval('public.fixed_cost_id_seq'::regclass) NOT NULL,
    fixed_cost_category_id integer,
    limit_to_pay timestamp without time zone,
    periodicity_id integer,
    planned_amonut real,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    user_id integer,
    enterprise_id integer,
    last_status_id integer,
    facture boolean,
    cost_id integer,
    description text,
    payment_way integer,
    cost_name text,
    provider_to_pay_id integer,
    provider_bank_data_id integer,
    attachment text,
    payment_account_id integer,
    master_id text,
    folio text,
    cid text
);


ALTER TABLE public.fixed_cost OWNER TO alfabravo_user;

--
-- Name: fixed_cost_facture_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.fixed_cost_facture_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.fixed_cost_facture_id_seq OWNER TO alfabravo_user;

--
-- Name: fixed_cost_bill; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.fixed_cost_bill (
    id integer DEFAULT nextval('public.fixed_cost_facture_id_seq'::regclass) NOT NULL,
    amount real,
    resource text,
    fixed_cost_id integer,
    user_id integer,
    observations text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    bill_date timestamp without time zone,
    config_date_payment timestamp without time zone,
    payment_account integer
);


ALTER TABLE public.fixed_cost_bill OWNER TO alfabravo_user;

--
-- Name: fixed_cost_category_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.fixed_cost_category_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.fixed_cost_category_id_seq OWNER TO alfabravo_user;

--
-- Name: fixed_cost_category; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.fixed_cost_category (
    id integer DEFAULT nextval('public.fixed_cost_category_id_seq'::regclass) NOT NULL,
    name character varying(255),
    parent_id integer,
    description text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    user_id integer
);


ALTER TABLE public.fixed_cost_category OWNER TO alfabravo_user;

--
-- Name: fixed_cost_payment_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.fixed_cost_payment_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.fixed_cost_payment_id_seq OWNER TO alfabravo_user;

--
-- Name: fixed_cost_payment; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.fixed_cost_payment (
    id integer DEFAULT nextval('public.fixed_cost_payment_id_seq'::regclass) NOT NULL,
    fixed_cost_id integer,
    amount_paid real,
    attachments text,
    user_id integer,
    date_payment timestamp without time zone,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at time without time zone,
    status_id integer,
    fixed_cost_bill_id integer,
    config_date_payment timestamp without time zone,
    payment_account integer
);


ALTER TABLE public.fixed_cost_payment OWNER TO alfabravo_user;

--
-- Name: fixed_cost_payment_way_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.fixed_cost_payment_way_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.fixed_cost_payment_way_id_seq OWNER TO alfabravo_user;

--
-- Name: fixed_cost_payment_way; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.fixed_cost_payment_way (
    id integer DEFAULT nextval('public.fixed_cost_payment_way_id_seq'::regclass) NOT NULL,
    type integer,
    amount_to_pay real,
    fixed_cost_payment_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp with time zone,
    cash_paid real,
    fixed_cost_bill_id integer
);


ALTER TABLE public.fixed_cost_payment_way OWNER TO alfabravo_user;

--
-- Name: fixed_cost_planned_amount_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.fixed_cost_planned_amount_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.fixed_cost_planned_amount_id_seq OWNER TO alfabravo_user;

--
-- Name: fixed_cost_planned_amount; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.fixed_cost_planned_amount (
    id integer DEFAULT nextval('public.fixed_cost_planned_amount_id_seq'::regclass) NOT NULL,
    amount real,
    fixed_cost_id integer,
    user_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.fixed_cost_planned_amount OWNER TO alfabravo_user;

--
-- Name: format_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.format_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.format_id_seq OWNER TO alfabravo_user;

--
-- Name: format; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.format (
    id integer DEFAULT nextval('public.format_id_seq'::regclass) NOT NULL,
    title character varying(255),
    version integer,
    content text,
    current boolean,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    type_format character varying(255),
    desactivated boolean
);


ALTER TABLE public.format OWNER TO alfabravo_user;

--
-- Name: format_variable_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.format_variable_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.format_variable_id_seq OWNER TO alfabravo_user;

--
-- Name: format_variable; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.format_variable (
    id integer DEFAULT nextval('public.format_variable_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description character varying(500),
    value character varying(255),
    variable character varying(255),
    type character varying(255),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.format_variable OWNER TO alfabravo_user;

--
-- Name: fuel_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.fuel_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.fuel_type_id_seq OWNER TO alfabravo_user;

--
-- Name: fuel_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.fuel_type (
    id integer DEFAULT nextval('public.fuel_type_id_seq'::regclass) NOT NULL,
    name character varying(500),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.fuel_type OWNER TO alfabravo_user;

--
-- Name: gps_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.gps_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.gps_id_seq OWNER TO alfabravo_user;

--
-- Name: gps; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.gps (
    id integer DEFAULT nextval('public.gps_id_seq'::regclass) NOT NULL,
    sim_number character varying(255),
    cell_number character varying(255),
    imei character varying(255),
    company character varying(255),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(6) without time zone,
    name character varying
);


ALTER TABLE public.gps OWNER TO alfabravo_user;

--
-- Name: group_taxes; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.group_taxes (
    id integer NOT NULL,
    name character varying(255),
    number integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone
);


ALTER TABLE public.group_taxes OWNER TO alfabravo_user;

--
-- Name: group_taxes_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.group_taxes_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.group_taxes_id_seq OWNER TO alfabravo_user;

--
-- Name: group_taxes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.group_taxes_id_seq OWNED BY public.group_taxes.id;


--
-- Name: guard_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.guard_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.guard_type_id_seq OWNER TO alfabravo_user;

--
-- Name: guard_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.guard_type (
    id integer DEFAULT nextval('public.guard_type_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone
);


ALTER TABLE public.guard_type OWNER TO alfabravo_user;

--
-- Name: holiday_day_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.holiday_day_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.holiday_day_id_seq OWNER TO alfabravo_user;

--
-- Name: holiday_day; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.holiday_day (
    id integer DEFAULT nextval('public.holiday_day_id_seq'::regclass) NOT NULL,
    day timestamp without time zone,
    label character varying(255),
    description text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp with time zone
);


ALTER TABLE public.holiday_day OWNER TO alfabravo_user;

--
-- Name: id_employee_type_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.id_employee_type_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.id_employee_type_seq OWNER TO alfabravo_user;

--
-- Name: id_marital_status_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.id_marital_status_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.id_marital_status_seq OWNER TO alfabravo_user;

--
-- Name: id_payroll_employee_bonus_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.id_payroll_employee_bonus_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.id_payroll_employee_bonus_seq OWNER TO alfabravo_user;

--
-- Name: id_payroll_employee_discount_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.id_payroll_employee_discount_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.id_payroll_employee_discount_seq OWNER TO alfabravo_user;

--
-- Name: id_payroll_employee_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.id_payroll_employee_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.id_payroll_employee_seq OWNER TO alfabravo_user;

--
-- Name: id_payroll_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.id_payroll_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.id_payroll_seq OWNER TO alfabravo_user;

--
-- Name: id_personal_address_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.id_personal_address_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.id_personal_address_seq OWNER TO alfabravo_user;

--
-- Name: inc_dates_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.inc_dates_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inc_dates_id_seq OWNER TO alfabravo_user;

--
-- Name: inc_dates; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.inc_dates (
    id integer DEFAULT nextval('public.inc_dates_id_seq'::regclass) NOT NULL,
    date timestamp(0) without time zone,
    amount_plan double precision,
    infos_service_id integer NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    client_conditions_id integer,
    status integer DEFAULT 0
);


ALTER TABLE public.inc_dates OWNER TO alfabravo_user;

--
-- Name: inc_debts_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.inc_debts_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inc_debts_id_seq OWNER TO alfabravo_user;

--
-- Name: inc_debts; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.inc_debts (
    id integer DEFAULT nextval('public.inc_debts_id_seq'::regclass) NOT NULL,
    assignedtoable_type character varying(100),
    assignedtoable_id integer,
    amount_plan double precision,
    amount_real double precision,
    estimated_date timestamp(0) without time zone,
    payment_date timestamp(0) without time zone,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    inc_sales_notes_id integer
);


ALTER TABLE public.inc_debts OWNER TO alfabravo_user;

--
-- Name: inc_sales_notes_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.inc_sales_notes_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inc_sales_notes_id_seq OWNER TO alfabravo_user;

--
-- Name: inc_sales_notes; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.inc_sales_notes (
    id integer DEFAULT nextval('public.inc_sales_notes_id_seq'::regclass) NOT NULL,
    assignedtoable_type character varying(100),
    assignedtoable_id integer,
    enterprise_prefix character varying(10),
    enterprise_folio character varying(10),
    amount_plan double precision,
    amount_real double precision DEFAULT 0,
    estimated_date timestamp(0) without time zone,
    payment_date timestamp(0) without time zone,
    details character varying(600),
    status integer,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.inc_sales_notes OWNER TO alfabravo_user;

--
-- Name: incidence_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.incidence_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.incidence_id_seq OWNER TO alfabravo_user;

--
-- Name: incidence; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.incidence (
    id integer DEFAULT nextval('public.incidence_id_seq'::regclass) NOT NULL,
    title character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    color character varying(255)
);


ALTER TABLE public.incidence OWNER TO alfabravo_user;

--
-- Name: incident_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.incident_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.incident_type_id_seq OWNER TO alfabravo_user;

--
-- Name: incident_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.incident_type (
    id integer DEFAULT nextval('public.incident_type_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.incident_type OWNER TO alfabravo_user;

--
-- Name: incomes_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.incomes_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.incomes_id_seq OWNER TO alfabravo_user;

--
-- Name: incomes; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.incomes (
    id integer DEFAULT nextval('public.incomes_id_seq'::regclass) NOT NULL,
    assignedtoable_id bigint,
    assignedtoable_type character varying(191),
    date timestamp(0) without time zone,
    amount_plan double precision,
    amount_real double precision,
    payment_type integer,
    details character varying(600),
    filename character varying(100),
    payment_sender character varying(100),
    payment_received integer,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    status character varying(191),
    enterprise_prefix character varying(10),
    enterprise_folio integer,
    inc_sales_notes_id integer
);


ALTER TABLE public.incomes OWNER TO alfabravo_user;

--
-- Name: infos_cobranzas_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_cobranzas_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_cobranzas_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_cobranzas; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_cobranzas (
    id integer DEFAULT nextval('public.infos_cobranzas_id_seq'::regclass) NOT NULL,
    facture_to_id integer,
    rfc character varying(255),
    uso_cfdi character varying(255),
    fiscal_address text,
    colony text,
    municipality_id integer,
    state_id integer,
    cp character varying(255),
    telephone character varying(255),
    facture_legend text,
    payment_conditions text,
    facture_delivery text,
    facture_contact text,
    facture_reception_days text,
    facture_payment_day text,
    observations text,
    periodicity text,
    amount real,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    user_id integer,
    service_id integer,
    service_model character varying(255)
);


ALTER TABLE public.infos_cobranzas OWNER TO alfabravo_user;

--
-- Name: infos_cobranzas_files_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_cobranzas_files_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_cobranzas_files_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_cobranzas_files; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_cobranzas_files (
    files_id integer DEFAULT nextval('public.infos_cobranzas_files_id_seq'::regclass) NOT NULL,
    filename character varying(255),
    cobranzas_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    file_type_id integer,
    expiration_date timestamp(6) without time zone,
    document_name text,
    user_id integer
);


ALTER TABLE public.infos_cobranzas_files OWNER TO alfabravo_user;

--
-- Name: infos_intramuros_budget_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_intramuros_budget_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_intramuros_budget_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_intramuros_budget; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_intramuros_budget (
    id integer DEFAULT nextval('public.infos_intramuros_budget_id_seq'::regclass) NOT NULL,
    infos_service_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    amount real,
    status integer,
    description text,
    resource_id integer,
    expenses_id integer,
    status_date timestamp(6) without time zone
);


ALTER TABLE public.infos_intramuros_budget OWNER TO alfabravo_user;

--
-- Name: infos_service_intramuros_employee_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_service_intramuros_employee_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_service_intramuros_employee_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_intramuros_employee; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_intramuros_employee (
    id integer DEFAULT nextval('public.infos_service_intramuros_employee_id_seq'::regclass) NOT NULL,
    infos_service_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    employee_id integer,
    employee_ubication_id integer,
    status integer,
    description text,
    status_date timestamp(6) without time zone,
    intramuro_element_id integer
);


ALTER TABLE public.infos_intramuros_employee OWNER TO alfabravo_user;

--
-- Name: infos_intramuros_expense_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_intramuros_expense_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_intramuros_expense_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_intramuros_expense; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_intramuros_expense (
    id integer DEFAULT nextval('public.infos_intramuros_expense_id_seq'::regclass) NOT NULL,
    infos_service_id integer,
    infos_service_vehicle_id integer,
    infos_service_employee_id integer,
    expenses_id integer,
    resource_type_id integer,
    amount real,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    notes text,
    register_date timestamp(0) without time zone,
    expense_photo character varying(255),
    infos_service_resource_id integer,
    alm_movement_id integer
);


ALTER TABLE public.infos_intramuros_expense OWNER TO alfabravo_user;

--
-- Name: infos_service_intramuros_resource_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_service_intramuros_resource_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_service_intramuros_resource_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_intramuros_resource; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_intramuros_resource (
    id integer DEFAULT nextval('public.infos_service_intramuros_resource_id_seq'::regclass) NOT NULL,
    infos_service_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    amount real,
    status integer,
    infos_service_employee_id integer,
    description text,
    resource_id integer,
    resource_element_id character varying(200),
    status_date timestamp(6) without time zone
);


ALTER TABLE public.infos_intramuros_resource OWNER TO alfabravo_user;

--
-- Name: infos_intramuros_service_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_intramuros_service_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_intramuros_service_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_intramuros_service; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_intramuros_service (
    id integer DEFAULT nextval('public.infos_intramuros_service_id_seq'::regclass) NOT NULL,
    status integer,
    id_client integer,
    units integer,
    guards integer,
    armored integer,
    no_armored integer,
    turn_types_id integer,
    men integer,
    women integer,
    place text,
    place_time timestamp(6) without time zone,
    service_time timestamp(6) without time zone,
    duration character varying(32),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    cancelled_by character varying,
    client_service_number character varying(32),
    client_service_name text,
    observations text,
    service_ubication text,
    locked_to timestamp(6) without time zone,
    considerations text,
    service_number_element integer,
    id_enterprise integer,
    mount real,
    responsible integer,
    config_guards text,
    config_cans text,
    units_descriptions text,
    config_resources text,
    config_host text,
    region_id integer,
    enterprise_id integer,
    initial_cost real,
    mensual_cost real,
    quoter_id integer,
    vehicle_mensual_cost real,
    vehicle_cost real
);


ALTER TABLE public.infos_intramuros_service OWNER TO alfabravo_user;

--
-- Name: infos_intramuros_service_element_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_intramuros_service_element_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_intramuros_service_element_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_intramuros_service_element; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_intramuros_service_element (
    id integer DEFAULT nextval('public.infos_intramuros_service_element_id_seq'::regclass) NOT NULL,
    nro_elements integer,
    armored integer,
    no_armored integer,
    men integer,
    women integer,
    required_personal integer,
    observations text,
    work_shift_id integer,
    service_schedule text,
    service_time timestamp without time zone,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    infos_intramuros_service_id integer,
    title text
);


ALTER TABLE public.infos_intramuros_service_element OWNER TO alfabravo_user;

--
-- Name: infos_service_intramuros_vehicle_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_service_intramuros_vehicle_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_service_intramuros_vehicle_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_intramuros_vehicle; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_intramuros_vehicle (
    id integer DEFAULT nextval('public.infos_service_intramuros_vehicle_id_seq'::regclass) NOT NULL,
    infos_service_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    unit integer,
    status integer,
    vehicle_id integer,
    description text,
    total_mileage integer DEFAULT 0,
    status_date timestamp(6) without time zone
);


ALTER TABLE public.infos_intramuros_vehicle OWNER TO alfabravo_user;

--
-- Name: infos_service_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_service_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_service_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_service; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_service (
    id integer DEFAULT nextval('public.infos_service_id_seq'::regclass) NOT NULL,
    id_service_type integer,
    status integer,
    id_client integer,
    units integer,
    place text,
    place_time timestamp(6) without time zone,
    service_time timestamp(6) without time zone,
    duration bigint,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    cancelled_by character varying,
    total_mileage integer DEFAULT 0,
    total_lineal_mileage integer DEFAULT 0,
    client_service_number character varying(32),
    client_service_name text,
    considerations text,
    observations text,
    service_time_end timestamp(6) without time zone,
    locked_to timestamp(6) without time zone,
    wapp_group character varying(255)
);


ALTER TABLE public.infos_service OWNER TO alfabravo_user;

--
-- Name: infos_service_budget_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_service_budget_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_service_budget_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_service_budget; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_service_budget (
    id integer DEFAULT nextval('public.infos_service_budget_id_seq'::regclass) NOT NULL,
    infos_service_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    amount real,
    status integer,
    description text,
    resource_id integer,
    expenses_id integer,
    status_date timestamp(6) without time zone
);


ALTER TABLE public.infos_service_budget OWNER TO alfabravo_user;

--
-- Name: infos_service_carrier_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_service_carrier_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.infos_service_carrier_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_service_carrier; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_service_carrier (
    id integer DEFAULT nextval('public.infos_service_carrier_id_seq'::regclass) NOT NULL,
    infos_service_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    status integer DEFAULT 1,
    brand_id integer,
    transport_company_id integer,
    plates character varying(255),
    driver character varying(255),
    phone character varying(255),
    description text,
    status_date timestamp(6) without time zone
);


ALTER TABLE public.infos_service_carrier OWNER TO alfabravo_user;

--
-- Name: infos_service_employee_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_service_employee_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_service_employee_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_service_employee; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_service_employee (
    id integer DEFAULT nextval('public.infos_service_employee_id_seq'::regclass) NOT NULL,
    infos_service_id integer,
    route_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    employee_id integer,
    unit integer,
    employee_ubication_id integer,
    status integer,
    service_rol_id integer,
    description text,
    status_date timestamp(6) without time zone,
    service_type_id integer,
    vehicle_service_route_id integer
);


ALTER TABLE public.infos_service_employee OWNER TO alfabravo_user;

--
-- Name: infos_service_events_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_service_events_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_service_events_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_service_events; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_service_events (
    id integer DEFAULT nextval('public.infos_service_events_id_seq'::regclass) NOT NULL,
    infos_service_id integer,
    infos_service_vehicle_id integer,
    infos_service_employee_id integer,
    incident_type_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    event_notes text,
    event_date timestamp(0) without time zone
);


ALTER TABLE public.infos_service_events OWNER TO alfabravo_user;

--
-- Name: infos_service_events_files_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_service_events_files_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_service_events_files_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_service_events_files; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_service_events_files (
    id integer DEFAULT nextval('public.infos_service_events_files_id_seq'::regclass) NOT NULL,
    filename character varying(255),
    infos_service_events_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    document_name text
);


ALTER TABLE public.infos_service_events_files OWNER TO alfabravo_user;

--
-- Name: infos_service_expense_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_service_expense_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_service_expense_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_service_expense; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_service_expense (
    id integer DEFAULT nextval('public.infos_service_expense_id_seq'::regclass) NOT NULL,
    infos_service_id integer,
    infos_service_vehicle_id integer,
    infos_service_employee_id integer,
    expenses_id integer,
    resource_type_id integer,
    amount real,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    notes text,
    register_date timestamp(0) without time zone,
    expense_photo character varying(255),
    infos_service_resource_id integer
);


ALTER TABLE public.infos_service_expense OWNER TO alfabravo_user;

--
-- Name: infos_service_plan_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_service_plan_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_service_plan_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_service_plan; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_service_plan (
    id integer DEFAULT nextval('public.infos_service_plan_id_seq'::regclass) NOT NULL,
    infos_service_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    personal integer,
    status integer,
    description text,
    infos_service_type_id integer,
    status_date timestamp(6) without time zone,
    vehicles integer
);


ALTER TABLE public.infos_service_plan OWNER TO alfabravo_user;

--
-- Name: infos_service_resource_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_service_resource_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_service_resource_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_service_resource; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_service_resource (
    id integer DEFAULT nextval('public.infos_service_resource_id_seq'::regclass) NOT NULL,
    infos_service_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    amount real,
    status integer,
    infos_service_employee_id integer,
    description text,
    resource_id integer,
    resource_element_id character varying(200),
    status_date timestamp(6) without time zone
);


ALTER TABLE public.infos_service_resource OWNER TO alfabravo_user;

--
-- Name: infos_service_route_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_service_route_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_service_route_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_service_route; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_service_route (
    id integer DEFAULT nextval('public.infos_service_route_id_seq'::regclass) NOT NULL,
    infos_service_id integer,
    route_id integer,
    start character varying(255),
    "end" character varying,
    base_start_id integer,
    return_date timestamp(6) without time zone,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    base_end_id integer,
    status integer DEFAULT 1,
    description text,
    status_date timestamp(6) without time zone
);


ALTER TABLE public.infos_service_route OWNER TO alfabravo_user;

--
-- Name: infos_service_route_types; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_service_route_types (
    infos_service_type_id integer NOT NULL,
    infos_service_route_id integer NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.infos_service_route_types OWNER TO alfabravo_user;

--
-- Name: service_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.service_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.service_type_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_service_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_service_type (
    id integer DEFAULT nextval('public.service_type_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    submodule character varying
);


ALTER TABLE public.infos_service_type OWNER TO alfabravo_user;

--
-- Name: infos_service_type_work_position_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_service_type_work_position_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.infos_service_type_work_position_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_service_type_work_position; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_service_type_work_position (
    id integer DEFAULT nextval('public.infos_service_type_work_position_id_seq'::regclass) NOT NULL,
    infos_service_type_id integer,
    work_position_id integer,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone
);


ALTER TABLE public.infos_service_type_work_position OWNER TO alfabravo_user;

--
-- Name: infos_service_types; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_service_types (
    infos_service_type_id integer NOT NULL,
    infos_service_id integer NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.infos_service_types OWNER TO alfabravo_user;

--
-- Name: infos_service_vehicle_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_service_vehicle_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_service_vehicle_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_service_vehicle; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_service_vehicle (
    id integer DEFAULT nextval('public.infos_service_vehicle_id_seq'::regclass) NOT NULL,
    infos_service_id integer,
    route_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    unit integer,
    status integer,
    vehicle_id integer,
    description text,
    total_mileage integer DEFAULT 0,
    status_date timestamp(6) without time zone,
    service_type_id integer,
    vehicle_type_id integer
);


ALTER TABLE public.infos_service_vehicle OWNER TO alfabravo_user;

--
-- Name: infos_services_vehicle_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_services_vehicle_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_services_vehicle_type_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_services_vehicle_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_services_vehicle_type (
    id integer DEFAULT nextval('public.infos_services_vehicle_type_id_seq'::regclass) NOT NULL,
    name character varying(255),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.infos_services_vehicle_type OWNER TO alfabravo_user;

--
-- Name: infos_warehouse_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_warehouse_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_warehouse_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_warehouse; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_warehouse (
    id integer DEFAULT nextval('public.infos_warehouse_id_seq'::regclass) NOT NULL,
    item integer,
    description text,
    min integer,
    max integer,
    "real" integer,
    enterprise integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    user_id integer
);


ALTER TABLE public.infos_warehouse OWNER TO alfabravo_user;

--
-- Name: infos_warehouse_movement_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.infos_warehouse_movement_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.infos_warehouse_movement_id_seq OWNER TO alfabravo_user;

--
-- Name: infos_warehouse_movement; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.infos_warehouse_movement (
    id integer DEFAULT nextval('public.infos_warehouse_movement_id_seq'::regclass) NOT NULL,
    warehouse_item_id integer,
    cant integer,
    action integer,
    user_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    observations text,
    evidence character varying(255),
    responsable_id integer
);


ALTER TABLE public.infos_warehouse_movement OWNER TO alfabravo_user;

--
-- Name: insurance_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.insurance_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.insurance_id_seq OWNER TO alfabravo_user;

--
-- Name: insurance; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.insurance (
    id integer DEFAULT nextval('public.insurance_id_seq'::regclass) NOT NULL,
    name character varying(255),
    email character varying(255),
    phones character varying(255),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.insurance OWNER TO alfabravo_user;

--
-- Name: insurance_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.insurance_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.insurance_type_id_seq OWNER TO alfabravo_user;

--
-- Name: insurance_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.insurance_type (
    id integer DEFAULT nextval('public.insurance_type_id_seq'::regclass) NOT NULL,
    name character varying(500),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.insurance_type OWNER TO alfabravo_user;

--
-- Name: inventory_category_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.inventory_category_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inventory_category_id_seq OWNER TO alfabravo_user;

--
-- Name: inventory_category; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.inventory_category (
    id integer DEFAULT nextval('public.inventory_category_id_seq'::regclass) NOT NULL,
    name character varying,
    parent_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp with time zone,
    actived boolean,
    user_id integer,
    route character varying
);


ALTER TABLE public.inventory_category OWNER TO alfabravo_user;

--
-- Name: inventory_category_property_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.inventory_category_property_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inventory_category_property_id_seq OWNER TO alfabravo_user;

--
-- Name: inventory_category_attribute; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.inventory_category_attribute (
    id integer DEFAULT nextval('public.inventory_category_property_id_seq'::regclass) NOT NULL,
    inventory_category_id integer,
    is_required boolean,
    name character varying,
    possible_values character varying,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    user_id integer,
    type character varying
);


ALTER TABLE public.inventory_category_attribute OWNER TO alfabravo_user;

--
-- Name: inventory_id_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.inventory_id_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inventory_id_id_seq OWNER TO alfabravo_user;

--
-- Name: inventory_id; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.inventory_id (
    id integer DEFAULT nextval('public.inventory_id_id_seq'::regclass) NOT NULL,
    product_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    no_inventory integer,
    enterprise_id integer
);


ALTER TABLE public.inventory_id OWNER TO alfabravo_user;

--
-- Name: inventory_owner_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.inventory_owner_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inventory_owner_id_seq OWNER TO alfabravo_user;

--
-- Name: inventory_owner; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.inventory_owner (
    id integer DEFAULT nextval('public.inventory_owner_id_seq'::regclass) NOT NULL,
    product_id integer,
    owner_type integer,
    owner_value text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.inventory_owner OWNER TO alfabravo_user;

--
-- Name: inventory_product_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.inventory_product_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inventory_product_id_seq OWNER TO alfabravo_user;

--
-- Name: inventory_product; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.inventory_product (
    id integer DEFAULT nextval('public.inventory_product_id_seq'::regclass) NOT NULL,
    brand_id integer,
    no_serie character varying,
    quantity integer,
    description text,
    material_id integer,
    color_id integer,
    state_id integer,
    aprox_amount real,
    last_inspection_date timestamp without time zone,
    additional_comments text,
    owner_manager_area integer,
    owner_manager_area_type integer,
    current_location_id character varying,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    category_id integer,
    no_inventory integer,
    enterprise_id integer,
    user_id integer,
    model character varying(255),
    owner_manager_area_value character varying
);


ALTER TABLE public.inventory_product OWNER TO alfabravo_user;

--
-- Name: inventory_product_brand_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.inventory_product_brand_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inventory_product_brand_id_seq OWNER TO alfabravo_user;

--
-- Name: inventory_product_brand; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.inventory_product_brand (
    id integer DEFAULT nextval('public.inventory_product_brand_id_seq'::regclass) NOT NULL,
    name character varying,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    user_id integer
);


ALTER TABLE public.inventory_product_brand OWNER TO alfabravo_user;

--
-- Name: inventory_product_color_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.inventory_product_color_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inventory_product_color_id_seq OWNER TO alfabravo_user;

--
-- Name: inventory_product_color; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.inventory_product_color (
    id integer DEFAULT nextval('public.inventory_product_color_id_seq'::regclass) NOT NULL,
    name character varying,
    user_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.inventory_product_color OWNER TO alfabravo_user;

--
-- Name: inventory_product_extra_attr_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.inventory_product_extra_attr_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inventory_product_extra_attr_id_seq OWNER TO alfabravo_user;

--
-- Name: inventory_product_extra_attr_value; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.inventory_product_extra_attr_value (
    id integer DEFAULT nextval('public.inventory_product_extra_attr_id_seq'::regclass) NOT NULL,
    inventory_category_attributte_id integer,
    value text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    inventory_category_product_id integer
);


ALTER TABLE public.inventory_product_extra_attr_value OWNER TO alfabravo_user;

--
-- Name: inventory_product_location_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.inventory_product_location_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inventory_product_location_id_seq OWNER TO alfabravo_user;

--
-- Name: inventory_product_location; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.inventory_product_location (
    id integer DEFAULT nextval('public.inventory_product_location_id_seq'::regclass) NOT NULL,
    name character varying,
    user_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.inventory_product_location OWNER TO alfabravo_user;

--
-- Name: inventory_product_material_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.inventory_product_material_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inventory_product_material_id_seq OWNER TO alfabravo_user;

--
-- Name: inventory_product_material; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.inventory_product_material (
    id integer DEFAULT nextval('public.inventory_product_material_id_seq'::regclass) NOT NULL,
    name character varying,
    user_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.inventory_product_material OWNER TO alfabravo_user;

--
-- Name: inventory_product_state_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.inventory_product_state_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.inventory_product_state_id_seq OWNER TO alfabravo_user;

--
-- Name: inventory_product_state; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.inventory_product_state (
    id integer DEFAULT nextval('public.inventory_product_state_id_seq'::regclass) NOT NULL,
    user_id character varying,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    name character varying(255)
);


ALTER TABLE public.inventory_product_state OWNER TO alfabravo_user;

--
-- Name: item_category_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.item_category_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.item_category_id_seq OWNER TO alfabravo_user;

--
-- Name: item_category; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.item_category (
    id integer DEFAULT nextval('public.item_category_id_seq'::regclass) NOT NULL,
    name character varying(255),
    code character varying(255),
    description character varying(255),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    item_category_id integer,
    user_id integer,
    finance boolean,
    tax_deduction boolean,
    warehouse boolean,
    unitary_price numeric(10,2)
);


ALTER TABLE public.item_category OWNER TO alfabravo_user;

--
-- Name: item_has_provider_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.item_has_provider_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.item_has_provider_id_seq OWNER TO alfabravo_user;

--
-- Name: item_category_provider; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.item_category_provider (
    id integer DEFAULT nextval('public.item_has_provider_id_seq'::regclass) NOT NULL,
    article_id integer,
    provider_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.item_category_provider OWNER TO alfabravo_user;

--
-- Name: jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.jobs_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.jobs_id_seq OWNER TO alfabravo_user;

--
-- Name: jobs; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.jobs (
    id bigint DEFAULT nextval('public.jobs_id_seq'::regclass) NOT NULL,
    queue character varying(191) NOT NULL,
    payload text NOT NULL,
    attempts smallint NOT NULL,
    reserved_at integer,
    available_at integer NOT NULL,
    created_at integer NOT NULL
);


ALTER TABLE public.jobs OWNER TO alfabravo_user;

--
-- Name: lang_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.lang_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.lang_id_seq OWNER TO alfabravo_user;

--
-- Name: lang; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.lang (
    name character varying(255),
    short_name character varying(255),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    flag character varying(255),
    id integer DEFAULT nextval('public.lang_id_seq'::regclass) NOT NULL,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.lang OWNER TO alfabravo_user;

--
-- Name: location; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.location (
    id integer NOT NULL,
    name character varying(255) NOT NULL,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.location OWNER TO alfabravo_user;

--
-- Name: location_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.location_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.location_id_seq OWNER TO alfabravo_user;

--
-- Name: location_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.location_id_seq OWNED BY public.location.id;


--
-- Name: vehicle_manufacturer; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.vehicle_manufacturer (
    id integer NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    image character varying(255),
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.vehicle_manufacturer OWNER TO alfabravo_user;

--
-- Name: manufacturer_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.manufacturer_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.manufacturer_id_seq OWNER TO alfabravo_user;

--
-- Name: manufacturer_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.manufacturer_id_seq OWNED BY public.vehicle_manufacturer.id;


--
-- Name: marital_status; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.marital_status (
    id integer DEFAULT nextval('public.id_marital_status_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.marital_status OWNER TO alfabravo_user;

--
-- Name: migrations; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.migrations (
    id integer NOT NULL,
    migration character varying(255) NOT NULL,
    batch integer NOT NULL
);


ALTER TABLE public.migrations OWNER TO alfabravo_user;

--
-- Name: migrations_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.migrations_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.migrations_id_seq OWNER TO alfabravo_user;

--
-- Name: migrations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.migrations_id_seq OWNED BY public.migrations.id;


--
-- Name: mileage_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.mileage_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.mileage_type_id_seq OWNER TO alfabravo_user;

--
-- Name: mileage_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.mileage_type (
    id integer DEFAULT nextval('public.mileage_type_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    module character varying(300)
);


ALTER TABLE public.mileage_type OWNER TO alfabravo_user;

--
-- Name: nomina; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.nomina (
    id integer NOT NULL,
    employee_id integer,
    amount real,
    daily_amount real,
    total_amount real,
    period integer,
    month integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone
);


ALTER TABLE public.nomina OWNER TO alfabravo_user;

--
-- Name: nomina_concept; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.nomina_concept (
    id integer NOT NULL,
    concept character varying(255),
    amount real,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    operation smallint
);


ALTER TABLE public.nomina_concept OWNER TO alfabravo_user;

--
-- Name: nomina_concept_element; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.nomina_concept_element (
    id integer NOT NULL,
    nomina_id integer,
    concept_id integer,
    amount real,
    observation text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone
);


ALTER TABLE public.nomina_concept_element OWNER TO alfabravo_user;

--
-- Name: nomina_concept_element_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.nomina_concept_element_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.nomina_concept_element_id_seq OWNER TO alfabravo_user;

--
-- Name: nomina_concept_element_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.nomina_concept_element_id_seq OWNED BY public.nomina_concept_element.id;


--
-- Name: nomina_concept_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.nomina_concept_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.nomina_concept_id_seq OWNER TO alfabravo_user;

--
-- Name: nomina_concept_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.nomina_concept_id_seq OWNED BY public.nomina_concept.id;


--
-- Name: nomina_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.nomina_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.nomina_id_seq OWNER TO alfabravo_user;

--
-- Name: nomina_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.nomina_id_seq OWNED BY public.nomina.id;


--
-- Name: office_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.office_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.office_id_seq OWNER TO alfabravo_user;

--
-- Name: office; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.office (
    id integer DEFAULT nextval('public.office_id_seq'::regclass) NOT NULL,
    name character varying(255),
    zone_id integer,
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    state integer,
    city integer,
    cp character varying,
    gps character varying,
    address character varying,
    client_id integer,
    timezone text
);


ALTER TABLE public.office OWNER TO alfabravo_user;

--
-- Name: office_zone_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.office_zone_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.office_zone_id_seq OWNER TO alfabravo_user;

--
-- Name: office_zone; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.office_zone (
    id integer DEFAULT nextval('public.office_zone_id_seq'::regclass) NOT NULL,
    office_id integer,
    zone_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.office_zone OWNER TO alfabravo_user;

--
-- Name: order_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.order_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.order_id_seq OWNER TO alfabravo_user;

--
-- Name: order_product_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.order_product_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.order_product_id_seq OWNER TO alfabravo_user;

--
-- Name: participacion_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.participacion_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.participacion_id_seq OWNER TO alfabravo_user;

--
-- Name: participation; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.participation (
    id integer DEFAULT nextval('public.participacion_id_seq'::regclass) NOT NULL,
    employee_id integer,
    participation_type integer,
    resource text,
    message text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.participation OWNER TO alfabravo_user;

--
-- Name: password_resets; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.password_resets (
    email character varying(255) NOT NULL,
    token character varying(255) NOT NULL,
    created_at timestamp(0) without time zone
);


ALTER TABLE public.password_resets OWNER TO alfabravo_user;

--
-- Name: passwords_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.passwords_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.passwords_id_seq OWNER TO alfabravo_user;

--
-- Name: passwords; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.passwords (
    id integer DEFAULT nextval('public.passwords_id_seq'::regclass) NOT NULL,
    user_id integer,
    password character varying(255),
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.passwords OWNER TO alfabravo_user;

--
-- Name: payment_account_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.payment_account_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.payment_account_id_seq OWNER TO alfabravo_user;

--
-- Name: payment_account; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.payment_account (
    id integer DEFAULT nextval('public.payment_account_id_seq'::regclass) NOT NULL,
    bank_id integer,
    account_number character varying(255),
    clabe character varying(255),
    card character varying(255),
    alias character varying(255),
    observations text,
    account_type integer,
    user_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    desactivated boolean,
    titular character varying(255)
);


ALTER TABLE public.payment_account OWNER TO alfabravo_user;

--
-- Name: payment_method_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.payment_method_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.payment_method_id_seq OWNER TO alfabravo_user;

--
-- Name: payment_method; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.payment_method (
    id integer DEFAULT nextval('public.payment_method_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description character varying(500),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.payment_method OWNER TO alfabravo_user;

--
-- Name: payrol_employee_control_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.payrol_employee_control_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.payrol_employee_control_id_seq OWNER TO alfabravo_user;

--
-- Name: payroll; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.payroll (
    id integer DEFAULT nextval('public.id_payroll_seq'::regclass) NOT NULL,
    year integer,
    period smallint,
    month smallint,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    status boolean DEFAULT false,
    q_factor real,
    d_factor real,
    user_id integer,
    generating_pdf boolean DEFAULT false,
    type smallint DEFAULT 1,
    start_week timestamp without time zone,
    end_week timestamp without time zone,
    nro integer
);


ALTER TABLE public.payroll OWNER TO alfabravo_user;

--
-- Name: payroll_cutoff_schedule_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.payroll_cutoff_schedule_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.payroll_cutoff_schedule_id_seq OWNER TO alfabravo_user;

--
-- Name: payroll_cutoff_schedule; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.payroll_cutoff_schedule (
    id integer DEFAULT nextval('public.payroll_cutoff_schedule_id_seq'::regclass) NOT NULL,
    day timestamp without time zone,
    payroll_type integer,
    created_at timestamp without time zone,
    deleted_at timestamp without time zone,
    label character varying(255),
    updated_at timestamp without time zone
);


ALTER TABLE public.payroll_cutoff_schedule OWNER TO alfabravo_user;

--
-- Name: payroll_employee; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.payroll_employee (
    id integer DEFAULT nextval('public.id_payroll_employee_seq'::regclass) NOT NULL,
    employee_id integer,
    daily_amount real,
    total_amount real,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    payroll_id integer,
    status boolean DEFAULT false,
    period_salary real,
    assistances real,
    bonus_amount real,
    discount_amount real,
    employee_ubication_id integer,
    employee_bank_data_id integer,
    user_id integer,
    check_assistances boolean DEFAULT false,
    check_perceptions boolean DEFAULT false,
    check_deductions boolean,
    imss_amount real DEFAULT 0,
    fimss boolean,
    fprod boolean
);


ALTER TABLE public.payroll_employee OWNER TO alfabravo_user;

--
-- Name: payroll_employee_bonus; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.payroll_employee_bonus (
    id integer DEFAULT nextval('public.id_payroll_employee_bonus_seq'::regclass) NOT NULL,
    amount real,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    payroll_employee_id integer,
    bonus_id integer,
    bonus_client_id integer,
    ref_amount real,
    valid boolean DEFAULT true,
    description text
);


ALTER TABLE public.payroll_employee_bonus OWNER TO alfabravo_user;

--
-- Name: payroll_employee_control; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.payroll_employee_control (
    id integer DEFAULT nextval('public.payrol_employee_control_id_seq'::regclass) NOT NULL,
    payroll_employee_id integer,
    salary real,
    productivity real,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    user_id integer
);


ALTER TABLE public.payroll_employee_control OWNER TO alfabravo_user;

--
-- Name: payroll_employee_discount; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.payroll_employee_discount (
    id integer DEFAULT nextval('public.id_payroll_employee_discount_seq'::regclass) NOT NULL,
    amount real,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    payroll_employee_id integer,
    discount_id integer,
    discount_employee_id integer,
    ref_amount real,
    valid boolean DEFAULT true,
    description text
);


ALTER TABLE public.payroll_employee_discount OWNER TO alfabravo_user;

--
-- Name: payroll_employee_files_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.payroll_employee_files_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.payroll_employee_files_id_seq OWNER TO alfabravo_user;

--
-- Name: payroll_employee_files; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.payroll_employee_files (
    id integer DEFAULT nextval('public.payroll_employee_files_id_seq'::regclass) NOT NULL,
    payroll_employee_id integer,
    filename character varying(255),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    file_type_id integer,
    document_name text
);


ALTER TABLE public.payroll_employee_files OWNER TO alfabravo_user;

--
-- Name: payroll_software_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.payroll_software_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.payroll_software_id_seq OWNER TO alfabravo_user;

--
-- Name: payroll_software; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.payroll_software (
    id integer DEFAULT nextval('public.payroll_software_id_seq'::regclass) NOT NULL,
    name character varying(300),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone,
    description character varying(1000)
);


ALTER TABLE public.payroll_software OWNER TO alfabravo_user;

--
-- Name: periodicity_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.periodicity_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.periodicity_id_seq OWNER TO alfabravo_user;

--
-- Name: periodicity; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.periodicity (
    id integer DEFAULT nextval('public.periodicity_id_seq'::regclass) NOT NULL,
    name character varying(255),
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    user_id integer
);


ALTER TABLE public.periodicity OWNER TO alfabravo_user;

--
-- Name: permissions; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.permissions (
    id bigint NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    slug character varying(255),
    name character varying(255)
);


ALTER TABLE public.permissions OWNER TO alfabravo_user;

--
-- Name: permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.permissions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.permissions_id_seq OWNER TO alfabravo_user;

--
-- Name: permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.permissions_id_seq OWNED BY public.permissions.id;


--
-- Name: person_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.person_type (
    id integer NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone
);


ALTER TABLE public.person_type OWNER TO alfabravo_user;

--
-- Name: person_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.person_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.person_type_id_seq OWNER TO alfabravo_user;

--
-- Name: person_type_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.person_type_id_seq OWNED BY public.person_type.id;


--
-- Name: personal; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.personal (
    id integer NOT NULL,
    name character varying(255),
    middle_name character varying(255),
    last_name character varying(255),
    birthdate date,
    work_position_id integer,
    scholarship_id integer,
    phones text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    photo character varying(255),
    rfc character varying(255),
    country_code integer,
    curp character varying(255),
    imss character varying(255),
    blood_type character varying(255),
    birthplace character varying(255),
    photoleft character varying(255),
    photoright character varying(255),
    marital_status_id integer,
    deleted_at timestamp(6) without time zone,
    type_social_security_id integer,
    emails character varying(1000),
    iso_nac character varying DEFAULT 'MEX'::character varying,
    weight double precision,
    height integer,
    dependents integer,
    number_children integer,
    credential_number character varying(255),
    emergency_contact character varying(300),
    relationship_contact character varying(300),
    sex character varying(10),
    status character varying(255),
    reasons text,
    emergency_contact_phone character varying(255),
    work_position_experience boolean,
    work_position_capacitation boolean,
    work_position_experience_objs text,
    work_position_capacitation_obs text,
    password character varying(255),
    beneficiary_name text,
    beneficiary_phone text,
    beneficiary_relationship text,
    beneficiary_old_age boolean,
    is_contact_beneficiary boolean,
    schoolname text,
    school_average text,
    elector_key text,
    militar_letter_number text,
    type_house text,
    licence_number text,
    dependends_items text,
    ref_family text,
    ref_parents text,
    ref_personal text,
    ref_labor text,
    sport_activity text,
    cuip text,
    folio_cuip text,
    licence_vigency text,
    status_result_date timestamp(6) without time zone,
    status_result_reason text,
    status_result_observations text,
    how_arrived integer,
    how_arrived_relationship integer,
    personal_how_arrived_relationship text,
    use_glasses boolean,
    study_specialty text,
    profesional_cedule text,
    no_folio_certificate text,
    sep_registry text,
    scolarship_start_date timestamp(0) without time zone,
    scolarship_end_date timestamp(0) without time zone,
    fixed_phone text,
    ear_issue_obs text,
    ear_issue boolean
);


ALTER TABLE public.personal OWNER TO alfabravo_user;

--
-- Name: personal_address; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.personal_address (
    id integer DEFAULT nextval('public.id_personal_address_seq'::regclass) NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    city_id integer,
    cp character varying(255),
    personal_id integer,
    address character varying(500),
    address_between text
);


ALTER TABLE public.personal_address OWNER TO alfabravo_user;

--
-- Name: personal_allergy_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.personal_allergy_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.personal_allergy_id_seq OWNER TO alfabravo_user;

--
-- Name: personal_allergy; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.personal_allergy (
    id integer DEFAULT nextval('public.personal_allergy_id_seq'::regclass) NOT NULL,
    personal_id integer,
    allergy_id integer,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone
);


ALTER TABLE public.personal_allergy OWNER TO alfabravo_user;

--
-- Name: personal_bank_data; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.personal_bank_data (
    id integer NOT NULL,
    personal_id integer,
    bank_id integer,
    account_number character varying(255),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    interbank_key character varying(255),
    card_number character varying(255),
    observations character varying(255)
);


ALTER TABLE public.personal_bank_data OWNER TO alfabravo_user;

--
-- Name: personal_bank_data_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.personal_bank_data_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.personal_bank_data_id_seq OWNER TO alfabravo_user;

--
-- Name: personal_bank_data_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.personal_bank_data_id_seq OWNED BY public.personal_bank_data.id;


--
-- Name: personal_bank_data_id_seq_33; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.personal_bank_data_id_seq_33
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.personal_bank_data_id_seq_33 OWNER TO alfabravo_user;

--
-- Name: personal_bank_data_id_seq_333; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.personal_bank_data_id_seq_333
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.personal_bank_data_id_seq_333 OWNER TO alfabravo_user;

--
-- Name: personal_documents; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.personal_documents (
    id integer NOT NULL,
    personal_id integer,
    curp character varying(255),
    birth_certificate character varying(255),
    ife_ine_certificate character varying(255),
    driver_licence character varying(255),
    militar_letter character varying(255),
    proof_of_address character varying(255),
    no_criminal_record character varying(255),
    imss character varying(255),
    last_study_certificate character varying(255),
    other_important_records character varying(255),
    rfc character varying(255),
    cv character varying(255),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone
);


ALTER TABLE public.personal_documents OWNER TO alfabravo_user;

--
-- Name: personal_economic_dinamic; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.personal_economic_dinamic (
    id integer NOT NULL,
    personal_id integer,
    concept_id integer,
    mount real,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone
);


ALTER TABLE public.personal_economic_dinamic OWNER TO alfabravo_user;

--
-- Name: personal_emergency_contact; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.personal_emergency_contact (
    id integer NOT NULL,
    personal_id integer,
    name character varying(255),
    middle_name character varying(255),
    last_name character varying(255),
    relationship integer,
    phones character varying(255),
    email character varying(255),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone
);


ALTER TABLE public.personal_emergency_contact OWNER TO alfabravo_user;

--
-- Name: personal_emergency_contact_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.personal_emergency_contact_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.personal_emergency_contact_id_seq OWNER TO alfabravo_user;

--
-- Name: personal_emergency_contact_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.personal_emergency_contact_id_seq OWNED BY public.personal_emergency_contact.id;


--
-- Name: personal_exam_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.personal_exam_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.personal_exam_id_seq OWNER TO alfabravo_user;

--
-- Name: personal_exam; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.personal_exam (
    id integer DEFAULT nextval('public.personal_exam_id_seq'::regclass) NOT NULL,
    personal_id integer,
    exam_id integer,
    did_exam timestamp(6) without time zone,
    calification smallint,
    observations text,
    file character varying(255),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    user_id integer,
    duration integer
);


ALTER TABLE public.personal_exam OWNER TO alfabravo_user;

--
-- Name: personal_familiar_structure; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.personal_familiar_structure (
    id integer NOT NULL,
    name character varying(255),
    middle_name character varying(255),
    last_name character varying(255),
    ocupation_id integer,
    age integer,
    relationship_id integer,
    is_dependient integer,
    personal_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone
);


ALTER TABLE public.personal_familiar_structure OWNER TO alfabravo_user;

--
-- Name: personal_familiar_structure_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.personal_familiar_structure_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.personal_familiar_structure_id_seq OWNER TO alfabravo_user;

--
-- Name: personal_familiar_structure_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.personal_familiar_structure_id_seq OWNED BY public.personal_familiar_structure.id;


--
-- Name: personal_hired_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.personal_hired_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.personal_hired_id_seq OWNER TO alfabravo_user;

--
-- Name: personal_hired; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.personal_hired (
    id integer DEFAULT nextval('public.personal_hired_id_seq'::regclass) NOT NULL,
    personal_id integer,
    status character varying(255),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.personal_hired OWNER TO alfabravo_user;

--
-- Name: personal_home; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.personal_home (
    id integer NOT NULL,
    personal_id integer,
    home_shape_id integer,
    contruction_level integer,
    status integer,
    services text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone
);


ALTER TABLE public.personal_home OWNER TO alfabravo_user;

--
-- Name: personal_home_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.personal_home_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.personal_home_id_seq OWNER TO alfabravo_user;

--
-- Name: personal_home_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.personal_home_id_seq OWNED BY public.personal_home.id;


--
-- Name: personal_how_arrived_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.personal_how_arrived_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.personal_how_arrived_id_seq OWNER TO alfabravo_user;

--
-- Name: personal_how_arrived; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.personal_how_arrived (
    id integer DEFAULT nextval('public.personal_how_arrived_id_seq'::regclass) NOT NULL,
    name character varying(255),
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    user_id integer
);


ALTER TABLE public.personal_how_arrived OWNER TO alfabravo_user;

--
-- Name: personal_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.personal_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.personal_id_seq OWNER TO alfabravo_user;

--
-- Name: personal_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.personal_id_seq OWNED BY public.personal.id;


--
-- Name: personal_job_references; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.personal_job_references (
    id integer NOT NULL,
    personal_id integer,
    enterprise_id integer,
    phone character varying(255),
    contact character varying(255),
    starting_date date,
    ending_date date,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone
);


ALTER TABLE public.personal_job_references OWNER TO alfabravo_user;

--
-- Name: personal_job_references_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.personal_job_references_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.personal_job_references_id_seq OWNER TO alfabravo_user;

--
-- Name: personal_job_references_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.personal_job_references_id_seq OWNED BY public.personal_job_references.id;


--
-- Name: personal_personal_references; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.personal_personal_references (
    id integer NOT NULL,
    personal_id integer,
    name character varying(255),
    phones text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone
);


ALTER TABLE public.personal_personal_references OWNER TO alfabravo_user;

--
-- Name: personal_sickness_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.personal_sickness_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.personal_sickness_id_seq OWNER TO alfabravo_user;

--
-- Name: personal_sickness; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.personal_sickness (
    id integer DEFAULT nextval('public.personal_sickness_id_seq'::regclass) NOT NULL,
    personal_id integer,
    sickness_id integer,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone
);


ALTER TABLE public.personal_sickness OWNER TO alfabravo_user;

--
-- Name: personal_size_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.personal_size_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.personal_size_id_seq OWNER TO alfabravo_user;

--
-- Name: personal_size; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.personal_size (
    id integer DEFAULT nextval('public.personal_size_id_seq'::regclass) NOT NULL,
    personal_id integer,
    size_id integer,
    size_field integer,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone
);


ALTER TABLE public.personal_size OWNER TO alfabravo_user;

--
-- Name: personal_spoken_languages_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.personal_spoken_languages_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.personal_spoken_languages_id_seq OWNER TO alfabravo_user;

--
-- Name: personal_spoken_languages; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.personal_spoken_languages (
    id integer DEFAULT nextval('public.personal_spoken_languages_id_seq'::regclass) NOT NULL,
    personal_id integer,
    spoken_languages_id integer,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone
);


ALTER TABLE public.personal_spoken_languages OWNER TO alfabravo_user;

--
-- Name: product_articles_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.product_articles_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.product_articles_id_seq OWNER TO alfabravo_user;

--
-- Name: product_articles; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.product_articles (
    id integer DEFAULT nextval('public.product_articles_id_seq'::regclass) NOT NULL,
    name character varying(255),
    cost real,
    description text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    user_id integer
);


ALTER TABLE public.product_articles OWNER TO alfabravo_user;

--
-- Name: product_delivery_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.product_delivery_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.product_delivery_id_seq OWNER TO alfabravo_user;

--
-- Name: product_delivery; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.product_delivery (
    id integer DEFAULT nextval('public.product_delivery_id_seq'::regclass) NOT NULL,
    no_folio character varying(255),
    description text,
    enterprise_id integer,
    client_id integer,
    employee_id integer,
    delivery_date timestamp without time zone,
    delivery_by integer,
    received_by integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at time without time zone,
    user_id integer,
    received_by_name text
);


ALTER TABLE public.product_delivery OWNER TO alfabravo_user;

--
-- Name: product_delivery_item_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.product_delivery_item_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.product_delivery_item_id_seq OWNER TO alfabravo_user;

--
-- Name: product_delivery_item; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.product_delivery_item (
    id integer DEFAULT nextval('public.product_delivery_item_id_seq'::regclass) NOT NULL,
    description text,
    quantity integer,
    unit_id integer,
    unitary_cost real,
    extra_feature text,
    created_at timestamp without time zone,
    deleted_at timestamp without time zone,
    updated_at timestamp without time zone,
    user_id integer,
    product_delivery_id integer,
    type integer,
    article_id integer
);


ALTER TABLE public.product_delivery_item OWNER TO alfabravo_user;

--
-- Name: product_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.product_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.product_id_seq OWNER TO alfabravo_user;

--
-- Name: provider_has_bank_data_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.provider_has_bank_data_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.provider_has_bank_data_id_seq OWNER TO alfabravo_user;

--
-- Name: provider_has_bank_data; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.provider_has_bank_data (
    id integer DEFAULT nextval('public.provider_has_bank_data_id_seq'::regclass) NOT NULL,
    provider_id integer,
    account character varying(255),
    inter_bank_clabe character varying(255),
    card character varying(255),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    bank_id integer,
    titular text,
    account_type integer
);


ALTER TABLE public.provider_has_bank_data OWNER TO alfabravo_user;

--
-- Name: providers_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.providers_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.providers_id_seq OWNER TO alfabravo_user;

--
-- Name: providers; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.providers (
    id integer DEFAULT nextval('public.providers_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    logo character varying(255),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    rfc character varying(255),
    type smallint,
    fixed_cost_include integer
);


ALTER TABLE public.providers OWNER TO alfabravo_user;

--
-- Name: quiz_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.quiz_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.quiz_id_seq OWNER TO alfabravo_user;

--
-- Name: quiz; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.quiz (
    id integer DEFAULT nextval('public.quiz_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone,
    user_id integer,
    show_all boolean,
    cant_question_page integer,
    interview integer,
    roles text,
    num_attempts integer DEFAULT 1,
    desactivated boolean
);


ALTER TABLE public.quiz OWNER TO alfabravo_user;

--
-- Name: quiz_answer_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.quiz_answer_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.quiz_answer_id_seq OWNER TO alfabravo_user;

--
-- Name: quiz_answer; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.quiz_answer (
    id integer DEFAULT nextval('public.quiz_answer_id_seq'::regclass) NOT NULL,
    quiz_id integer,
    user_id integer,
    question_id integer,
    value text,
    "time" integer,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone,
    attemp_id integer,
    observations text
);


ALTER TABLE public.quiz_answer OWNER TO alfabravo_user;

--
-- Name: quiz_attemp_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.quiz_attemp_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.quiz_attemp_id_seq OWNER TO alfabravo_user;

--
-- Name: quiz_attempt; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.quiz_attempt (
    id integer DEFAULT nextval('public.quiz_attemp_id_seq'::regclass) NOT NULL,
    quiz_id integer,
    user_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    number integer,
    num_attempts integer,
    lesson_id integer,
    status integer,
    approved boolean,
    observations text,
    employee_id integer
);


ALTER TABLE public.quiz_attempt OWNER TO alfabravo_user;

--
-- Name: quiz_attempt_answer_files_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.quiz_attempt_answer_files_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.quiz_attempt_answer_files_id_seq OWNER TO alfabravo_user;

--
-- Name: quiz_attempt_answer_files; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.quiz_attempt_answer_files (
    files_id integer DEFAULT nextval('public.quiz_attempt_answer_files_id_seq'::regclass) NOT NULL,
    filename character varying(255),
    document_name text,
    quiz_attempt_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.quiz_attempt_answer_files OWNER TO alfabravo_user;

--
-- Name: quiz_question_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.quiz_question_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.quiz_question_id_seq OWNER TO alfabravo_user;

--
-- Name: quiz_question; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.quiz_question (
    id integer DEFAULT nextval('public.quiz_question_id_seq'::regclass) NOT NULL,
    question_body text,
    quiz_id integer,
    type character varying(255),
    value character varying(255),
    correct_value character varying(255),
    "time" integer,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone
);


ALTER TABLE public.quiz_question OWNER TO alfabravo_user;

--
-- Name: quiz_question_option_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.quiz_question_option_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.quiz_question_option_id_seq OWNER TO alfabravo_user;

--
-- Name: quiz_question_option; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.quiz_question_option (
    id integer DEFAULT nextval('public.quiz_question_option_id_seq'::regclass) NOT NULL,
    name text,
    question_id integer,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone,
    correct_value boolean
);


ALTER TABLE public.quiz_question_option OWNER TO alfabravo_user;

--
-- Name: quoter_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.quoter_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.quoter_id_seq OWNER TO alfabravo_user;

--
-- Name: quoter; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.quoter (
    id integer DEFAULT nextval('public.quoter_id_seq'::regclass) NOT NULL,
    type integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    user_id integer
);


ALTER TABLE public.quoter OWNER TO alfabravo_user;

--
-- Name: rating_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.rating_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.rating_id_seq OWNER TO alfabravo_user;

--
-- Name: recibos_fiscales_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.recibos_fiscales_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.recibos_fiscales_id_seq OWNER TO alfabravo_user;

--
-- Name: recruitment_type_file_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.recruitment_type_file_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.recruitment_type_file_id_seq OWNER TO alfabravo_user;

--
-- Name: recruitment_file_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.recruitment_file_type (
    id integer DEFAULT nextval('public.recruitment_type_file_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.recruitment_file_type OWNER TO alfabravo_user;

--
-- Name: recruitment_files_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.recruitment_files_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.recruitment_files_id_seq OWNER TO alfabravo_user;

--
-- Name: recruitment_files; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.recruitment_files (
    id integer DEFAULT nextval('public.recruitment_files_id_seq'::regclass) NOT NULL,
    filename character varying(255),
    document_name character varying(255),
    personal_id integer,
    type_file_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.recruitment_files OWNER TO alfabravo_user;

--
-- Name: recruitment_status_reason_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.recruitment_status_reason_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.recruitment_status_reason_id_seq OWNER TO alfabravo_user;

--
-- Name: recruitment_status_reason; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.recruitment_status_reason (
    id integer DEFAULT nextval('public.recruitment_status_reason_id_seq'::regclass) NOT NULL,
    name text,
    observation text,
    type integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.recruitment_status_reason OWNER TO alfabravo_user;

--
-- Name: register_status_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.register_status_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.register_status_id_seq OWNER TO alfabravo_user;

--
-- Name: register_status; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.register_status (
    id integer DEFAULT nextval('public.register_status_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description character varying(500),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.register_status OWNER TO alfabravo_user;

--
-- Name: resource_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.resource_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.resource_type_id_seq OWNER TO alfabravo_user;

--
-- Name: resource_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.resource_type (
    id integer DEFAULT nextval('public.resource_type_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    finance boolean,
    unitary_price numeric(10,2),
    resource_type_id integer,
    tax_deduction boolean,
    provider_id integer,
    warehouse boolean,
    code character varying(255)
);


ALTER TABLE public.resource_type OWNER TO alfabravo_user;

--
-- Name: resource_type_price_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.resource_type_price_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.resource_type_price_id_seq OWNER TO alfabravo_user;

--
-- Name: resource_type_price; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.resource_type_price (
    id integer DEFAULT nextval('public.resource_type_price_id_seq'::regclass) NOT NULL,
    price numeric(10,2),
    resource_type_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.resource_type_price OWNER TO alfabravo_user;

--
-- Name: resource_type_provider_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.resource_type_provider_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.resource_type_provider_id_seq OWNER TO alfabravo_user;

--
-- Name: resource_type_provider; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.resource_type_provider (
    id integer DEFAULT nextval('public.resource_type_provider_id_seq'::regclass) NOT NULL,
    article_id integer,
    provider_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.resource_type_provider OWNER TO alfabravo_user;

--
-- Name: resource_type_request_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.resource_type_request_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.resource_type_request_id_seq OWNER TO alfabravo_user;

--
-- Name: resource_type_request; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.resource_type_request (
    id integer DEFAULT nextval('public.resource_type_request_id_seq'::regclass) NOT NULL,
    user_id integer,
    resource_id integer,
    resquest boolean,
    condition character varying(255),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.resource_type_request OWNER TO alfabravo_user;

--
-- Name: roles; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.roles (
    id bigint NOT NULL,
    name character varying(191) NOT NULL,
    slug character varying(191) NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.roles OWNER TO alfabravo_user;

--
-- Name: roles_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.roles_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.roles_id_seq OWNER TO alfabravo_user;

--
-- Name: roles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.roles_id_seq OWNED BY public.roles.id;


--
-- Name: roles_permissions; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.roles_permissions (
    role_id integer NOT NULL,
    permission_id integer NOT NULL
);


ALTER TABLE public.roles_permissions OWNER TO alfabravo_user;

--
-- Name: rondin_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.rondin_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.rondin_id_seq OWNER TO alfabravo_user;

--
-- Name: rondin; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.rondin (
    id integer DEFAULT nextval('public.rondin_id_seq'::regclass) NOT NULL,
    id_employee integer,
    file character varying(255),
    observation text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    office_id integer,
    zone_id integer,
    rondin_datetime timestamp(6) without time zone,
    user_id integer,
    slogan_id integer,
    status integer,
    rondin_id integer,
    places text,
    frecuency integer,
    title text
);


ALTER TABLE public.rondin OWNER TO alfabravo_user;

--
-- Name: rondin_config_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.rondin_config_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.rondin_config_id_seq OWNER TO alfabravo_user;

--
-- Name: rondin_config; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.rondin_config (
    id integer DEFAULT nextval('public.rondin_config_id_seq'::regclass) NOT NULL,
    datetime timestamp without time zone,
    employee_id integer,
    frecuency_round integer,
    rondin_id integer,
    observations text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    user_id integer,
    datetime_end timestamp without time zone,
    status integer
);


ALTER TABLE public.rondin_config OWNER TO alfabravo_user;

--
-- Name: rondin_file_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.rondin_file_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.rondin_file_id_seq OWNER TO alfabravo_user;

--
-- Name: rondin_file; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.rondin_file (
    id integer DEFAULT nextval('public.rondin_file_id_seq'::regclass) NOT NULL,
    rondin_id integer,
    round_id integer,
    rondin_place_id integer,
    file character varying(255),
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    document_name character varying(255)
);


ALTER TABLE public.rondin_file OWNER TO alfabravo_user;

--
-- Name: rondin_log_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.rondin_log_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.rondin_log_id_seq OWNER TO alfabravo_user;

--
-- Name: rondin_log; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.rondin_log (
    id integer DEFAULT nextval('public.rondin_log_id_seq'::regclass) NOT NULL,
    rondin_place integer,
    observations text,
    status integer,
    attachments text,
    employee_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    rondin_id integer,
    round_id integer,
    gps text
);


ALTER TABLE public.rondin_log OWNER TO alfabravo_user;

--
-- Name: rondin_round_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.rondin_round_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.rondin_round_id_seq OWNER TO alfabravo_user;

--
-- Name: rondin_round; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.rondin_round (
    id integer DEFAULT nextval('public.rondin_round_id_seq'::regclass) NOT NULL,
    rondin_id integer,
    employee_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    rondin_start_time timestamp without time zone,
    rondin_end_time timestamp without time zone,
    comments text,
    attachments text,
    openned boolean,
    name character varying(255)
);


ALTER TABLE public.rondin_round OWNER TO alfabravo_user;

--
-- Name: rondin_round_frecuency_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.rondin_round_frecuency_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.rondin_round_frecuency_id_seq OWNER TO alfabravo_user;

--
-- Name: rondin_round_frecuency; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.rondin_round_frecuency (
    id integer DEFAULT nextval('public.rondin_round_frecuency_id_seq'::regclass) NOT NULL,
    name character varying(255),
    value integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.rondin_round_frecuency OWNER TO alfabravo_user;

--
-- Name: rondin_trace_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.rondin_trace_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.rondin_trace_id_seq OWNER TO alfabravo_user;

--
-- Name: rondin_trace; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.rondin_trace (
    id integer DEFAULT nextval('public.rondin_trace_id_seq'::regclass) NOT NULL,
    place_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    rondin_id integer
);


ALTER TABLE public.rondin_trace OWNER TO alfabravo_user;

--
-- Name: route_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.route_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.route_id_seq OWNER TO alfabravo_user;

--
-- Name: route; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.route (
    id integer DEFAULT nextval('public.route_id_seq'::regclass) NOT NULL,
    route_id character varying(255),
    start text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    "end" text,
    average_mileage integer,
    overnight integer,
    stays integer,
    cost real DEFAULT 0
);


ALTER TABLE public.route OWNER TO alfabravo_user;

--
-- Name: route_client; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.route_client (
    route_id integer NOT NULL,
    client_id integer NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone
);


ALTER TABLE public.route_client OWNER TO alfabravo_user;

--
-- Name: rrhh_requirement_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.rrhh_requirement_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.rrhh_requirement_id_seq OWNER TO alfabravo_user;

--
-- Name: rrhh_requirement; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.rrhh_requirement (
    id integer DEFAULT nextval('public.rrhh_requirement_id_seq'::regclass) NOT NULL,
    position_to_cover integer,
    number_personal integer,
    skills text,
    experience_level text,
    needs text,
    location text,
    when_need_to_be_cover text,
    area_id integer,
    client_id integer,
    observations text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    user_id integer,
    enterprise_id integer,
    salary_horary text,
    main_activities text,
    attachment text,
    necesary_resources text,
    init_labor text
);


ALTER TABLE public.rrhh_requirement OWNER TO alfabravo_user;

--
-- Name: sales_order_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.sales_order_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.sales_order_id_seq OWNER TO alfabravo_user;

--
-- Name: sales_order; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.sales_order (
    id integer DEFAULT nextval('public.sales_order_id_seq'::regclass) NOT NULL,
    request_date timestamp(6) without time zone,
    justification text,
    payment_way_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    code character varying(255),
    user_id integer,
    category_id integer,
    enterprise_pay_id integer,
    requesterable_type character varying(191),
    requesterable_id integer
);


ALTER TABLE public.sales_order OWNER TO alfabravo_user;

--
-- Name: sales_order_files_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.sales_order_files_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.sales_order_files_id_seq OWNER TO alfabravo_user;

--
-- Name: sales_order_files; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.sales_order_files (
    id integer DEFAULT nextval('public.sales_order_files_id_seq'::regclass) NOT NULL,
    order_id integer,
    filename character varying(255),
    document_name character varying,
    status_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.sales_order_files OWNER TO alfabravo_user;

--
-- Name: sales_order_item_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.sales_order_item_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.sales_order_item_id_seq OWNER TO alfabravo_user;

--
-- Name: sales_order_item; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.sales_order_item (
    id integer DEFAULT nextval('public.sales_order_item_id_seq'::regclass) NOT NULL,
    charge_to_model character varying(255),
    charge_to_model_id integer,
    quantity integer,
    measure_unit_id integer,
    unit_cost numeric(10,2),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    sales_order_id integer,
    provider_id integer,
    iva boolean,
    iva2 boolean,
    iva_value real,
    element_type character varying(191),
    item_id integer
);


ALTER TABLE public.sales_order_item OWNER TO alfabravo_user;

--
-- Name: sales_order_payment_way_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.sales_order_payment_way_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.sales_order_payment_way_id_seq OWNER TO alfabravo_user;

--
-- Name: sales_order_payment_way; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.sales_order_payment_way (
    id integer DEFAULT nextval('public.sales_order_payment_way_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description character varying(255),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.sales_order_payment_way OWNER TO alfabravo_user;

--
-- Name: sales_order_status_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.sales_order_status_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.sales_order_status_id_seq OWNER TO alfabravo_user;

--
-- Name: sales_order_status; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.sales_order_status (
    id integer DEFAULT nextval('public.sales_order_status_id_seq'::regclass) NOT NULL,
    status integer,
    observation text,
    user_id integer,
    sales_order_id integer,
    deleted_at timestamp without time zone,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    extra_data text
);


ALTER TABLE public.sales_order_status OWNER TO alfabravo_user;

--
-- Name: sales_order_unit_measure_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.sales_order_unit_measure_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.sales_order_unit_measure_id_seq OWNER TO alfabravo_user;

--
-- Name: sales_order_unit_measure; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.sales_order_unit_measure (
    id integer DEFAULT nextval('public.sales_order_unit_measure_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.sales_order_unit_measure OWNER TO alfabravo_user;

--
-- Name: scolarship_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.scolarship_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.scolarship_id_seq OWNER TO alfabravo_user;

--
-- Name: scolarship; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.scolarship (
    id integer DEFAULT nextval('public.scolarship_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.scolarship OWNER TO alfabravo_user;

--
-- Name: service_order; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.service_order (
    id integer NOT NULL,
    order_number integer,
    date date,
    consumer integer,
    kilometers character varying(255),
    hours character varying(255),
    fuel character varying(255),
    asesor integer,
    received_date timestamp(6) without time zone,
    delivered_date timestamp(6) without time zone,
    payment_way integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    base integer,
    vehicle_id integer,
    status character varying
);


ALTER TABLE public.service_order OWNER TO alfabravo_user;

--
-- Name: service_order_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.service_order_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.service_order_id_seq OWNER TO alfabravo_user;

--
-- Name: service_order_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.service_order_id_seq OWNED BY public.service_order.id;


--
-- Name: service_order_work; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.service_order_work (
    id integer NOT NULL,
    service_order_id integer,
    vehicle_type_service_id integer,
    workforce_description text,
    refaction character varying(255),
    refaction_part_number character varying(255),
    refaction_description text,
    refaction_quantity integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    approximately_elapsed_time double precision,
    refaction_unitary_price double precision,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.service_order_work OWNER TO alfabravo_user;

--
-- Name: service_order_work_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.service_order_work_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.service_order_work_id_seq OWNER TO alfabravo_user;

--
-- Name: service_order_work_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.service_order_work_id_seq OWNED BY public.service_order_work.id;


--
-- Name: service_order_work_refaction_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.service_order_work_refaction_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.service_order_work_refaction_id_seq OWNER TO alfabravo_user;

--
-- Name: service_order_work_refaction; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.service_order_work_refaction (
    id integer DEFAULT nextval('public.service_order_work_refaction_id_seq'::regclass) NOT NULL,
    name character varying(255),
    part_number character varying(255),
    description character varying(500),
    quantity integer,
    unitary_price double precision,
    service_order_work_id integer,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.service_order_work_refaction OWNER TO alfabravo_user;

--
-- Name: settings; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.settings (
    id integer NOT NULL,
    param character varying(255),
    var character varying(255),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    value character varying(500),
    group1 character varying(255),
    type character varying(255),
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.settings OWNER TO alfabravo_user;

--
-- Name: settings_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.settings_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.settings_id_seq OWNER TO alfabravo_user;

--
-- Name: settings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.settings_id_seq OWNED BY public.settings.id;


--
-- Name: sickness_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.sickness_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.sickness_id_seq OWNER TO alfabravo_user;

--
-- Name: sickness; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.sickness (
    id integer DEFAULT nextval('public.sickness_id_seq'::regclass) NOT NULL,
    name character varying,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.sickness OWNER TO alfabravo_user;

--
-- Name: size_field_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.size_field_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.size_field_id_seq OWNER TO alfabravo_user;

--
-- Name: size_field; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.size_field (
    id integer DEFAULT nextval('public.size_field_id_seq'::regclass) NOT NULL,
    name character varying(300),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone
);


ALTER TABLE public.size_field OWNER TO alfabravo_user;

--
-- Name: size_field_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.size_field_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.size_field_type_id_seq OWNER TO alfabravo_user;

--
-- Name: size_field_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.size_field_type (
    id integer DEFAULT nextval('public.size_field_type_id_seq'::regclass) NOT NULL,
    size_id integer,
    size_field integer,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone
);


ALTER TABLE public.size_field_type OWNER TO alfabravo_user;

--
-- Name: size_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.size_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.size_type_id_seq OWNER TO alfabravo_user;

--
-- Name: size_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.size_type (
    id integer DEFAULT nextval('public.size_type_id_seq'::regclass) NOT NULL,
    name character varying(300),
    modules character varying(1000),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone
);


ALTER TABLE public.size_type OWNER TO alfabravo_user;

--
-- Name: slide_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.slide_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.slide_id_seq OWNER TO alfabravo_user;

--
-- Name: spoken_languages; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.spoken_languages (
    id integer NOT NULL,
    name character varying(255),
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone
);


ALTER TABLE public.spoken_languages OWNER TO alfabravo_user;

--
-- Name: spoken_languages_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.spoken_languages_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.spoken_languages_id_seq OWNER TO alfabravo_user;

--
-- Name: spoken_languages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.spoken_languages_id_seq OWNED BY public.spoken_languages.id;


--
-- Name: state; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.state (
    id integer NOT NULL,
    name character varying(255),
    key character varying(255),
    country_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone
);


ALTER TABLE public.state OWNER TO alfabravo_user;

--
-- Name: state_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.state_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.state_id_seq OWNER TO alfabravo_user;

--
-- Name: state_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.state_id_seq OWNED BY public.state.id;


--
-- Name: status_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.status_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.status_id_seq OWNER TO alfabravo_user;

--
-- Name: status; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.status (
    id integer DEFAULT nextval('public.status_id_seq'::regclass) NOT NULL,
    name character varying(255),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    section character varying(191),
    code integer
);


ALTER TABLE public.status OWNER TO alfabravo_user;

--
-- Name: symbology_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.symbology_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.symbology_id_seq OWNER TO alfabravo_user;

--
-- Name: symbology; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.symbology (
    id integer DEFAULT nextval('public.symbology_id_seq'::regclass) NOT NULL,
    name character varying,
    code character varying,
    color character varying,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone,
    register_date timestamp(0) without time zone
);


ALTER TABLE public.symbology OWNER TO alfabravo_user;

--
-- Name: task_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.task_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.task_id_seq OWNER TO alfabravo_user;

--
-- Name: task; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.task (
    id integer DEFAULT nextval('public.task_id_seq'::regclass) NOT NULL,
    title character varying(500),
    description text,
    completation integer,
    status integer,
    user_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    start timestamp without time zone,
    "end" timestamp without time zone,
    color character varying(255),
    fullday boolean,
    responsible_id integer
);


ALTER TABLE public.task OWNER TO alfabravo_user;

--
-- Name: task_action_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.task_action_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.task_action_id_seq OWNER TO alfabravo_user;

--
-- Name: task_action; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.task_action (
    id integer DEFAULT nextval('public.task_action_id_seq'::regclass) NOT NULL,
    text text,
    user_id integer,
    task_id integer,
    attachment text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.task_action OWNER TO alfabravo_user;

--
-- Name: task_member_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.task_member_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.task_member_id_seq OWNER TO alfabravo_user;

--
-- Name: task_member; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.task_member (
    id integer DEFAULT nextval('public.task_member_id_seq'::regclass) NOT NULL,
    member_id integer,
    task_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at time without time zone
);


ALTER TABLE public.task_member OWNER TO alfabravo_user;

--
-- Name: tax_receipts; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.tax_receipts (
    id integer DEFAULT nextval('public.recibos_fiscales_id_seq'::regclass) NOT NULL,
    year integer,
    month integer,
    fortnight integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    user_id integer
);


ALTER TABLE public.tax_receipts OWNER TO alfabravo_user;

--
-- Name: tax_receipts_files_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.tax_receipts_files_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.tax_receipts_files_id_seq OWNER TO alfabravo_user;

--
-- Name: tax_receipts_files; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.tax_receipts_files (
    id integer DEFAULT nextval('public.tax_receipts_files_id_seq'::regclass) NOT NULL,
    employee_id integer,
    file character varying(255),
    tax_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at time without time zone
);


ALTER TABLE public.tax_receipts_files OWNER TO alfabravo_user;

--
-- Name: techinical_report_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.techinical_report_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.techinical_report_id_seq OWNER TO alfabravo_user;

--
-- Name: technical_report; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.technical_report (
    id integer DEFAULT nextval('public.techinical_report_id_seq'::regclass) NOT NULL,
    subject text,
    description text,
    justification text,
    area_id integer,
    enterprise_id integer,
    folio character varying,
    user_id integer,
    last_status integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    tentative_date timestamp without time zone,
    resolution_date timestamp without time zone,
    employee_id integer,
    user_to integer
);


ALTER TABLE public.technical_report OWNER TO alfabravo_user;

--
-- Name: technical_report_calification_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.technical_report_calification_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.technical_report_calification_id_seq OWNER TO alfabravo_user;

--
-- Name: technical_report_calification; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.technical_report_calification (
    id integer DEFAULT nextval('public.technical_report_calification_id_seq'::regclass) NOT NULL,
    report_id integer,
    observation text,
    user_id integer,
    option_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.technical_report_calification OWNER TO alfabravo_user;

--
-- Name: technical_report_id_seq_files; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.technical_report_id_seq_files
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.technical_report_id_seq_files OWNER TO alfabravo_user;

--
-- Name: technical_report_files; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.technical_report_files (
    files_id integer DEFAULT nextval('public.technical_report_id_seq_files'::regclass) NOT NULL,
    filename character varying(255),
    document_name text,
    technical_report_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.technical_report_files OWNER TO alfabravo_user;

--
-- Name: technical_report_modifications_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.technical_report_modifications_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.technical_report_modifications_id_seq OWNER TO alfabravo_user;

--
-- Name: technical_report_modifications; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.technical_report_modifications (
    id integer DEFAULT nextval('public.technical_report_modifications_id_seq'::regclass) NOT NULL,
    subject character varying(512),
    description text,
    tentative_date timestamp without time zone,
    resolution_date timestamp without time zone,
    technical_report_id integer,
    user_id integer,
    enterprise_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    folio character varying(256)
);


ALTER TABLE public.technical_report_modifications OWNER TO alfabravo_user;

--
-- Name: technical_report_status_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.technical_report_status_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.technical_report_status_id_seq OWNER TO alfabravo_user;

--
-- Name: technical_report_status; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.technical_report_status (
    id integer DEFAULT nextval('public.technical_report_status_id_seq'::regclass) NOT NULL,
    report_id integer,
    observation text,
    user_id integer,
    status_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    reply_id integer
);


ALTER TABLE public.technical_report_status OWNER TO alfabravo_user;

--
-- Name: technical_report_status_files_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.technical_report_status_files_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.technical_report_status_files_id_seq OWNER TO alfabravo_user;

--
-- Name: technical_report_status_files; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.technical_report_status_files (
    files_id integer DEFAULT nextval('public.technical_report_status_files_id_seq'::regclass) NOT NULL,
    filename character varying(255),
    document_name text,
    technical_report_status_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.technical_report_status_files OWNER TO alfabravo_user;

--
-- Name: terms_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.terms_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.terms_id_seq OWNER TO alfabravo_user;

--
-- Name: terms; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.terms (
    id integer DEFAULT nextval('public.terms_id_seq'::regclass) NOT NULL,
    title character varying(255),
    version integer,
    content text,
    current boolean,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.terms OWNER TO alfabravo_user;

--
-- Name: trace_slogan_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.trace_slogan_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.trace_slogan_id_seq OWNER TO alfabravo_user;

--
-- Name: trace_slogan; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.trace_slogan (
    id integer DEFAULT nextval('public.trace_slogan_id_seq'::regclass) NOT NULL,
    name text,
    description text,
    function_id integer,
    evaluation_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone,
    client_id integer,
    "default" boolean,
    frecuency_id integer,
    report_id integer,
    start timestamp without time zone,
    duration integer,
    type_id integer
);


ALTER TABLE public.trace_slogan OWNER TO alfabravo_user;

--
-- Name: trace_slogan_client_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.trace_slogan_client_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.trace_slogan_client_id_seq OWNER TO alfabravo_user;

--
-- Name: trace_slogan_client; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.trace_slogan_client (
    id integer DEFAULT nextval('public.trace_slogan_client_id_seq'::regclass) NOT NULL,
    client_id integer,
    slogan_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.trace_slogan_client OWNER TO alfabravo_user;

--
-- Name: trace_slogan_evaluation_criteria_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.trace_slogan_evaluation_criteria_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.trace_slogan_evaluation_criteria_id_seq OWNER TO alfabravo_user;

--
-- Name: trace_slogan_evaluation_criteria; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.trace_slogan_evaluation_criteria (
    id integer DEFAULT nextval('public.trace_slogan_evaluation_criteria_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.trace_slogan_evaluation_criteria OWNER TO alfabravo_user;

--
-- Name: trace_slogan_frecuency_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.trace_slogan_frecuency_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.trace_slogan_frecuency_id_seq OWNER TO alfabravo_user;

--
-- Name: trace_slogan_frecuency; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.trace_slogan_frecuency (
    id integer DEFAULT nextval('public.trace_slogan_frecuency_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.trace_slogan_frecuency OWNER TO alfabravo_user;

--
-- Name: trace_slogan_function_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.trace_slogan_function_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.trace_slogan_function_id_seq OWNER TO alfabravo_user;

--
-- Name: trace_slogan_function; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.trace_slogan_function (
    id integer DEFAULT nextval('public.trace_slogan_function_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.trace_slogan_function OWNER TO alfabravo_user;

--
-- Name: trace_slogan_has_function_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.trace_slogan_has_function_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.trace_slogan_has_function_id_seq OWNER TO alfabravo_user;

--
-- Name: trace_slogan_has_function; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.trace_slogan_has_function (
    id integer DEFAULT nextval('public.trace_slogan_has_function_id_seq'::regclass) NOT NULL,
    slogan_id integer,
    function_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.trace_slogan_has_function OWNER TO alfabravo_user;

--
-- Name: trace_slogan_report_id_seq3; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.trace_slogan_report_id_seq3
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.trace_slogan_report_id_seq3 OWNER TO alfabravo_user;

--
-- Name: trace_slogan_report; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.trace_slogan_report (
    id integer DEFAULT nextval('public.trace_slogan_report_id_seq3'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.trace_slogan_report OWNER TO alfabravo_user;

--
-- Name: trace_slogan_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.trace_slogan_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.trace_slogan_type_id_seq OWNER TO alfabravo_user;

--
-- Name: trace_slogan_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.trace_slogan_type (
    id integer DEFAULT nextval('public.trace_slogan_type_id_seq'::regclass) NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.trace_slogan_type OWNER TO alfabravo_user;

--
-- Name: transport_company_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.transport_company_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.transport_company_id_seq OWNER TO alfabravo_user;

--
-- Name: transport_company; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.transport_company (
    id integer DEFAULT nextval('public.transport_company_id_seq'::regclass) NOT NULL,
    name character varying(300),
    description character varying(1000),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone
);


ALTER TABLE public.transport_company OWNER TO alfabravo_user;

--
-- Name: type_social_security_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.type_social_security_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.type_social_security_id_seq OWNER TO alfabravo_user;

--
-- Name: type_social_security; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.type_social_security (
    id integer DEFAULT nextval('public.type_social_security_id_seq'::regclass) NOT NULL,
    name character varying(255),
    regularexp character varying(1000),
    mask character varying(1000),
    separator character varying(255),
    description character varying(500),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(0) without time zone
);


ALTER TABLE public.type_social_security OWNER TO alfabravo_user;

--
-- Name: ubication; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.ubication (
    id integer NOT NULL,
    name character varying(255),
    description text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.ubication OWNER TO alfabravo_user;

--
-- Name: ubication_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.ubication_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.ubication_id_seq OWNER TO alfabravo_user;

--
-- Name: ubication_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.ubication_id_seq OWNED BY public.ubication.id;


--
-- Name: ubication_id_seq_1; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.ubication_id_seq_1
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.ubication_id_seq_1 OWNER TO alfabravo_user;

--
-- Name: unit_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.unit_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.unit_id_seq OWNER TO alfabravo_user;

--
-- Name: user_area_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.user_area_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.user_area_id_seq OWNER TO alfabravo_user;

--
-- Name: user_area; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.user_area (
    id integer DEFAULT nextval('public.user_area_id_seq'::regclass) NOT NULL,
    user_id integer,
    area_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.user_area OWNER TO alfabravo_user;

--
-- Name: user_belong_area_id_seq_1; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.user_belong_area_id_seq_1
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.user_belong_area_id_seq_1 OWNER TO alfabravo_user;

--
-- Name: user_belong_area; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.user_belong_area (
    id integer DEFAULT nextval('public.user_belong_area_id_seq_1'::regclass) NOT NULL,
    user_id integer,
    area_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.user_belong_area OWNER TO alfabravo_user;

--
-- Name: user_category_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.user_category_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.user_category_id_seq OWNER TO alfabravo_user;

--
-- Name: user_client_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.user_client_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.user_client_id_seq OWNER TO alfabravo_user;

--
-- Name: user_client; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.user_client (
    id integer DEFAULT nextval('public.user_client_id_seq'::regclass) NOT NULL,
    user_id integer,
    client_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.user_client OWNER TO alfabravo_user;

--
-- Name: user_enterprise_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.user_enterprise_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.user_enterprise_id_seq OWNER TO alfabravo_user;

--
-- Name: user_enterprise; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.user_enterprise (
    id integer DEFAULT nextval('public.user_enterprise_id_seq'::regclass) NOT NULL,
    user_id integer,
    enterprise_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.user_enterprise OWNER TO alfabravo_user;

--
-- Name: user_ntype_documents_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.user_ntype_documents_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.user_ntype_documents_id_seq OWNER TO alfabravo_user;

--
-- Name: user_ntype_documents; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.user_ntype_documents (
    id integer DEFAULT nextval('public.user_ntype_documents_id_seq'::regclass) NOT NULL,
    user_id integer,
    type_document_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.user_ntype_documents OWNER TO alfabravo_user;

--
-- Name: user_profile; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.user_profile (
    id integer NOT NULL,
    name character varying(255),
    middle_name character varying(255),
    last_name character varying(255),
    user_type_id integer,
    user_id integer,
    photo character varying(255),
    biography text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    location_id integer,
    lang_id integer,
    address character varying(255),
    postal_code character varying(255),
    reference character varying(255),
    state character varying(255),
    city character varying(255),
    phone character varying(255)
);


ALTER TABLE public.user_profile OWNER TO alfabravo_user;

--
-- Name: user_profile_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.user_profile_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.user_profile_id_seq OWNER TO alfabravo_user;

--
-- Name: user_profile_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.user_profile_id_seq OWNED BY public.user_profile.id;


--
-- Name: user_room_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.user_room_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.user_room_id_seq OWNER TO alfabravo_user;

--
-- Name: user_room; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.user_room (
    id integer DEFAULT nextval('public.user_room_id_seq'::regclass) NOT NULL,
    name character varying(255),
    friendly_name character varying(255),
    attrs text,
    user_id integer,
    created_time timestamp(6) without time zone,
    default_room integer DEFAULT 0 NOT NULL,
    updated_at timestamp(6) without time zone
);


ALTER TABLE public.user_room OWNER TO alfabravo_user;

--
-- Name: user_room_meeting_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.user_room_meeting_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.user_room_meeting_id_seq OWNER TO alfabravo_user;

--
-- Name: user_room_meeting; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.user_room_meeting (
    id integer DEFAULT nextval('public.user_room_meeting_id_seq'::regclass) NOT NULL,
    meeting_id character varying(255),
    user_id integer,
    created_at timestamp(6) without time zone,
    active integer DEFAULT 1,
    room_id integer,
    password character varying(255),
    appoitment integer,
    updated_at timestamp(6) without time zone,
    user_queue_id integer
);


ALTER TABLE public.user_room_meeting OWNER TO alfabravo_user;

--
-- Name: user_spoken_languages_id_seq1; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.user_spoken_languages_id_seq1
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.user_spoken_languages_id_seq1 OWNER TO alfabravo_user;

--
-- Name: user_spoken_languages; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.user_spoken_languages (
    id integer DEFAULT nextval('public.user_spoken_languages_id_seq1'::regclass) NOT NULL,
    spoken_language_id integer,
    user_profile_id integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone
);


ALTER TABLE public.user_spoken_languages OWNER TO alfabravo_user;

--
-- Name: user_spoken_languages_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.user_spoken_languages_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.user_spoken_languages_id_seq OWNER TO alfabravo_user;

--
-- Name: user_type; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.user_type (
    id integer NOT NULL,
    name character varying(100)
);


ALTER TABLE public.user_type OWNER TO alfabravo_user;

--
-- Name: user_type_documents_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.user_type_documents_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.user_type_documents_id_seq OWNER TO alfabravo_user;

--
-- Name: user_type_documents; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.user_type_documents (
    id integer DEFAULT nextval('public.user_type_documents_id_seq'::regclass) NOT NULL,
    user_id integer,
    type_document_id integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    deleted_at timestamp without time zone
);


ALTER TABLE public.user_type_documents OWNER TO alfabravo_user;

--
-- Name: user_type_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.user_type_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    MAXVALUE 2147483647
    CACHE 1;


ALTER TABLE public.user_type_id_seq OWNER TO alfabravo_user;

--
-- Name: user_type_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.user_type_id_seq OWNED BY public.user_type.id;


--
-- Name: users; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.users (
    id bigint NOT NULL,
    name character varying(255) NOT NULL,
    email character varying(255) NOT NULL,
    email_verified_at character varying,
    password character varying(255) NOT NULL,
    remember_token character varying(100),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    two_factor_secret text,
    two_factor_recovery_codes text,
    deleted_at timestamp(0) without time zone,
    last_seen timestamp without time zone,
    cuota integer,
    username character varying(255),
    desactivated boolean,
    requirements boolean,
    start timestamp without time zone,
    endt timestamp without time zone,
    re_login boolean DEFAULT false,
    change_password_required boolean
);


ALTER TABLE public.users OWNER TO alfabravo_user;

--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.users_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.users_id_seq OWNER TO alfabravo_user;

--
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: alfabravo_user
--

ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;


--
-- Name: users_permissions; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.users_permissions (
    user_id integer NOT NULL,
    permission_id integer NOT NULL
);


ALTER TABLE public.users_permissions OWNER TO alfabravo_user;

--
-- Name: users_roles; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.users_roles (
    user_id integer NOT NULL,
    role_id integer NOT NULL
);


ALTER TABLE public.users_roles OWNER TO alfabravo_user;

--
-- Name: vehicle; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.vehicle (
    id integer NOT NULL,
    n_serie character varying(255),
    year integer,
    brand_id integer,
    model_id integer,
    color character varying(255),
    registration_number character varying(255),
    manufacturer_id integer,
    vehicle_type_id integer,
    owner_id integer,
    engine_number character varying(255),
    responsible character varying(255),
    fuel_type_id integer,
    acquisition_date date,
    status integer,
    notes text,
    last_update_date date,
    insurance_id integer,
    documents text,
    photo character varying,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    decal character varying(255),
    gps_id integer,
    register_status_id integer,
    acquisition_value double precision,
    mileage_date timestamp(0) without time zone,
    mileage double precision,
    key_duplicate boolean,
    base_id integer,
    deleted_at timestamp(6) without time zone,
    verification timestamp(0) without time zone,
    rent_amount double precision,
    rent_type integer,
    is_rented boolean,
    rent_provider_id integer,
    eventual boolean,
    tenure_payment_date_limit timestamp(6) without time zone,
    status_tenure_payment integer,
    tenure_infos_payment boolean,
    enterprise_id integer
);


ALTER TABLE public.vehicle OWNER TO alfabravo_user;

--
-- Name: vehicle_activity_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.vehicle_activity_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.vehicle_activity_id_seq OWNER TO alfabravo_user;

--
-- Name: vehicle_activity; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.vehicle_activity (
    id integer DEFAULT nextval('public.vehicle_activity_id_seq'::regclass) NOT NULL,
    vehicle_id integer,
    employee_id integer,
    action integer,
    service_type integer,
    action_date timestamp(6) without time zone,
    summary text,
    mileage integer,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    deleted_at timestamp(6) without time zone,
    user_id integer,
    other_person character varying(255),
    base_id integer,
    authorized_by integer
);


ALTER TABLE public.vehicle_activity OWNER TO alfabravo_user;

--
-- Name: vehicle_brand; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.vehicle_brand (
    id integer DEFAULT nextval('public.brand_id_seq'::regclass) NOT NULL,
    name character varying(500),
    image character varying(255),
    description text,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    deleted_at timestamp(6) without time zone
);


ALTER TABLE public.vehicle_brand OWNER TO alfabravo_user;

--
-- Name: vehicle_expenses_id_seq; Type: SEQUENCE; Schema: public; Owner: alfabravo_user
--

CREATE SEQUENCE public.vehicle_expenses_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE public.vehicle_expenses_id_seq OWNER TO alfabravo_user;

--
-- Name: vehicle_expenses; Type: TABLE; Schema: public; Owner: alfabravo_user
--

CREATE TABLE public.vehicle_expenses (
    id integer DEFAULT nextval('public.vehicle_expenses_id_seq'::regclass) NOT NULL,
    vehicle_id integer,
    expenses_id integer,
    amount real,
    date date,
    attachments text,
    created_at timestamp(6) without time zone,
    updated_at timestamp(6) without time zone,
    observations text
);


ALTER TABLE public.vehicle_expenses OWNER TO alfabravo_user;

--
