-- Name: COLUMN account_report_external_value.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_external_value.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_report_external_value.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_external_value.name IS 'Name';


--
-- Name: COLUMN account_report_external_value.text_value; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_external_value.text_value IS 'Text Value';


--
-- Name: COLUMN account_report_external_value.carryover_origin_expression_label; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_external_value.carryover_origin_expression_label IS 'Origin Expression Label';


--
-- Name: COLUMN account_report_external_value.date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_external_value.date IS 'Date';


--
-- Name: COLUMN account_report_external_value.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_external_value.create_date IS 'Created on';


--
-- Name: COLUMN account_report_external_value.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_external_value.write_date IS 'Last Updated on';


--
-- Name: COLUMN account_report_external_value.value; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_external_value.value IS 'Numeric Value';


--
-- Name: account_report_external_value_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_report_external_value_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_report_external_value_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_report_external_value_id_seq OWNED BY public.account_report_external_value.id;


--
-- Name: account_report_file_download_error_wizard; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_report_file_download_error_wizard (
    id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    file_name character varying,
    actionable_errors jsonb,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_report_file_download_error_wizard; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_report_file_download_error_wizard IS 'Manage the file generation errors from report exports.';


--
-- Name: COLUMN account_report_file_download_error_wizard.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_file_download_error_wizard.create_uid IS 'Created by';


--
-- Name: COLUMN account_report_file_download_error_wizard.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_file_download_error_wizard.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_report_file_download_error_wizard.file_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_file_download_error_wizard.file_name IS 'File Name';


--
-- Name: COLUMN account_report_file_download_error_wizard.actionable_errors; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_file_download_error_wizard.actionable_errors IS 'Actionable Errors';


--
-- Name: COLUMN account_report_file_download_error_wizard.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_file_download_error_wizard.create_date IS 'Created on';


--
-- Name: COLUMN account_report_file_download_error_wizard.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_file_download_error_wizard.write_date IS 'Last Updated on';


--
-- Name: account_report_file_download_error_wizard_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_report_file_download_error_wizard_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_report_file_download_error_wizard_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_report_file_download_error_wizard_id_seq OWNED BY public.account_report_file_download_error_wizard.id;


--
-- Name: account_report_horizontal_group; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_report_horizontal_group (
    id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    name jsonb NOT NULL,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_report_horizontal_group; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_report_horizontal_group IS 'Horizontal group for reports';


--
-- Name: COLUMN account_report_horizontal_group.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_horizontal_group.create_uid IS 'Created by';


--
-- Name: COLUMN account_report_horizontal_group.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_horizontal_group.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_report_horizontal_group.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_horizontal_group.name IS 'Name';


--
-- Name: COLUMN account_report_horizontal_group.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_horizontal_group.create_date IS 'Created on';


--
-- Name: COLUMN account_report_horizontal_group.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_horizontal_group.write_date IS 'Last Updated on';


--
-- Name: account_report_horizontal_group_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_report_horizontal_group_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_report_horizontal_group_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_report_horizontal_group_id_seq OWNED BY public.account_report_horizontal_group.id;


--
-- Name: account_report_horizontal_group_rule; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_report_horizontal_group_rule (
    id integer NOT NULL,
    horizontal_group_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    domain character varying NOT NULL,
    field_name character varying NOT NULL,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_report_horizontal_group_rule; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_report_horizontal_group_rule IS 'Horizontal group rule for reports';


--
-- Name: COLUMN account_report_horizontal_group_rule.horizontal_group_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_horizontal_group_rule.horizontal_group_id IS 'Horizontal Group';


--
-- Name: COLUMN account_report_horizontal_group_rule.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_horizontal_group_rule.create_uid IS 'Created by';


--
-- Name: COLUMN account_report_horizontal_group_rule.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_horizontal_group_rule.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_report_horizontal_group_rule.domain; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_horizontal_group_rule.domain IS 'Domain';


--
-- Name: COLUMN account_report_horizontal_group_rule.field_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_horizontal_group_rule.field_name IS 'Field';


--
-- Name: COLUMN account_report_horizontal_group_rule.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_horizontal_group_rule.create_date IS 'Created on';


--
-- Name: COLUMN account_report_horizontal_group_rule.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_horizontal_group_rule.write_date IS 'Last Updated on';


--
-- Name: account_report_horizontal_group_rule_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_report_horizontal_group_rule_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_report_horizontal_group_rule_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_report_horizontal_group_rule_id_seq OWNED BY public.account_report_horizontal_group_rule.id;


--
-- Name: account_report_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_report_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_report_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_report_id_seq OWNED BY public.account_report.id;


--
-- Name: account_report_line; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_report_line (
    id integer NOT NULL,
    report_id integer NOT NULL,
    hierarchy_level integer NOT NULL,
    parent_id integer,
    sequence integer,
    action_id integer,
    create_uid integer,
    write_uid integer,
    groupby character varying,
    user_groupby character varying,
    code character varying,
    horizontal_split_side character varying,
    name jsonb NOT NULL,
    foldable boolean,
    print_on_new_page boolean,
    hide_if_zero boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_report_line; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_report_line IS 'Accounting Report Line';


--
-- Name: COLUMN account_report_line.report_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_line.report_id IS 'Parent Report';


--
-- Name: COLUMN account_report_line.hierarchy_level; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_line.hierarchy_level IS 'Level';


--
-- Name: COLUMN account_report_line.parent_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_line.parent_id IS 'Parent Line';


--
-- Name: COLUMN account_report_line.sequence; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_line.sequence IS 'Sequence';


--
-- Name: COLUMN account_report_line.action_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_line.action_id IS 'Action';


--
-- Name: COLUMN account_report_line.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_line.create_uid IS 'Created by';


--
-- Name: COLUMN account_report_line.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_line.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_report_line.groupby; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_line.groupby IS 'Group By';


--
-- Name: COLUMN account_report_line.user_groupby; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_line.user_groupby IS 'User Group By';


--
-- Name: COLUMN account_report_line.code; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_line.code IS 'Code';


--
-- Name: COLUMN account_report_line.horizontal_split_side; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_line.horizontal_split_side IS 'Horizontal Split Side';


--
-- Name: COLUMN account_report_line.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_line.name IS 'Name';


--
-- Name: COLUMN account_report_line.foldable; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_line.foldable IS 'Foldable';


--
-- Name: COLUMN account_report_line.print_on_new_page; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_line.print_on_new_page IS 'Print On New Page';


--
-- Name: COLUMN account_report_line.hide_if_zero; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_line.hide_if_zero IS 'Hide if Zero';


--
-- Name: COLUMN account_report_line.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_line.create_date IS 'Created on';


--
-- Name: COLUMN account_report_line.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_line.write_date IS 'Last Updated on';


--
-- Name: account_report_line_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_report_line_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_report_line_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_report_line_id_seq OWNED BY public.account_report_line.id;


--
-- Name: account_report_section_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_report_section_rel (
    main_report_id integer NOT NULL,
    sub_report_id integer NOT NULL
);


--
-- Name: TABLE account_report_section_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_report_section_rel IS 'RELATION BETWEEN account_report AND account_report';


--
-- Name: account_report_send; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_report_send (
    id integer NOT NULL,
    mail_template_id integer,
    account_report_id integer,
    create_uid integer,
    write_uid integer,
    mode character varying,
    mail_subject character varying,
    report_options jsonb,
    mail_attachments_widget jsonb,
    mail_body text,
    enable_download boolean,
    checkbox_download boolean,
    enable_send_mail boolean,
    checkbox_send_mail boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_report_send; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_report_send IS 'Account Report Send';


--
-- Name: COLUMN account_report_send.mail_template_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_send.mail_template_id IS 'Email template';


--
-- Name: COLUMN account_report_send.account_report_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_send.account_report_id IS 'Report';


--
-- Name: COLUMN account_report_send.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_send.create_uid IS 'Created by';


--
-- Name: COLUMN account_report_send.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_send.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_report_send.mode; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_send.mode IS 'Mode';


--
-- Name: COLUMN account_report_send.mail_subject; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_send.mail_subject IS 'Subject';


--
-- Name: COLUMN account_report_send.report_options; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_send.report_options IS 'Report Options';


--
-- Name: COLUMN account_report_send.mail_attachments_widget; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_send.mail_attachments_widget IS 'Mail Attachments Widget';


--
-- Name: COLUMN account_report_send.mail_body; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_send.mail_body IS 'Contents';


--
-- Name: COLUMN account_report_send.enable_download; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_send.enable_download IS 'Enable Download';


--
-- Name: COLUMN account_report_send.checkbox_download; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_send.checkbox_download IS 'Download';


--
-- Name: COLUMN account_report_send.enable_send_mail; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_send.enable_send_mail IS 'Enable Send Mail';


--
-- Name: COLUMN account_report_send.checkbox_send_mail; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_send.checkbox_send_mail IS 'Email';


--
-- Name: COLUMN account_report_send.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_send.create_date IS 'Created on';


--
-- Name: COLUMN account_report_send.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_report_send.write_date IS 'Last Updated on';


--
-- Name: account_report_send_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_report_send_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_report_send_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_report_send_id_seq OWNED BY public.account_report_send.id;


--
-- Name: account_report_send_res_partner_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_report_send_res_partner_rel (
    account_report_send_id integer NOT NULL,
    res_partner_id integer NOT NULL
);


--
-- Name: TABLE account_report_send_res_partner_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_report_send_res_partner_rel IS 'RELATION BETWEEN account_report_send AND res_partner';


--
-- Name: account_reports_export_wizard; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_reports_export_wizard (
    id integer NOT NULL,
    report_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    doc_name character varying,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_reports_export_wizard; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_reports_export_wizard IS 'Export wizard for accounting''s reports';


--
-- Name: COLUMN account_reports_export_wizard.report_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_reports_export_wizard.report_id IS 'Parent Report Id';


--
-- Name: COLUMN account_reports_export_wizard.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_reports_export_wizard.create_uid IS 'Created by';


--
-- Name: COLUMN account_reports_export_wizard.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_reports_export_wizard.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_reports_export_wizard.doc_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_reports_export_wizard.doc_name IS 'Documents Name';


--
-- Name: COLUMN account_reports_export_wizard.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_reports_export_wizard.create_date IS 'Created on';


--
-- Name: COLUMN account_reports_export_wizard.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_reports_export_wizard.write_date IS 'Last Updated on';


--
-- Name: account_reports_export_wizard_format; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_reports_export_wizard_format (
    id integer NOT NULL,
    export_wizard_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    name character varying NOT NULL,
    fun_to_call character varying NOT NULL,
    fun_param character varying,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_reports_export_wizard_format; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_reports_export_wizard_format IS 'Export format for accounting''s reports';


--
-- Name: COLUMN account_reports_export_wizard_format.export_wizard_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_reports_export_wizard_format.export_wizard_id IS 'Parent Wizard';


--
-- Name: COLUMN account_reports_export_wizard_format.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_reports_export_wizard_format.create_uid IS 'Created by';


--
-- Name: COLUMN account_reports_export_wizard_format.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_reports_export_wizard_format.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_reports_export_wizard_format.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_reports_export_wizard_format.name IS 'Name';


--
-- Name: COLUMN account_reports_export_wizard_format.fun_to_call; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_reports_export_wizard_format.fun_to_call IS 'Function to Call';


--
-- Name: COLUMN account_reports_export_wizard_format.fun_param; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_reports_export_wizard_format.fun_param IS 'Function Parameter';


--
-- Name: COLUMN account_reports_export_wizard_format.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_reports_export_wizard_format.create_date IS 'Created on';


--
-- Name: COLUMN account_reports_export_wizard_format.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_reports_export_wizard_format.write_date IS 'Last Updated on';


--
-- Name: account_reports_export_wizard_format_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_reports_export_wizard_format_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_reports_export_wizard_format_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_reports_export_wizard_format_id_seq OWNED BY public.account_reports_export_wizard_format.id;


--
-- Name: account_reports_export_wizard_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_reports_export_wizard_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_reports_export_wizard_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_reports_export_wizard_id_seq OWNED BY public.account_reports_export_wizard.id;


--
-- Name: account_resequence_wizard; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_resequence_wizard (
    id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    first_name character varying NOT NULL,
    ordering character varying NOT NULL,
    first_date date,
    end_date date,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_resequence_wizard; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_resequence_wizard IS 'Remake the sequence of Journal Entries.';


--
-- Name: COLUMN account_resequence_wizard.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_resequence_wizard.create_uid IS 'Created by';


--
-- Name: COLUMN account_resequence_wizard.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_resequence_wizard.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_resequence_wizard.first_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_resequence_wizard.first_name IS 'First New Sequence';


--
-- Name: COLUMN account_resequence_wizard.ordering; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_resequence_wizard.ordering IS 'Ordering';


--
-- Name: COLUMN account_resequence_wizard.first_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_resequence_wizard.first_date IS 'First Date';


--
-- Name: COLUMN account_resequence_wizard.end_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_resequence_wizard.end_date IS 'End Date';


--
-- Name: COLUMN account_resequence_wizard.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_resequence_wizard.create_date IS 'Created on';


--
-- Name: COLUMN account_resequence_wizard.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_resequence_wizard.write_date IS 'Last Updated on';


--
-- Name: account_resequence_wizard_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_resequence_wizard_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_resequence_wizard_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_resequence_wizard_id_seq OWNED BY public.account_resequence_wizard.id;


--
-- Name: account_return; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_return (
    id integer NOT NULL,
    message_main_attachment_id integer,
    type_id integer NOT NULL,
    company_id integer NOT NULL,
    tax_unit_id integer,
    create_uid integer,
    write_uid integer,
    name character varying NOT NULL,
    state character varying NOT NULL,
    date_from date NOT NULL,
    date_to date NOT NULL,
    date_deadline date,
    date_submission date,
    amount_to_pay numeric,
    is_completed boolean,
    manually_created boolean,
    report_opened_once boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_return; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_return IS 'Accounting Return';


--
-- Name: COLUMN account_return.message_main_attachment_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return.message_main_attachment_id IS 'Main Attachment';


--
-- Name: COLUMN account_return.type_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return.type_id IS 'Return Type';


--
-- Name: COLUMN account_return.company_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return.company_id IS 'Company';


--
-- Name: COLUMN account_return.tax_unit_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return.tax_unit_id IS 'Tax Unit';


--
-- Name: COLUMN account_return.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return.create_uid IS 'Created by';


--
-- Name: COLUMN account_return.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_return.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return.name IS 'Name';


--
-- Name: COLUMN account_return.state; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return.state IS 'State';


--
-- Name: COLUMN account_return.date_from; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return.date_from IS 'Date From';


--
-- Name: COLUMN account_return.date_to; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return.date_to IS 'Date To';


--
-- Name: COLUMN account_return.date_deadline; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return.date_deadline IS 'Deadline';


--
-- Name: COLUMN account_return.date_submission; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return.date_submission IS 'Submission Date';


--
-- Name: COLUMN account_return.amount_to_pay; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return.amount_to_pay IS 'Amount To Pay';


--
-- Name: COLUMN account_return.is_completed; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return.is_completed IS 'Is Completed';


--
-- Name: COLUMN account_return.manually_created; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return.manually_created IS 'Manually Created';


--
-- Name: COLUMN account_return.report_opened_once; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return.report_opened_once IS 'Report Opened Once';


--
-- Name: COLUMN account_return.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return.create_date IS 'Created on';


--
-- Name: COLUMN account_return.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return.write_date IS 'Last Updated on';


--
-- Name: account_return_check; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_return_check (
    id integer NOT NULL,
    records_count integer,
    return_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    code character varying NOT NULL,
    name character varying NOT NULL,
    message character varying,
    state character varying NOT NULL,
    records_name character varying,
    result character varying NOT NULL,
    return_state character varying,
    action jsonb,
    notes text,
    bypassed boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_return_check; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_return_check IS 'Accounting Return Check';


--
-- Name: COLUMN account_return_check.records_count; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_check.records_count IS 'Records Count';


--
-- Name: COLUMN account_return_check.return_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_check.return_id IS 'Account Return';


--
-- Name: COLUMN account_return_check.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_check.create_uid IS 'Created by';


--
-- Name: COLUMN account_return_check.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_check.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_return_check.code; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_check.code IS 'Check ID';


--
-- Name: COLUMN account_return_check.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_check.name IS 'Name';


--
-- Name: COLUMN account_return_check.message; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_check.message IS 'Description';


--
-- Name: COLUMN account_return_check.state; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_check.state IS 'Return State To Check For';


--
-- Name: COLUMN account_return_check.records_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_check.records_name IS 'Records Name';


--
-- Name: COLUMN account_return_check.result; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_check.result IS 'Result';


--
-- Name: COLUMN account_return_check.return_state; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_check.return_state IS 'Return State';


--
-- Name: COLUMN account_return_check.action; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_check.action IS 'Action';


--
-- Name: COLUMN account_return_check.notes; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_check.notes IS 'Notes';


--
-- Name: COLUMN account_return_check.bypassed; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_check.bypassed IS 'Bypassed';


--
-- Name: COLUMN account_return_check.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_check.create_date IS 'Created on';


--
-- Name: COLUMN account_return_check.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_check.write_date IS 'Last Updated on';


--
-- Name: account_return_check_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_return_check_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_return_check_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_return_check_id_seq OWNED BY public.account_return_check.id;


--
-- Name: account_return_check_res_users_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_return_check_res_users_rel (
    account_return_check_id integer NOT NULL,
    res_users_id integer NOT NULL
);


--
-- Name: TABLE account_return_check_res_users_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_return_check_res_users_rel IS 'RELATION BETWEEN account_return_check AND res_users';


--
-- Name: account_return_creation_wizard; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_return_creation_wizard (
    id integer NOT NULL,
    company_id integer NOT NULL,
    return_type_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    date_from date NOT NULL,
    date_to date NOT NULL,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_return_creation_wizard; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_return_creation_wizard IS 'Return creation wizard';


--
-- Name: COLUMN account_return_creation_wizard.company_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_creation_wizard.company_id IS 'Company';


--
-- Name: COLUMN account_return_creation_wizard.return_type_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_creation_wizard.return_type_id IS 'Return Type';


--
-- Name: COLUMN account_return_creation_wizard.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_creation_wizard.create_uid IS 'Created by';


--
-- Name: COLUMN account_return_creation_wizard.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_creation_wizard.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_return_creation_wizard.date_from; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_creation_wizard.date_from IS 'Date From';


--
-- Name: COLUMN account_return_creation_wizard.date_to; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_creation_wizard.date_to IS 'Date To';


--
-- Name: COLUMN account_return_creation_wizard.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_creation_wizard.create_date IS 'Created on';


--
-- Name: COLUMN account_return_creation_wizard.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_creation_wizard.write_date IS 'Last Updated on';


--
-- Name: account_return_creation_wizard_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_return_creation_wizard_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_return_creation_wizard_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_return_creation_wizard_id_seq OWNED BY public.account_return_creation_wizard.id;


--
-- Name: account_return_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_return_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_return_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_return_id_seq OWNED BY public.account_return.id;


--
-- Name: account_return_ir_attachment_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_return_ir_attachment_rel (
    account_return_id integer NOT NULL,
    ir_attachment_id integer NOT NULL
);


--
-- Name: TABLE account_return_ir_attachment_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_return_ir_attachment_rel IS 'RELATION BETWEEN account_return AND ir_attachment';


--
-- Name: account_return_payment_wizard; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_return_payment_wizard (
    id integer NOT NULL,
    company_id integer,
    partner_bank_id integer,
    return_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    amount_to_pay numeric,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_return_payment_wizard; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_return_payment_wizard IS 'Returns Generic Payment Wizard';


--
-- Name: COLUMN account_return_payment_wizard.company_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_payment_wizard.company_id IS 'Company';


--
-- Name: COLUMN account_return_payment_wizard.partner_bank_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_payment_wizard.partner_bank_id IS 'Partner Bank';


--
-- Name: COLUMN account_return_payment_wizard.return_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_payment_wizard.return_id IS 'Return';


--
-- Name: COLUMN account_return_payment_wizard.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_payment_wizard.create_uid IS 'Created by';


--
-- Name: COLUMN account_return_payment_wizard.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_payment_wizard.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_return_payment_wizard.amount_to_pay; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_payment_wizard.amount_to_pay IS 'Amount To Pay';


--
-- Name: COLUMN account_return_payment_wizard.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_payment_wizard.create_date IS 'Created on';


--
-- Name: COLUMN account_return_payment_wizard.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_payment_wizard.write_date IS 'Last Updated on';


--
-- Name: account_return_payment_wizard_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_return_payment_wizard_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_return_payment_wizard_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_return_payment_wizard_id_seq OWNED BY public.account_return_payment_wizard.id;


--
-- Name: account_return_res_company_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_return_res_company_rel (
    account_return_id integer NOT NULL,
    res_company_id integer NOT NULL
);


--
-- Name: TABLE account_return_res_company_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_return_res_company_rel IS 'RELATION BETWEEN account_return AND res_company';


--
-- Name: account_return_submission_wizard; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_return_submission_wizard (
    id integer NOT NULL,
    return_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    instructions text,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_return_submission_wizard; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_return_submission_wizard IS 'Return submission wizard';


--
-- Name: COLUMN account_return_submission_wizard.return_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_submission_wizard.return_id IS 'Return';


--
-- Name: COLUMN account_return_submission_wizard.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_submission_wizard.create_uid IS 'Created by';


--
-- Name: COLUMN account_return_submission_wizard.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_submission_wizard.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_return_submission_wizard.instructions; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_submission_wizard.instructions IS 'Instructions';


--
-- Name: COLUMN account_return_submission_wizard.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_submission_wizard.create_date IS 'Created on';


--
-- Name: COLUMN account_return_submission_wizard.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_submission_wizard.write_date IS 'Last Updated on';


--
-- Name: account_return_submission_wizard_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_return_submission_wizard_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_return_submission_wizard_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_return_submission_wizard_id_seq OWNED BY public.account_return_submission_wizard.id;


--
-- Name: account_return_type; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_return_type (
    id integer NOT NULL,
    report_id integer,
    payment_partner_bank_id integer,
    create_uid integer,
    write_uid integer,
    deadline_periodicity character varying,
    deadline_start_date date,
    name jsonb NOT NULL,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_return_type; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_return_type IS 'Accounting Return Type';


--
-- Name: COLUMN account_return_type.report_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_type.report_id IS 'Report';


--
-- Name: COLUMN account_return_type.payment_partner_bank_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_type.payment_partner_bank_id IS 'Payment Partner Bank';


--
-- Name: COLUMN account_return_type.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_type.create_uid IS 'Created by';


--
-- Name: COLUMN account_return_type.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_type.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_return_type.deadline_periodicity; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_type.deadline_periodicity IS 'Periodicity';


--
-- Name: COLUMN account_return_type.deadline_start_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_type.deadline_start_date IS 'Start Date';


--
-- Name: COLUMN account_return_type.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_type.name IS 'Name';


--
-- Name: COLUMN account_return_type.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_type.create_date IS 'Created on';


--
-- Name: COLUMN account_return_type.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_return_type.write_date IS 'Last Updated on';


--
-- Name: account_return_type_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_return_type_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_return_type_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_return_type_id_seq OWNED BY public.account_return_type.id;


--
-- Name: account_secure_entries_wizard; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_secure_entries_wizard (
    id integer NOT NULL,
    company_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    hash_date date NOT NULL,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_secure_entries_wizard; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_secure_entries_wizard IS 'Secure Journal Entries';


--
-- Name: COLUMN account_secure_entries_wizard.company_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_secure_entries_wizard.company_id IS 'Company';


--
-- Name: COLUMN account_secure_entries_wizard.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_secure_entries_wizard.create_uid IS 'Created by';


--
-- Name: COLUMN account_secure_entries_wizard.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_secure_entries_wizard.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_secure_entries_wizard.hash_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_secure_entries_wizard.hash_date IS 'Hash All Entries';


--
-- Name: COLUMN account_secure_entries_wizard.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_secure_entries_wizard.create_date IS 'Created on';


--
-- Name: COLUMN account_secure_entries_wizard.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_secure_entries_wizard.write_date IS 'Last Updated on';


--
-- Name: account_secure_entries_wizard_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_secure_entries_wizard_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_secure_entries_wizard_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_secure_entries_wizard_id_seq OWNED BY public.account_secure_entries_wizard.id;


--
-- Name: account_setup_bank_manual_config; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_setup_bank_manual_config (
    id integer NOT NULL,
    res_partner_bank_id integer NOT NULL,
    num_journals_without_account_bank integer,
    num_journals_without_account_credit integer,
    create_uid integer,
    write_uid integer,
    new_journal_name character varying NOT NULL,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_setup_bank_manual_config; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_setup_bank_manual_config IS 'Bank setup manual config';


--
-- Name: COLUMN account_setup_bank_manual_config.res_partner_bank_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_setup_bank_manual_config.res_partner_bank_id IS 'Res Partner Bank';


--
-- Name: COLUMN account_setup_bank_manual_config.num_journals_without_account_bank; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_setup_bank_manual_config.num_journals_without_account_bank IS 'Num Journals Without Account Bank';


--
-- Name: COLUMN account_setup_bank_manual_config.num_journals_without_account_credit; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_setup_bank_manual_config.num_journals_without_account_credit IS 'Num Journals Without Account Credit';


--
-- Name: COLUMN account_setup_bank_manual_config.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_setup_bank_manual_config.create_uid IS 'Created by';


--
-- Name: COLUMN account_setup_bank_manual_config.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_setup_bank_manual_config.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_setup_bank_manual_config.new_journal_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_setup_bank_manual_config.new_journal_name IS 'New Journal Name';


--
-- Name: COLUMN account_setup_bank_manual_config.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_setup_bank_manual_config.create_date IS 'Created on';


--
-- Name: COLUMN account_setup_bank_manual_config.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_setup_bank_manual_config.write_date IS 'Last Updated on';


--
-- Name: account_setup_bank_manual_config_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_setup_bank_manual_config_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_setup_bank_manual_config_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_setup_bank_manual_config_id_seq OWNED BY public.account_setup_bank_manual_config.id;


--
-- Name: account_tax; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_tax (
    id integer NOT NULL,
    company_id integer NOT NULL,
    sequence integer NOT NULL,
    tax_group_id integer NOT NULL,
    cash_basis_transition_account_id integer,
    country_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    type_tax_use character varying NOT NULL,
    tax_scope character varying,
    amount_type character varying NOT NULL,
    price_include_override character varying,
    tax_exigibility character varying,
    name jsonb NOT NULL,
    description jsonb,
    invoice_label jsonb,
    invoice_legal_notes jsonb,
    amount numeric NOT NULL,
    is_domestic boolean,
    active boolean,
    include_base_amount boolean,
    is_base_affected boolean,
    analytic boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_tax; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_tax IS 'Tax';


--
-- Name: COLUMN account_tax.company_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.company_id IS 'Company';


--
-- Name: COLUMN account_tax.sequence; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.sequence IS 'Sequence';


--
-- Name: COLUMN account_tax.tax_group_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.tax_group_id IS 'Tax Group';


--
-- Name: COLUMN account_tax.cash_basis_transition_account_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.cash_basis_transition_account_id IS 'Cash Basis Transition Account';


--
-- Name: COLUMN account_tax.country_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.country_id IS 'Country';


--
-- Name: COLUMN account_tax.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.create_uid IS 'Created by';


--
-- Name: COLUMN account_tax.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_tax.type_tax_use; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.type_tax_use IS 'Tax Type';


--
-- Name: COLUMN account_tax.tax_scope; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.tax_scope IS 'Tax Scope';


--
-- Name: COLUMN account_tax.amount_type; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.amount_type IS 'Tax Computation';


--
-- Name: COLUMN account_tax.price_include_override; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.price_include_override IS 'Included in Price';


--
-- Name: COLUMN account_tax.tax_exigibility; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.tax_exigibility IS 'Tax Exigibility';


--
-- Name: COLUMN account_tax.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.name IS 'Tax Name';


--
-- Name: COLUMN account_tax.description; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.description IS 'Description';


--
-- Name: COLUMN account_tax.invoice_label; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.invoice_label IS 'Label on Invoices';


--
-- Name: COLUMN account_tax.invoice_legal_notes; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.invoice_legal_notes IS 'Legal Notes';


--
-- Name: COLUMN account_tax.amount; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.amount IS 'Amount';


--
-- Name: COLUMN account_tax.is_domestic; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.is_domestic IS 'Is Domestic';


--
-- Name: COLUMN account_tax.active; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.active IS 'Active';


--
-- Name: COLUMN account_tax.include_base_amount; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.include_base_amount IS 'Affect Base of Subsequent Taxes';


--
-- Name: COLUMN account_tax.is_base_affected; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.is_base_affected IS 'Base Affected by Previous Taxes';


--
-- Name: COLUMN account_tax.analytic; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.analytic IS 'Include in Analytic Cost';


--
-- Name: COLUMN account_tax.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.create_date IS 'Created on';


--
-- Name: COLUMN account_tax.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax.write_date IS 'Last Updated on';


--
-- Name: account_tax_alternatives; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_tax_alternatives (
    dest_tax_id integer NOT NULL,
    src_tax_id integer NOT NULL
);


--
-- Name: TABLE account_tax_alternatives; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_tax_alternatives IS 'RELATION BETWEEN account_tax AND account_tax';


--
-- Name: account_tax_filiation_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_tax_filiation_rel (
    parent_tax integer NOT NULL,
    child_tax integer NOT NULL
);


--
-- Name: TABLE account_tax_filiation_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_tax_filiation_rel IS 'RELATION BETWEEN account_tax AND account_tax';


--
-- Name: account_tax_group; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_tax_group (
    id integer NOT NULL,
    sequence integer,
    company_id integer NOT NULL,
    tax_payable_account_id integer,
    tax_receivable_account_id integer,
    advance_tax_payment_account_id integer,
    country_id integer,
    create_uid integer,
    write_uid integer,
    pos_receipt_label character varying,
    name jsonb NOT NULL,
    preceding_subtotal jsonb,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_tax_group; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_tax_group IS 'Tax Group';


--
-- Name: COLUMN account_tax_group.sequence; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_group.sequence IS 'Sequence';


--
-- Name: COLUMN account_tax_group.company_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_group.company_id IS 'Company';


--
-- Name: COLUMN account_tax_group.tax_payable_account_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_group.tax_payable_account_id IS 'Tax Payable Account';


--
-- Name: COLUMN account_tax_group.tax_receivable_account_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_group.tax_receivable_account_id IS 'Tax Receivable Account';


--
-- Name: COLUMN account_tax_group.advance_tax_payment_account_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_group.advance_tax_payment_account_id IS 'Tax Advance Account';


--
-- Name: COLUMN account_tax_group.country_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_group.country_id IS 'Country';


--
-- Name: COLUMN account_tax_group.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_group.create_uid IS 'Created by';


--
-- Name: COLUMN account_tax_group.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_group.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_tax_group.pos_receipt_label; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_group.pos_receipt_label IS 'PoS receipt label';


--
-- Name: COLUMN account_tax_group.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_group.name IS 'Name';


--
-- Name: COLUMN account_tax_group.preceding_subtotal; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_group.preceding_subtotal IS 'Preceding Subtotal';


--
-- Name: COLUMN account_tax_group.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_group.create_date IS 'Created on';


--
-- Name: COLUMN account_tax_group.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_group.write_date IS 'Last Updated on';


--
-- Name: account_tax_group_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_tax_group_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_tax_group_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_tax_group_id_seq OWNED BY public.account_tax_group.id;


--
-- Name: account_tax_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_tax_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_tax_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_tax_id_seq OWNED BY public.account_tax.id;


--
-- Name: account_tax_repartition_line; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_tax_repartition_line (
    id integer NOT NULL,
    account_id integer,
    tax_id integer,
    company_id integer,
    sequence integer,
    create_uid integer,
    write_uid integer,
    repartition_type character varying NOT NULL,
    document_type character varying NOT NULL,
    use_in_tax_closing boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    factor_percent double precision NOT NULL
);


--
-- Name: TABLE account_tax_repartition_line; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_tax_repartition_line IS 'Tax Repartition Line';


--
-- Name: COLUMN account_tax_repartition_line.account_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_repartition_line.account_id IS 'Account';


--
-- Name: COLUMN account_tax_repartition_line.tax_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_repartition_line.tax_id IS 'Tax';


--
-- Name: COLUMN account_tax_repartition_line.company_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_repartition_line.company_id IS 'Company';


--
-- Name: COLUMN account_tax_repartition_line.sequence; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_repartition_line.sequence IS 'Sequence';


--
-- Name: COLUMN account_tax_repartition_line.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_repartition_line.create_uid IS 'Created by';


--
-- Name: COLUMN account_tax_repartition_line.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_repartition_line.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_tax_repartition_line.repartition_type; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_repartition_line.repartition_type IS 'Based On';


--
-- Name: COLUMN account_tax_repartition_line.document_type; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_repartition_line.document_type IS 'Related to';


--
-- Name: COLUMN account_tax_repartition_line.use_in_tax_closing; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_repartition_line.use_in_tax_closing IS 'Tax Closing Entry';


--
-- Name: COLUMN account_tax_repartition_line.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_repartition_line.create_date IS 'Created on';


--
-- Name: COLUMN account_tax_repartition_line.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_repartition_line.write_date IS 'Last Updated on';


--
-- Name: COLUMN account_tax_repartition_line.factor_percent; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_repartition_line.factor_percent IS '%';


--
-- Name: account_tax_repartition_line_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_tax_repartition_line_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_tax_repartition_line_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_tax_repartition_line_id_seq OWNED BY public.account_tax_repartition_line.id;


--
-- Name: account_tax_sale_order_line_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_tax_sale_order_line_rel (
    sale_order_line_id integer NOT NULL,
    account_tax_id integer NOT NULL
);


--
-- Name: TABLE account_tax_sale_order_line_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_tax_sale_order_line_rel IS 'RELATION BETWEEN sale_order_line AND account_tax';


--
-- Name: account_tax_unit; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_tax_unit (
    id integer NOT NULL,
    country_id integer NOT NULL,
    main_company_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    name character varying NOT NULL,
    vat character varying NOT NULL,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_tax_unit; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_tax_unit IS 'Tax Unit';


--
-- Name: COLUMN account_tax_unit.country_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_unit.country_id IS 'Country';


--
-- Name: COLUMN account_tax_unit.main_company_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_unit.main_company_id IS 'Main Company';


--
-- Name: COLUMN account_tax_unit.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_unit.create_uid IS 'Created by';


--
-- Name: COLUMN account_tax_unit.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_unit.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_tax_unit.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_unit.name IS 'Name';


--
-- Name: COLUMN account_tax_unit.vat; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_unit.vat IS 'Tax ID';


--
-- Name: COLUMN account_tax_unit.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_unit.create_date IS 'Created on';


--
-- Name: COLUMN account_tax_unit.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_tax_unit.write_date IS 'Last Updated on';


--
-- Name: account_tax_unit_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_tax_unit_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_tax_unit_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_tax_unit_id_seq OWNED BY public.account_tax_unit.id;


--
-- Name: account_tax_unit_res_company_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_tax_unit_res_company_rel (
    res_company_id integer NOT NULL,
    account_tax_unit_id integer NOT NULL
);


--
-- Name: TABLE account_tax_unit_res_company_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_tax_unit_res_company_rel IS 'RELATION BETWEEN res_company AND account_tax_unit';


--
-- Name: account_transfer_model; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_transfer_model (
    id integer NOT NULL,
    journal_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    name character varying NOT NULL,
    frequency character varying NOT NULL,
    state character varying NOT NULL,
    date_start date NOT NULL,
    date_stop date,
    active boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE account_transfer_model; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_transfer_model IS 'Account Transfer Model';


--
-- Name: COLUMN account_transfer_model.journal_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_transfer_model.journal_id IS 'Destination Journal';


--
-- Name: COLUMN account_transfer_model.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_transfer_model.create_uid IS 'Created by';


--
-- Name: COLUMN account_transfer_model.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_transfer_model.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_transfer_model.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_transfer_model.name IS 'Name';


--
-- Name: COLUMN account_transfer_model.frequency; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_transfer_model.frequency IS 'Frequency';


--
-- Name: COLUMN account_transfer_model.state; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_transfer_model.state IS 'State';


--
-- Name: COLUMN account_transfer_model.date_start; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_transfer_model.date_start IS 'Start Date';


--
-- Name: COLUMN account_transfer_model.date_stop; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_transfer_model.date_stop IS 'Stop Date';


--
-- Name: COLUMN account_transfer_model.active; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_transfer_model.active IS 'Active';


--
-- Name: COLUMN account_transfer_model.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_transfer_model.create_date IS 'Created on';


--
-- Name: COLUMN account_transfer_model.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_transfer_model.write_date IS 'Last Updated on';


--
-- Name: account_transfer_model_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_transfer_model_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_transfer_model_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_transfer_model_id_seq OWNED BY public.account_transfer_model.id;


--
-- Name: account_transfer_model_line; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_transfer_model_line (
    id integer NOT NULL,
    transfer_model_id integer NOT NULL,
    account_id integer NOT NULL,
    sequence integer,
    create_uid integer,
    write_uid integer,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    percent double precision NOT NULL
);


--
-- Name: TABLE account_transfer_model_line; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_transfer_model_line IS 'Account Transfer Model Line';


--
-- Name: COLUMN account_transfer_model_line.transfer_model_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_transfer_model_line.transfer_model_id IS 'Transfer Model';


--
-- Name: COLUMN account_transfer_model_line.account_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_transfer_model_line.account_id IS 'Destination Account';


--
-- Name: COLUMN account_transfer_model_line.sequence; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_transfer_model_line.sequence IS 'Sequence';


--
-- Name: COLUMN account_transfer_model_line.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_transfer_model_line.create_uid IS 'Created by';


--
-- Name: COLUMN account_transfer_model_line.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_transfer_model_line.write_uid IS 'Last Updated by';


--
-- Name: COLUMN account_transfer_model_line.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_transfer_model_line.create_date IS 'Created on';


--
-- Name: COLUMN account_transfer_model_line.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_transfer_model_line.write_date IS 'Last Updated on';


--
-- Name: COLUMN account_transfer_model_line.percent; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.account_transfer_model_line.percent IS 'Percent';


--
-- Name: account_transfer_model_line_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.account_transfer_model_line_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: account_transfer_model_line_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.account_transfer_model_line_id_seq OWNED BY public.account_transfer_model_line.id;


--
-- Name: account_transfer_model_line_res_partner_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.account_transfer_model_line_res_partner_rel (
    account_transfer_model_line_id integer NOT NULL,
    res_partner_id integer NOT NULL
);


--
-- Name: TABLE account_transfer_model_line_res_partner_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.account_transfer_model_line_res_partner_rel IS 'RELATION BETWEEN account_transfer_model_line AND res_partner';


--
-- Name: activity_attachment_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.activity_attachment_rel (
    activity_id integer NOT NULL,
    attachment_id integer NOT NULL
);


--
-- Name: TABLE activity_attachment_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.activity_attachment_rel IS 'RELATION BETWEEN mail_activity AND ir_attachment';


--
-- Name: adjusting_entries__account_move; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.adjusting_entries__account_move (
    move_id integer NOT NULL,
    adjusting_entry_move_id integer NOT NULL
);


--
-- Name: TABLE adjusting_entries__account_move; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.adjusting_entries__account_move IS 'RELATION BETWEEN account_move AND account_move';


--
-- Name: auth_totp_device; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.auth_totp_device (
    id integer NOT NULL,
    name character varying NOT NULL,
    user_id integer NOT NULL,
    scope character varying,
    expiration_date timestamp without time zone,
    index character varying(8),
    key character varying,
    create_date timestamp without time zone DEFAULT (now() AT TIME ZONE 'utc'::text),
    CONSTRAINT auth_totp_device_index_check CHECK ((char_length((index)::text) = 8))
);


--
-- Name: auth_totp_device_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.auth_totp_device_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: auth_totp_device_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.auth_totp_device_id_seq OWNED BY public.auth_totp_device.id;


--
-- Name: auth_totp_rate_limit_log; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.auth_totp_rate_limit_log (
    id integer NOT NULL,
    user_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    ip character varying,
    limit_type character varying,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE auth_totp_rate_limit_log; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.auth_totp_rate_limit_log IS 'TOTP rate limit logs';


--
-- Name: COLUMN auth_totp_rate_limit_log.user_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.auth_totp_rate_limit_log.user_id IS 'User';


--
-- Name: COLUMN auth_totp_rate_limit_log.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.auth_totp_rate_limit_log.create_uid IS 'Created by';


--
-- Name: COLUMN auth_totp_rate_limit_log.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.auth_totp_rate_limit_log.write_uid IS 'Last Updated by';


--
-- Name: COLUMN auth_totp_rate_limit_log.ip; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.auth_totp_rate_limit_log.ip IS 'Ip';


--
-- Name: COLUMN auth_totp_rate_limit_log.limit_type; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.auth_totp_rate_limit_log.limit_type IS 'Limit Type';


--
-- Name: COLUMN auth_totp_rate_limit_log.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.auth_totp_rate_limit_log.create_date IS 'Created on';


--
-- Name: COLUMN auth_totp_rate_limit_log.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.auth_totp_rate_limit_log.write_date IS 'Last Updated on';


--
-- Name: auth_totp_rate_limit_log_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.auth_totp_rate_limit_log_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: auth_totp_rate_limit_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.auth_totp_rate_limit_log_id_seq OWNED BY public.auth_totp_rate_limit_log.id;


--
-- Name: auth_totp_wizard; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.auth_totp_wizard (
    id integer NOT NULL,
    user_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    secret character varying NOT NULL,
    url character varying,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    qrcode bytea
);


--
-- Name: TABLE auth_totp_wizard; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.auth_totp_wizard IS '2-Factor Setup Wizard';


--
-- Name: COLUMN auth_totp_wizard.user_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.auth_totp_wizard.user_id IS 'User';


--
-- Name: COLUMN auth_totp_wizard.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.auth_totp_wizard.create_uid IS 'Created by';


--
-- Name: COLUMN auth_totp_wizard.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.auth_totp_wizard.write_uid IS 'Last Updated by';


--
-- Name: COLUMN auth_totp_wizard.secret; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.auth_totp_wizard.secret IS 'Secret';


--
-- Name: COLUMN auth_totp_wizard.url; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.auth_totp_wizard.url IS 'Url';


--
-- Name: COLUMN auth_totp_wizard.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.auth_totp_wizard.create_date IS 'Created on';


--
-- Name: COLUMN auth_totp_wizard.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.auth_totp_wizard.write_date IS 'Last Updated on';


--
-- Name: COLUMN auth_totp_wizard.qrcode; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.auth_totp_wizard.qrcode IS 'Qrcode';


--
-- Name: auth_totp_wizard_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.auth_totp_wizard_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: auth_totp_wizard_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.auth_totp_wizard_id_seq OWNED BY public.auth_totp_wizard.id;


--
-- Name: barcode_nomenclature; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.barcode_nomenclature (
    id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    name character varying NOT NULL,
    upc_ean_conv character varying NOT NULL,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE barcode_nomenclature; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.barcode_nomenclature IS 'Barcode Nomenclature';


--
-- Name: COLUMN barcode_nomenclature.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.barcode_nomenclature.create_uid IS 'Created by';


--
-- Name: COLUMN barcode_nomenclature.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.barcode_nomenclature.write_uid IS 'Last Updated by';


--
-- Name: COLUMN barcode_nomenclature.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.barcode_nomenclature.name IS 'Barcode Nomenclature';


--
-- Name: COLUMN barcode_nomenclature.upc_ean_conv; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.barcode_nomenclature.upc_ean_conv IS 'UPC/EAN Conversion';


--
-- Name: COLUMN barcode_nomenclature.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.barcode_nomenclature.create_date IS 'Created on';


--
-- Name: COLUMN barcode_nomenclature.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.barcode_nomenclature.write_date IS 'Last Updated on';


--
-- Name: barcode_nomenclature_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.barcode_nomenclature_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: barcode_nomenclature_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.barcode_nomenclature_id_seq OWNED BY public.barcode_nomenclature.id;


--
-- Name: barcode_rule; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.barcode_rule (
    id integer NOT NULL,
    barcode_nomenclature_id integer,
    sequence integer,
    create_uid integer,
    write_uid integer,
    name character varying NOT NULL,
    encoding character varying NOT NULL,
    type character varying NOT NULL,
    pattern character varying NOT NULL,
    alias character varying NOT NULL,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE barcode_rule; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.barcode_rule IS 'Barcode Rule';


--
-- Name: COLUMN barcode_rule.barcode_nomenclature_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.barcode_rule.barcode_nomenclature_id IS 'Barcode Nomenclature';


--
-- Name: COLUMN barcode_rule.sequence; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.barcode_rule.sequence IS 'Sequence';


--
-- Name: COLUMN barcode_rule.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.barcode_rule.create_uid IS 'Created by';


--
-- Name: COLUMN barcode_rule.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.barcode_rule.write_uid IS 'Last Updated by';


--
-- Name: COLUMN barcode_rule.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.barcode_rule.name IS 'Rule Name';


--
-- Name: COLUMN barcode_rule.encoding; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.barcode_rule.encoding IS 'Encoding';


--
-- Name: COLUMN barcode_rule.type; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.barcode_rule.type IS 'Type';


--
-- Name: COLUMN barcode_rule.pattern; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.barcode_rule.pattern IS 'Barcode Pattern';


--
-- Name: COLUMN barcode_rule.alias; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.barcode_rule.alias IS 'Alias';


--
-- Name: COLUMN barcode_rule.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.barcode_rule.create_date IS 'Created on';


--
-- Name: COLUMN barcode_rule.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.barcode_rule.write_date IS 'Last Updated on';


--
-- Name: barcode_rule_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.barcode_rule_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: barcode_rule_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.barcode_rule_id_seq OWNED BY public.barcode_rule.id;


--
-- Name: base_document_layout; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.base_document_layout (
    id integer NOT NULL,
    company_id integer NOT NULL,
    report_layout_id integer,
    create_uid integer,
    write_uid integer,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    from_invoice boolean
);


--
-- Name: TABLE base_document_layout; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.base_document_layout IS 'Company Document Layout';


--
-- Name: COLUMN base_document_layout.company_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_document_layout.company_id IS 'Company';


--
-- Name: COLUMN base_document_layout.report_layout_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_document_layout.report_layout_id IS 'Report Layout';


--
-- Name: COLUMN base_document_layout.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_document_layout.create_uid IS 'Created by';


--
-- Name: COLUMN base_document_layout.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_document_layout.write_uid IS 'Last Updated by';


--
-- Name: COLUMN base_document_layout.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_document_layout.create_date IS 'Created on';


--
-- Name: COLUMN base_document_layout.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_document_layout.write_date IS 'Last Updated on';


--
-- Name: COLUMN base_document_layout.from_invoice; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_document_layout.from_invoice IS 'From Invoice';


--
-- Name: base_document_layout_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.base_document_layout_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: base_document_layout_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.base_document_layout_id_seq OWNED BY public.base_document_layout.id;


--
-- Name: base_enable_profiling_wizard; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.base_enable_profiling_wizard (
    id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    duration character varying,
    expiration timestamp without time zone,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE base_enable_profiling_wizard; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.base_enable_profiling_wizard IS 'Enable profiling for some time';


--
-- Name: COLUMN base_enable_profiling_wizard.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_enable_profiling_wizard.create_uid IS 'Created by';


--
-- Name: COLUMN base_enable_profiling_wizard.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_enable_profiling_wizard.write_uid IS 'Last Updated by';


--
-- Name: COLUMN base_enable_profiling_wizard.duration; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_enable_profiling_wizard.duration IS 'Enable profiling for';


--
-- Name: COLUMN base_enable_profiling_wizard.expiration; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_enable_profiling_wizard.expiration IS 'Enable profiling until';


--
-- Name: COLUMN base_enable_profiling_wizard.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_enable_profiling_wizard.create_date IS 'Created on';


--
-- Name: COLUMN base_enable_profiling_wizard.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_enable_profiling_wizard.write_date IS 'Last Updated on';


--
-- Name: base_enable_profiling_wizard_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.base_enable_profiling_wizard_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: base_enable_profiling_wizard_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.base_enable_profiling_wizard_id_seq OWNED BY public.base_enable_profiling_wizard.id;


--
-- Name: base_import_import; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.base_import_import (
    id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    res_model character varying,
    file_name character varying,
    file_type character varying,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    file bytea
);


--
-- Name: TABLE base_import_import; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.base_import_import IS 'Base Import';


--
-- Name: COLUMN base_import_import.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_import.create_uid IS 'Created by';


--
-- Name: COLUMN base_import_import.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_import.write_uid IS 'Last Updated by';


--
-- Name: COLUMN base_import_import.res_model; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_import.res_model IS 'Model';


--
-- Name: COLUMN base_import_import.file_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_import.file_name IS 'File Name';


--
-- Name: COLUMN base_import_import.file_type; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_import.file_type IS 'File Type';


--
-- Name: COLUMN base_import_import.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_import.create_date IS 'Created on';


--
-- Name: COLUMN base_import_import.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_import.write_date IS 'Last Updated on';


--
-- Name: COLUMN base_import_import.file; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_import.file IS 'File';


--
-- Name: base_import_import_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.base_import_import_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: base_import_import_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.base_import_import_id_seq OWNED BY public.base_import_import.id;


--
-- Name: base_import_mapping; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.base_import_mapping (
    id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    res_model character varying,
    column_name character varying,
    field_name character varying,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE base_import_mapping; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.base_import_mapping IS 'Base Import Mapping';


--
-- Name: COLUMN base_import_mapping.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_mapping.create_uid IS 'Created by';


--
-- Name: COLUMN base_import_mapping.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_mapping.write_uid IS 'Last Updated by';


--
-- Name: COLUMN base_import_mapping.res_model; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_mapping.res_model IS 'Res Model';


--
-- Name: COLUMN base_import_mapping.column_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_mapping.column_name IS 'Column Name';


--
-- Name: COLUMN base_import_mapping.field_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_mapping.field_name IS 'Field Name';


--
-- Name: COLUMN base_import_mapping.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_mapping.create_date IS 'Created on';


--
-- Name: COLUMN base_import_mapping.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_mapping.write_date IS 'Last Updated on';


--
-- Name: base_import_mapping_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.base_import_mapping_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: base_import_mapping_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.base_import_mapping_id_seq OWNED BY public.base_import_mapping.id;


--
-- Name: base_import_module; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.base_import_module (
    id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    state character varying,
    import_message text,
    modules_dependencies text,
    force boolean,
    with_demo boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    module_file bytea NOT NULL
);


--
-- Name: TABLE base_import_module; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.base_import_module IS 'Import Module';


--
-- Name: COLUMN base_import_module.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_module.create_uid IS 'Created by';


--
-- Name: COLUMN base_import_module.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_module.write_uid IS 'Last Updated by';


--
-- Name: COLUMN base_import_module.state; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_module.state IS 'Status';


--
-- Name: COLUMN base_import_module.import_message; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_module.import_message IS 'Import Message';


--
-- Name: COLUMN base_import_module.modules_dependencies; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_module.modules_dependencies IS 'Modules Dependencies';


--
-- Name: COLUMN base_import_module.force; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_module.force IS 'Force init';


--
-- Name: COLUMN base_import_module.with_demo; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_module.with_demo IS 'Import demo data of module';


--
-- Name: COLUMN base_import_module.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_module.create_date IS 'Created on';


--
-- Name: COLUMN base_import_module.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_module.write_date IS 'Last Updated on';


--
-- Name: COLUMN base_import_module.module_file; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_import_module.module_file IS 'Module .ZIP file';


--
-- Name: base_import_module_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.base_import_module_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: base_import_module_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.base_import_module_id_seq OWNED BY public.base_import_module.id;


--
-- Name: base_language_export; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.base_language_export (
    id integer NOT NULL,
    model_id integer,
    create_uid integer,
    write_uid integer,
    name character varying,
    lang character varying NOT NULL,
    format character varying NOT NULL,
    export_type character varying NOT NULL,
    domain character varying,
    state character varying,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    data bytea
);


--
-- Name: TABLE base_language_export; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.base_language_export IS 'Language Export';


--
-- Name: COLUMN base_language_export.model_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_export.model_id IS 'Model to Export';


--
-- Name: COLUMN base_language_export.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_export.create_uid IS 'Created by';


--
-- Name: COLUMN base_language_export.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_export.write_uid IS 'Last Updated by';


--
-- Name: COLUMN base_language_export.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_export.name IS 'File Name';


--
-- Name: COLUMN base_language_export.lang; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_export.lang IS 'Language';


--
-- Name: COLUMN base_language_export.format; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_export.format IS 'File Format';


--
-- Name: COLUMN base_language_export.export_type; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_export.export_type IS 'Export Type';


--
-- Name: COLUMN base_language_export.domain; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_export.domain IS 'Model Domain';


--
-- Name: COLUMN base_language_export.state; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_export.state IS 'State';


--
-- Name: COLUMN base_language_export.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_export.create_date IS 'Created on';


--
-- Name: COLUMN base_language_export.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_export.write_date IS 'Last Updated on';


--
-- Name: COLUMN base_language_export.data; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_export.data IS 'File';


--
-- Name: base_language_export_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.base_language_export_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: base_language_export_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.base_language_export_id_seq OWNED BY public.base_language_export.id;


--
-- Name: base_language_import; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.base_language_import (
    id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    name character varying NOT NULL,
    code character varying NOT NULL,
    filename character varying NOT NULL,
    overwrite boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    data bytea NOT NULL
);


--
-- Name: TABLE base_language_import; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.base_language_import IS 'Language Import';


--
-- Name: COLUMN base_language_import.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_import.create_uid IS 'Created by';


--
-- Name: COLUMN base_language_import.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_import.write_uid IS 'Last Updated by';


--
-- Name: COLUMN base_language_import.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_import.name IS 'Language Name';


--
-- Name: COLUMN base_language_import.code; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_import.code IS 'ISO Code';


--
-- Name: COLUMN base_language_import.filename; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_import.filename IS 'File Name';


--
-- Name: COLUMN base_language_import.overwrite; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_import.overwrite IS 'Overwrite Existing Terms';


--
-- Name: COLUMN base_language_import.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_import.create_date IS 'Created on';


--
-- Name: COLUMN base_language_import.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_import.write_date IS 'Last Updated on';


--
-- Name: COLUMN base_language_import.data; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_import.data IS 'File';


--
-- Name: base_language_import_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.base_language_import_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: base_language_import_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.base_language_import_id_seq OWNED BY public.base_language_import.id;


--
-- Name: base_language_install; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.base_language_install (
    id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    overwrite boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE base_language_install; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.base_language_install IS 'Install Language';


--
-- Name: COLUMN base_language_install.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_install.create_uid IS 'Created by';


--
-- Name: COLUMN base_language_install.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_install.write_uid IS 'Last Updated by';


--
-- Name: COLUMN base_language_install.overwrite; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_install.overwrite IS 'Overwrite Existing Terms';


--
-- Name: COLUMN base_language_install.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_install.create_date IS 'Created on';


--
-- Name: COLUMN base_language_install.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_language_install.write_date IS 'Last Updated on';


--
-- Name: base_language_install_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.base_language_install_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: base_language_install_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.base_language_install_id_seq OWNED BY public.base_language_install.id;


--
-- Name: base_language_install_website_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.base_language_install_website_rel (
    base_language_install_id integer NOT NULL,
    website_id integer NOT NULL
);


--
-- Name: TABLE base_language_install_website_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.base_language_install_website_rel IS 'RELATION BETWEEN base_language_install AND website';


--
-- Name: base_module_install_request; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.base_module_install_request (
    id integer NOT NULL,
    module_id integer NOT NULL,
    user_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    body_html text,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE base_module_install_request; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.base_module_install_request IS 'Module Activation Request';


--
-- Name: COLUMN base_module_install_request.module_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_install_request.module_id IS 'Module';


--
-- Name: COLUMN base_module_install_request.user_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_install_request.user_id IS 'User';


--
-- Name: COLUMN base_module_install_request.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_install_request.create_uid IS 'Created by';


--
-- Name: COLUMN base_module_install_request.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_install_request.write_uid IS 'Last Updated by';


--
-- Name: COLUMN base_module_install_request.body_html; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_install_request.body_html IS 'Body';


--
-- Name: COLUMN base_module_install_request.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_install_request.create_date IS 'Created on';


--
-- Name: COLUMN base_module_install_request.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_install_request.write_date IS 'Last Updated on';


--
-- Name: base_module_install_request_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.base_module_install_request_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: base_module_install_request_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.base_module_install_request_id_seq OWNED BY public.base_module_install_request.id;


--
-- Name: base_module_install_review; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.base_module_install_review (
    id integer NOT NULL,
    module_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE base_module_install_review; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.base_module_install_review IS 'Module Activation Review';


--
-- Name: COLUMN base_module_install_review.module_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_install_review.module_id IS 'Module';


--
-- Name: COLUMN base_module_install_review.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_install_review.create_uid IS 'Created by';


--
-- Name: COLUMN base_module_install_review.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_install_review.write_uid IS 'Last Updated by';


--
-- Name: COLUMN base_module_install_review.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_install_review.create_date IS 'Created on';


--
-- Name: COLUMN base_module_install_review.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_install_review.write_date IS 'Last Updated on';


--
-- Name: base_module_install_review_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.base_module_install_review_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: base_module_install_review_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.base_module_install_review_id_seq OWNED BY public.base_module_install_review.id;


--
-- Name: base_module_uninstall; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.base_module_uninstall (
    id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    show_all boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE base_module_uninstall; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.base_module_uninstall IS 'Module Uninstall';


--
-- Name: COLUMN base_module_uninstall.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_uninstall.create_uid IS 'Created by';


--
-- Name: COLUMN base_module_uninstall.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_uninstall.write_uid IS 'Last Updated by';


--
-- Name: COLUMN base_module_uninstall.show_all; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_uninstall.show_all IS 'Show All';


--
-- Name: COLUMN base_module_uninstall.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_uninstall.create_date IS 'Created on';


--
-- Name: COLUMN base_module_uninstall.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_uninstall.write_date IS 'Last Updated on';


--
-- Name: base_module_uninstall_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.base_module_uninstall_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: base_module_uninstall_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.base_module_uninstall_id_seq OWNED BY public.base_module_uninstall.id;


--
-- Name: base_module_uninstall_ir_module_module_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.base_module_uninstall_ir_module_module_rel (
    base_module_uninstall_id integer NOT NULL,
    ir_module_module_id integer NOT NULL
);


--
-- Name: TABLE base_module_uninstall_ir_module_module_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.base_module_uninstall_ir_module_module_rel IS 'RELATION BETWEEN base_module_uninstall AND ir_module_module';


--
-- Name: base_module_update; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.base_module_update (
    id integer NOT NULL,
    updated integer,
    added integer,
    create_uid integer,
    write_uid integer,
    state character varying,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE base_module_update; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.base_module_update IS 'Update Module';


--
-- Name: COLUMN base_module_update.updated; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_update.updated IS 'Number of modules updated';


--
-- Name: COLUMN base_module_update.added; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_update.added IS 'Number of modules added';


--
-- Name: COLUMN base_module_update.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_update.create_uid IS 'Created by';


--
-- Name: COLUMN base_module_update.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_update.write_uid IS 'Last Updated by';


--
-- Name: COLUMN base_module_update.state; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_update.state IS 'Status';


--
-- Name: COLUMN base_module_update.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_update.create_date IS 'Created on';


--
-- Name: COLUMN base_module_update.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_update.write_date IS 'Last Updated on';


--
-- Name: base_module_update_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.base_module_update_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: base_module_update_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.base_module_update_id_seq OWNED BY public.base_module_update.id;


--
-- Name: base_module_upgrade; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.base_module_upgrade (
    id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    module_info text,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE base_module_upgrade; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.base_module_upgrade IS 'Upgrade Module';


--
-- Name: COLUMN base_module_upgrade.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_upgrade.create_uid IS 'Created by';


--
-- Name: COLUMN base_module_upgrade.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_upgrade.write_uid IS 'Last Updated by';


--
-- Name: COLUMN base_module_upgrade.module_info; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_upgrade.module_info IS 'Apps to Update';


--
-- Name: COLUMN base_module_upgrade.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_upgrade.create_date IS 'Created on';


--
-- Name: COLUMN base_module_upgrade.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_module_upgrade.write_date IS 'Last Updated on';


--
-- Name: base_module_upgrade_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.base_module_upgrade_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: base_module_upgrade_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.base_module_upgrade_id_seq OWNED BY public.base_module_upgrade.id;


--
-- Name: base_partner_merge_automatic_wizard; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.base_partner_merge_automatic_wizard (
    id integer NOT NULL,
    number_group integer,
    current_line_id integer,
    dst_partner_id integer,
    maximum_group integer,
    create_uid integer,
    write_uid integer,
    state character varying NOT NULL,
    group_by_email boolean,
    group_by_name boolean,
    group_by_is_company boolean,
    group_by_vat boolean,
    group_by_parent_id boolean,
    exclude_contact boolean,
    exclude_journal_item boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE base_partner_merge_automatic_wizard; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.base_partner_merge_automatic_wizard IS 'Merge Partner Wizard';


--
-- Name: COLUMN base_partner_merge_automatic_wizard.number_group; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_automatic_wizard.number_group IS 'Group of Contacts';


--
-- Name: COLUMN base_partner_merge_automatic_wizard.current_line_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_automatic_wizard.current_line_id IS 'Current Line';


--
-- Name: COLUMN base_partner_merge_automatic_wizard.dst_partner_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_automatic_wizard.dst_partner_id IS 'Destination Contact';


--
-- Name: COLUMN base_partner_merge_automatic_wizard.maximum_group; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_automatic_wizard.maximum_group IS 'Maximum of Group of Contacts';


--
-- Name: COLUMN base_partner_merge_automatic_wizard.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_automatic_wizard.create_uid IS 'Created by';


--
-- Name: COLUMN base_partner_merge_automatic_wizard.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_automatic_wizard.write_uid IS 'Last Updated by';


--
-- Name: COLUMN base_partner_merge_automatic_wizard.state; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_automatic_wizard.state IS 'State';


--
-- Name: COLUMN base_partner_merge_automatic_wizard.group_by_email; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_automatic_wizard.group_by_email IS 'Email';


--
-- Name: COLUMN base_partner_merge_automatic_wizard.group_by_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_automatic_wizard.group_by_name IS 'Name';


--
-- Name: COLUMN base_partner_merge_automatic_wizard.group_by_is_company; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_automatic_wizard.group_by_is_company IS 'Is Company';


--
-- Name: COLUMN base_partner_merge_automatic_wizard.group_by_vat; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_automatic_wizard.group_by_vat IS 'VAT';


--
-- Name: COLUMN base_partner_merge_automatic_wizard.group_by_parent_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_automatic_wizard.group_by_parent_id IS 'Parent Company';


--
-- Name: COLUMN base_partner_merge_automatic_wizard.exclude_contact; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_automatic_wizard.exclude_contact IS 'A user associated to the contact';


--
-- Name: COLUMN base_partner_merge_automatic_wizard.exclude_journal_item; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_automatic_wizard.exclude_journal_item IS 'Journal Items associated to the contact';


--
-- Name: COLUMN base_partner_merge_automatic_wizard.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_automatic_wizard.create_date IS 'Created on';


--
-- Name: COLUMN base_partner_merge_automatic_wizard.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_automatic_wizard.write_date IS 'Last Updated on';


--
-- Name: base_partner_merge_automatic_wizard_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.base_partner_merge_automatic_wizard_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: base_partner_merge_automatic_wizard_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.base_partner_merge_automatic_wizard_id_seq OWNED BY public.base_partner_merge_automatic_wizard.id;


--
-- Name: base_partner_merge_automatic_wizard_res_partner_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.base_partner_merge_automatic_wizard_res_partner_rel (
    base_partner_merge_automatic_wizard_id integer NOT NULL,
    res_partner_id integer NOT NULL
);


--
-- Name: TABLE base_partner_merge_automatic_wizard_res_partner_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.base_partner_merge_automatic_wizard_res_partner_rel IS 'RELATION BETWEEN base_partner_merge_automatic_wizard AND res_partner';


--
-- Name: base_partner_merge_line; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.base_partner_merge_line (
    id integer NOT NULL,
    wizard_id integer,
    min_id integer,
    create_uid integer,
    write_uid integer,
    aggr_ids character varying NOT NULL,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE base_partner_merge_line; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.base_partner_merge_line IS 'Merge Partner Line';


--
-- Name: COLUMN base_partner_merge_line.wizard_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_line.wizard_id IS 'Wizard';


--
-- Name: COLUMN base_partner_merge_line.min_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_line.min_id IS 'MinID';


--
-- Name: COLUMN base_partner_merge_line.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_line.create_uid IS 'Created by';


--
-- Name: COLUMN base_partner_merge_line.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_line.write_uid IS 'Last Updated by';


--
-- Name: COLUMN base_partner_merge_line.aggr_ids; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_line.aggr_ids IS 'Ids';


--
-- Name: COLUMN base_partner_merge_line.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_line.create_date IS 'Created on';


--
-- Name: COLUMN base_partner_merge_line.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.base_partner_merge_line.write_date IS 'Last Updated on';


--
-- Name: base_partner_merge_line_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.base_partner_merge_line_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: base_partner_merge_line_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.base_partner_merge_line_id_seq OWNED BY public.base_partner_merge_line.id;


--
-- Name: blog_blog; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blog_blog (
    id integer NOT NULL,
    website_id integer,
    sequence integer,
    create_uid integer,
    write_uid integer,
    website_meta_og_img character varying,
    website_meta_title jsonb,
    website_meta_description jsonb,
    website_meta_keywords jsonb,
    seo_name jsonb,
    name jsonb NOT NULL,
    subtitle jsonb,
    content jsonb,
    cover_properties text,
    is_seo_optimized boolean,
    active boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE blog_blog; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.blog_blog IS 'Blog';


--
-- Name: COLUMN blog_blog.website_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_blog.website_id IS 'Website';


--
-- Name: COLUMN blog_blog.sequence; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_blog.sequence IS 'Sequence';


--
-- Name: COLUMN blog_blog.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_blog.create_uid IS 'Created by';


--
-- Name: COLUMN blog_blog.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_blog.write_uid IS 'Last Updated by';


--
-- Name: COLUMN blog_blog.website_meta_og_img; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_blog.website_meta_og_img IS 'Website opengraph image';


--
-- Name: COLUMN blog_blog.website_meta_title; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_blog.website_meta_title IS 'Website meta title';


--
-- Name: COLUMN blog_blog.website_meta_description; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_blog.website_meta_description IS 'Website meta description';


--
-- Name: COLUMN blog_blog.website_meta_keywords; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_blog.website_meta_keywords IS 'Website meta keywords';


--
-- Name: COLUMN blog_blog.seo_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_blog.seo_name IS 'Seo name';


--
-- Name: COLUMN blog_blog.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_blog.name IS 'Blog Name';


--
-- Name: COLUMN blog_blog.subtitle; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_blog.subtitle IS 'Blog Subtitle';


--
-- Name: COLUMN blog_blog.content; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_blog.content IS 'Content';


--
-- Name: COLUMN blog_blog.cover_properties; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_blog.cover_properties IS 'Cover Properties';


--
-- Name: COLUMN blog_blog.is_seo_optimized; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_blog.is_seo_optimized IS 'SEO optimized';


--
-- Name: COLUMN blog_blog.active; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_blog.active IS 'Active';


--
-- Name: COLUMN blog_blog.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_blog.create_date IS 'Created on';


--
-- Name: COLUMN blog_blog.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_blog.write_date IS 'Last Updated on';


--
-- Name: blog_blog_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.blog_blog_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: blog_blog_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.blog_blog_id_seq OWNED BY public.blog_blog.id;


--
-- Name: blog_post; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blog_post (
    id integer NOT NULL,
    website_id integer,
    author_id integer,
    blog_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    visits integer,
    website_meta_og_img character varying,
    author_name character varying,
    website_meta_title jsonb,
    website_meta_description jsonb,
    website_meta_keywords jsonb,
    seo_name jsonb,
    name jsonb NOT NULL,
    subtitle jsonb,
    content jsonb,
    teaser_manual jsonb,
    cover_properties text,
    header_visible boolean,
    footer_visible boolean,
    is_published boolean,
    is_seo_optimized boolean,
    active boolean,
    create_date timestamp without time zone,
    published_date timestamp without time zone,
    post_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE blog_post; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.blog_post IS 'Blog Post';


--
-- Name: COLUMN blog_post.website_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.website_id IS 'Website';


--
-- Name: COLUMN blog_post.author_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.author_id IS 'Author';


--
-- Name: COLUMN blog_post.blog_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.blog_id IS 'Blog';


--
-- Name: COLUMN blog_post.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.create_uid IS 'Created by';


--
-- Name: COLUMN blog_post.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.write_uid IS 'Last Contributor';


--
-- Name: COLUMN blog_post.visits; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.visits IS 'No of Views';


--
-- Name: COLUMN blog_post.website_meta_og_img; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.website_meta_og_img IS 'Website opengraph image';


--
-- Name: COLUMN blog_post.author_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.author_name IS 'Author Name';


--
-- Name: COLUMN blog_post.website_meta_title; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.website_meta_title IS 'Website meta title';


--
-- Name: COLUMN blog_post.website_meta_description; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.website_meta_description IS 'Website meta description';


--
-- Name: COLUMN blog_post.website_meta_keywords; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.website_meta_keywords IS 'Website meta keywords';


--
-- Name: COLUMN blog_post.seo_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.seo_name IS 'Seo name';


--
-- Name: COLUMN blog_post.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.name IS 'Title';


--
-- Name: COLUMN blog_post.subtitle; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.subtitle IS 'Sub Title';


--
-- Name: COLUMN blog_post.content; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.content IS 'Content';


--
-- Name: COLUMN blog_post.teaser_manual; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.teaser_manual IS 'Teaser Content';


--
-- Name: COLUMN blog_post.cover_properties; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.cover_properties IS 'Cover Properties';


--
-- Name: COLUMN blog_post.header_visible; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.header_visible IS 'Header Visible';


--
-- Name: COLUMN blog_post.footer_visible; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.footer_visible IS 'Footer Visible';


--
-- Name: COLUMN blog_post.is_published; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.is_published IS 'Is Published';


--
-- Name: COLUMN blog_post.is_seo_optimized; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.is_seo_optimized IS 'SEO optimized';


--
-- Name: COLUMN blog_post.active; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.active IS 'Active';


--
-- Name: COLUMN blog_post.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.create_date IS 'Created on';


--
-- Name: COLUMN blog_post.published_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.published_date IS 'Published Date';


--
-- Name: COLUMN blog_post.post_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.post_date IS 'Publishing date';


--
-- Name: COLUMN blog_post.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_post.write_date IS 'Last Updated on';


--
-- Name: blog_post_blog_tag_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blog_post_blog_tag_rel (
    blog_tag_id integer NOT NULL,
    blog_post_id integer NOT NULL
);


--
-- Name: TABLE blog_post_blog_tag_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.blog_post_blog_tag_rel IS 'RELATION BETWEEN blog_tag AND blog_post';


--
-- Name: blog_post_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.blog_post_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: blog_post_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.blog_post_id_seq OWNED BY public.blog_post.id;


--
-- Name: blog_tag; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blog_tag (
    id integer NOT NULL,
    category_id integer,
    color integer,
    create_uid integer,
    write_uid integer,
    website_meta_og_img character varying,
    website_meta_title jsonb,
    website_meta_description jsonb,
    website_meta_keywords jsonb,
    seo_name jsonb,
    name jsonb NOT NULL,
    is_seo_optimized boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE blog_tag; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.blog_tag IS 'Blog Tag';


--
-- Name: COLUMN blog_tag.category_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_tag.category_id IS 'Category';


--
-- Name: COLUMN blog_tag.color; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_tag.color IS 'Color';


--
-- Name: COLUMN blog_tag.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_tag.create_uid IS 'Created by';


--
-- Name: COLUMN blog_tag.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_tag.write_uid IS 'Last Updated by';


--
-- Name: COLUMN blog_tag.website_meta_og_img; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_tag.website_meta_og_img IS 'Website opengraph image';


--
-- Name: COLUMN blog_tag.website_meta_title; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_tag.website_meta_title IS 'Website meta title';


--
-- Name: COLUMN blog_tag.website_meta_description; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_tag.website_meta_description IS 'Website meta description';


--
-- Name: COLUMN blog_tag.website_meta_keywords; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_tag.website_meta_keywords IS 'Website meta keywords';


--
-- Name: COLUMN blog_tag.seo_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_tag.seo_name IS 'Seo name';


--
-- Name: COLUMN blog_tag.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_tag.name IS 'Name';


--
-- Name: COLUMN blog_tag.is_seo_optimized; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_tag.is_seo_optimized IS 'SEO optimized';


--
-- Name: COLUMN blog_tag.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_tag.create_date IS 'Created on';


--
-- Name: COLUMN blog_tag.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_tag.write_date IS 'Last Updated on';


--
-- Name: blog_tag_category; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.blog_tag_category (
    id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    name jsonb NOT NULL,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE blog_tag_category; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.blog_tag_category IS 'Blog Tag Category';


--
-- Name: COLUMN blog_tag_category.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_tag_category.create_uid IS 'Created by';


--
-- Name: COLUMN blog_tag_category.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_tag_category.write_uid IS 'Last Updated by';


--
-- Name: COLUMN blog_tag_category.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_tag_category.name IS 'Name';


--
-- Name: COLUMN blog_tag_category.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_tag_category.create_date IS 'Created on';


--
-- Name: COLUMN blog_tag_category.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.blog_tag_category.write_date IS 'Last Updated on';


--
-- Name: blog_tag_category_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.blog_tag_category_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: blog_tag_category_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.blog_tag_category_id_seq OWNED BY public.blog_tag_category.id;


--
-- Name: blog_tag_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.blog_tag_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: blog_tag_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.blog_tag_id_seq OWNED BY public.blog_tag.id;


--
-- Name: bus_bus; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.bus_bus (
    id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    channel character varying,
    message character varying,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE bus_bus; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.bus_bus IS 'Communication Bus';


--
-- Name: COLUMN bus_bus.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.bus_bus.create_uid IS 'Created by';


--
-- Name: COLUMN bus_bus.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.bus_bus.write_uid IS 'Last Updated by';


--
-- Name: COLUMN bus_bus.channel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.bus_bus.channel IS 'Channel';


--
-- Name: COLUMN bus_bus.message; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.bus_bus.message IS 'Message';


--
-- Name: COLUMN bus_bus.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.bus_bus.create_date IS 'Created on';


--
-- Name: COLUMN bus_bus.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.bus_bus.write_date IS 'Last Updated on';


--
-- Name: bus_bus_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.bus_bus_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: bus_bus_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.bus_bus_id_seq OWNED BY public.bus_bus.id;


--
-- Name: change_password_own; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.change_password_own (
    id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    new_password character varying,
    confirm_password character varying,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE change_password_own; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.change_password_own IS 'User, change own password wizard';


--
-- Name: COLUMN change_password_own.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.change_password_own.create_uid IS 'Created by';


--
-- Name: COLUMN change_password_own.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.change_password_own.write_uid IS 'Last Updated by';








--
-- Name: COLUMN change_password_own.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.change_password_own.create_date IS 'Created on';


--
-- Name: COLUMN change_password_own.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.change_password_own.write_date IS 'Last Updated on';


--
-- Name: change_password_own_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.change_password_own_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: change_password_own_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.change_password_own_id_seq OWNED BY public.change_password_own.id;


--
-- Name: change_password_user; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.change_password_user (
    id integer NOT NULL,
    wizard_id integer NOT NULL,
    user_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    user_login character varying,
    new_passwd character varying,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE change_password_user; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.change_password_user IS 'User, Change Password Wizard';


--
-- Name: COLUMN change_password_user.wizard_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.change_password_user.wizard_id IS 'Wizard';


--
-- Name: COLUMN change_password_user.user_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.change_password_user.user_id IS 'User';


--
-- Name: COLUMN change_password_user.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.change_password_user.create_uid IS 'Created by';


--
-- Name: COLUMN change_password_user.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.change_password_user.write_uid IS 'Last Updated by';


--
-- Name: COLUMN change_password_user.user_login; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.change_password_user.user_login IS 'User Login';





--
-- Name: COLUMN change_password_user.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.change_password_user.create_date IS 'Created on';


--
-- Name: COLUMN change_password_user.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.change_password_user.write_date IS 'Last Updated on';


--
-- Name: change_password_user_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.change_password_user_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: change_password_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.change_password_user_id_seq OWNED BY public.change_password_user.id;


--
-- Name: change_password_wizard; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.change_password_wizard (
    id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE change_password_wizard; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.change_password_wizard IS 'Change Password Wizard';


--
-- Name: COLUMN change_password_wizard.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.change_password_wizard.create_uid IS 'Created by';


--
-- Name: COLUMN change_password_wizard.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.change_password_wizard.write_uid IS 'Last Updated by';


--
-- Name: COLUMN change_password_wizard.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.change_password_wizard.create_date IS 'Created on';


--
-- Name: COLUMN change_password_wizard.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.change_password_wizard.write_date IS 'Last Updated on';


--
-- Name: change_password_wizard_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.change_password_wizard_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: change_password_wizard_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.change_password_wizard_id_seq OWNED BY public.change_password_wizard.id;


--
-- Name: choose_delivery_carrier; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.choose_delivery_carrier (
    id integer NOT NULL,
    order_id integer NOT NULL,
    carrier_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    weight_uom_name character varying,
    delivery_message text,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    delivery_price double precision,
    display_price double precision
);


--
-- Name: TABLE choose_delivery_carrier; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.choose_delivery_carrier IS 'Delivery Carrier Selection Wizard';


--
-- Name: COLUMN choose_delivery_carrier.order_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.choose_delivery_carrier.order_id IS 'Order';


--
-- Name: COLUMN choose_delivery_carrier.carrier_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.choose_delivery_carrier.carrier_id IS 'Shipping Method';


--
-- Name: COLUMN choose_delivery_carrier.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.choose_delivery_carrier.create_uid IS 'Created by';


--
-- Name: COLUMN choose_delivery_carrier.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.choose_delivery_carrier.write_uid IS 'Last Updated by';


--
-- Name: COLUMN choose_delivery_carrier.weight_uom_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.choose_delivery_carrier.weight_uom_name IS 'Weight Uom Name';


--
-- Name: COLUMN choose_delivery_carrier.delivery_message; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.choose_delivery_carrier.delivery_message IS 'Delivery Message';


--
-- Name: COLUMN choose_delivery_carrier.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.choose_delivery_carrier.create_date IS 'Created on';


--
-- Name: COLUMN choose_delivery_carrier.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.choose_delivery_carrier.write_date IS 'Last Updated on';


--
-- Name: COLUMN choose_delivery_carrier.delivery_price; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.choose_delivery_carrier.delivery_price IS 'Delivery Price';


--
-- Name: COLUMN choose_delivery_carrier.display_price; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.choose_delivery_carrier.display_price IS 'Cost';


--
-- Name: choose_delivery_carrier_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.choose_delivery_carrier_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: choose_delivery_carrier_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.choose_delivery_carrier_id_seq OWNED BY public.choose_delivery_carrier.id;


--
-- Name: crm_tag; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.crm_tag (
    id integer NOT NULL,
    color integer,
    create_uid integer,
    write_uid integer,
    name jsonb NOT NULL,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE crm_tag; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.crm_tag IS 'CRM Tag';


--
-- Name: COLUMN crm_tag.color; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_tag.color IS 'Color';


--
-- Name: COLUMN crm_tag.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_tag.create_uid IS 'Created by';


--
-- Name: COLUMN crm_tag.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_tag.write_uid IS 'Last Updated by';


--
-- Name: COLUMN crm_tag.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_tag.name IS 'Tag Name';


--
-- Name: COLUMN crm_tag.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_tag.create_date IS 'Created on';


--
-- Name: COLUMN crm_tag.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_tag.write_date IS 'Last Updated on';


--
-- Name: crm_tag_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.crm_tag_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: crm_tag_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.crm_tag_id_seq OWNED BY public.crm_tag.id;


--
-- Name: crm_team; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.crm_team (
    id integer NOT NULL,
    sequence integer,
    company_id integer,
    user_id integer,
    color integer,
    create_uid integer,
    write_uid integer,
    name jsonb NOT NULL,
    active boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    invoiced_target double precision
);


--
-- Name: TABLE crm_team; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.crm_team IS 'Sales Team';


--
-- Name: COLUMN crm_team.sequence; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_team.sequence IS 'Sequence';


--
-- Name: COLUMN crm_team.company_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_team.company_id IS 'Company';


--
-- Name: COLUMN crm_team.user_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_team.user_id IS 'Team Leader';


--
-- Name: COLUMN crm_team.color; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_team.color IS 'Color Index';


--
-- Name: COLUMN crm_team.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_team.create_uid IS 'Created by';


--
-- Name: COLUMN crm_team.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_team.write_uid IS 'Last Updated by';


--
-- Name: COLUMN crm_team.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_team.name IS 'Sales Team';


--
-- Name: COLUMN crm_team.active; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_team.active IS 'Active';


--
-- Name: COLUMN crm_team.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_team.create_date IS 'Created on';


--
-- Name: COLUMN crm_team.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_team.write_date IS 'Last Updated on';


--
-- Name: COLUMN crm_team.invoiced_target; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_team.invoiced_target IS 'Invoicing Target';


--
-- Name: crm_team_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.crm_team_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: crm_team_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.crm_team_id_seq OWNED BY public.crm_team.id;


--
-- Name: crm_team_member; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.crm_team_member (
    id integer NOT NULL,
    crm_team_id integer NOT NULL,
    user_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    active boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE crm_team_member; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.crm_team_member IS 'Sales Team Member';


--
-- Name: COLUMN crm_team_member.crm_team_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_team_member.crm_team_id IS 'Sales Team';


--
-- Name: COLUMN crm_team_member.user_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_team_member.user_id IS 'Salesperson';


--
-- Name: COLUMN crm_team_member.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_team_member.create_uid IS 'Created by';


--
-- Name: COLUMN crm_team_member.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_team_member.write_uid IS 'Last Updated by';


--
-- Name: COLUMN crm_team_member.active; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_team_member.active IS 'Active';


--
-- Name: COLUMN crm_team_member.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_team_member.create_date IS 'Created on';


--
-- Name: COLUMN crm_team_member.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.crm_team_member.write_date IS 'Last Updated on';


--
-- Name: crm_team_member_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.crm_team_member_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: crm_team_member_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.crm_team_member_id_seq OWNED BY public.crm_team_member.id;


--
-- Name: decimal_precision; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.decimal_precision (
    id integer NOT NULL,
    digits integer NOT NULL,
    create_uid integer,
    write_uid integer,
    name character varying NOT NULL,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE decimal_precision; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.decimal_precision IS 'Decimal Precision';


--
-- Name: COLUMN decimal_precision.digits; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.decimal_precision.digits IS 'Digits';


--
-- Name: COLUMN decimal_precision.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.decimal_precision.create_uid IS 'Created by';


--
-- Name: COLUMN decimal_precision.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.decimal_precision.write_uid IS 'Last Updated by';


--
-- Name: COLUMN decimal_precision.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.decimal_precision.name IS 'Usage';


--
-- Name: COLUMN decimal_precision.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.decimal_precision.create_date IS 'Created on';


--
-- Name: COLUMN decimal_precision.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.decimal_precision.write_date IS 'Last Updated on';


--
-- Name: decimal_precision_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.decimal_precision_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: decimal_precision_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.decimal_precision_id_seq OWNED BY public.decimal_precision.id;


--
-- Name: delivery_carrier; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.delivery_carrier (
    id integer NOT NULL,
    sequence integer,
    company_id integer,
    product_id integer NOT NULL,
    shipping_insurance integer,
    create_uid integer,
    write_uid integer,
    delivery_type character varying NOT NULL,
    integration_level character varying,
    tracking_url character varying,
    invoice_policy character varying NOT NULL,
    name jsonb NOT NULL,
    carrier_description jsonb,
    active boolean,
    allow_cash_on_delivery boolean,
    prod_environment boolean,
    debug_logging boolean,
    free_over boolean,
    return_label_on_delivery boolean,
    get_return_label_from_portal boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    max_weight double precision,
    max_volume double precision,
    margin double precision,
    fixed_margin double precision,
    amount double precision,
    fixed_price double precision,
    website_id integer,
    is_published boolean,
    CONSTRAINT delivery_carrier_margin_not_under_100_percent CHECK ((margin >= ('-1'::integer)::double precision)),
    CONSTRAINT delivery_carrier_shipping_insurance_is_percentage CHECK (((shipping_insurance >= 0) AND (shipping_insurance <= 100)))
);


--
-- Name: TABLE delivery_carrier; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.delivery_carrier IS 'Shipping Methods';


--
-- Name: COLUMN delivery_carrier.sequence; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.sequence IS 'Sequence';


--
-- Name: COLUMN delivery_carrier.company_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.company_id IS 'Company';


--
-- Name: COLUMN delivery_carrier.product_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.product_id IS 'Delivery Product';


--
-- Name: COLUMN delivery_carrier.shipping_insurance; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.shipping_insurance IS 'Insurance Percentage';


--
-- Name: COLUMN delivery_carrier.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.create_uid IS 'Created by';


--
-- Name: COLUMN delivery_carrier.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.write_uid IS 'Last Updated by';


--
-- Name: COLUMN delivery_carrier.delivery_type; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.delivery_type IS 'Provider';


--
-- Name: COLUMN delivery_carrier.integration_level; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.integration_level IS 'Integration Level';


--
-- Name: COLUMN delivery_carrier.tracking_url; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.tracking_url IS 'Tracking Link';


--
-- Name: COLUMN delivery_carrier.invoice_policy; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.invoice_policy IS 'Invoicing Policy';


--
-- Name: COLUMN delivery_carrier.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.name IS 'Delivery Method';


--
-- Name: COLUMN delivery_carrier.carrier_description; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.carrier_description IS 'Carrier Description';


--
-- Name: COLUMN delivery_carrier.active; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.active IS 'Active';


--
-- Name: COLUMN delivery_carrier.allow_cash_on_delivery; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.allow_cash_on_delivery IS 'Cash on Delivery';


--
-- Name: COLUMN delivery_carrier.prod_environment; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.prod_environment IS 'Environment';


--
-- Name: COLUMN delivery_carrier.debug_logging; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.debug_logging IS 'Debug logging';


--
-- Name: COLUMN delivery_carrier.free_over; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.free_over IS 'Free if order amount is above';


--
-- Name: COLUMN delivery_carrier.return_label_on_delivery; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.return_label_on_delivery IS 'Generate Return Label';


--
-- Name: COLUMN delivery_carrier.get_return_label_from_portal; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.get_return_label_from_portal IS 'Return Label Accessible from Customer Portal';


--
-- Name: COLUMN delivery_carrier.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.create_date IS 'Created on';


--
-- Name: COLUMN delivery_carrier.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.write_date IS 'Last Updated on';


--
-- Name: COLUMN delivery_carrier.max_weight; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.max_weight IS 'Max Weight';


--
-- Name: COLUMN delivery_carrier.max_volume; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.max_volume IS 'Max Volume';


--
-- Name: COLUMN delivery_carrier.margin; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.margin IS 'Margin';


--
-- Name: COLUMN delivery_carrier.fixed_margin; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.fixed_margin IS 'Fixed Margin';


--
-- Name: COLUMN delivery_carrier.amount; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.amount IS 'Amount';


--
-- Name: COLUMN delivery_carrier.fixed_price; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.fixed_price IS 'Fixed Price';


--
-- Name: COLUMN delivery_carrier.website_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.website_id IS 'Website';


--
-- Name: COLUMN delivery_carrier.is_published; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_carrier.is_published IS 'Is Published';


--
-- Name: CONSTRAINT delivery_carrier_margin_not_under_100_percent ON delivery_carrier; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON CONSTRAINT delivery_carrier_margin_not_under_100_percent ON public.delivery_carrier IS 'CHECK (margin >= -1)';


--
-- Name: CONSTRAINT delivery_carrier_shipping_insurance_is_percentage ON delivery_carrier; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON CONSTRAINT delivery_carrier_shipping_insurance_is_percentage ON public.delivery_carrier IS 'CHECK(shipping_insurance >= 0 AND shipping_insurance <= 100)';


--
-- Name: delivery_carrier_country_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.delivery_carrier_country_rel (
    carrier_id integer NOT NULL,
    country_id integer NOT NULL
);


--
-- Name: TABLE delivery_carrier_country_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.delivery_carrier_country_rel IS 'RELATION BETWEEN delivery_carrier AND res_country';


--
-- Name: delivery_carrier_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.delivery_carrier_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: delivery_carrier_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.delivery_carrier_id_seq OWNED BY public.delivery_carrier.id;


--
-- Name: delivery_carrier_state_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.delivery_carrier_state_rel (
    carrier_id integer NOT NULL,
    state_id integer NOT NULL
);


--
-- Name: TABLE delivery_carrier_state_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.delivery_carrier_state_rel IS 'RELATION BETWEEN delivery_carrier AND res_country_state';


--
-- Name: delivery_price_rule; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.delivery_price_rule (
    id integer NOT NULL,
    sequence integer NOT NULL,
    carrier_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    variable character varying NOT NULL,
    operator character varying NOT NULL,
    variable_factor character varying NOT NULL,
    list_base_price numeric NOT NULL,
    list_price numeric NOT NULL,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    max_value double precision NOT NULL
);


--
-- Name: TABLE delivery_price_rule; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.delivery_price_rule IS 'Delivery Price Rules';


--
-- Name: COLUMN delivery_price_rule.sequence; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_price_rule.sequence IS 'Sequence';


--
-- Name: COLUMN delivery_price_rule.carrier_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_price_rule.carrier_id IS 'Carrier';


--
-- Name: COLUMN delivery_price_rule.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_price_rule.create_uid IS 'Created by';


--
-- Name: COLUMN delivery_price_rule.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_price_rule.write_uid IS 'Last Updated by';


--
-- Name: COLUMN delivery_price_rule.variable; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_price_rule.variable IS 'Variable';


--
-- Name: COLUMN delivery_price_rule.operator; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_price_rule.operator IS 'Operator';


--
-- Name: COLUMN delivery_price_rule.variable_factor; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_price_rule.variable_factor IS 'Variable Factor';


--
-- Name: COLUMN delivery_price_rule.list_base_price; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_price_rule.list_base_price IS 'Sale Base Price';


--
-- Name: COLUMN delivery_price_rule.list_price; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_price_rule.list_price IS 'Sale Price';


--
-- Name: COLUMN delivery_price_rule.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_price_rule.create_date IS 'Created on';


--
-- Name: COLUMN delivery_price_rule.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_price_rule.write_date IS 'Last Updated on';


--
-- Name: COLUMN delivery_price_rule.max_value; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_price_rule.max_value IS 'Maximum Value';


--
-- Name: delivery_price_rule_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.delivery_price_rule_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: delivery_price_rule_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.delivery_price_rule_id_seq OWNED BY public.delivery_price_rule.id;


--
-- Name: delivery_zip_prefix; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.delivery_zip_prefix (
    id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    name character varying NOT NULL,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE delivery_zip_prefix; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.delivery_zip_prefix IS 'Delivery Zip Prefix';


--
-- Name: COLUMN delivery_zip_prefix.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_zip_prefix.create_uid IS 'Created by';


--
-- Name: COLUMN delivery_zip_prefix.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_zip_prefix.write_uid IS 'Last Updated by';


--
-- Name: COLUMN delivery_zip_prefix.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_zip_prefix.name IS 'Prefix';


--
-- Name: COLUMN delivery_zip_prefix.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_zip_prefix.create_date IS 'Created on';


--
-- Name: COLUMN delivery_zip_prefix.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.delivery_zip_prefix.write_date IS 'Last Updated on';


--
-- Name: delivery_zip_prefix_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.delivery_zip_prefix_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: delivery_zip_prefix_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.delivery_zip_prefix_id_seq OWNED BY public.delivery_zip_prefix.id;


--
-- Name: delivery_zip_prefix_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.delivery_zip_prefix_rel (
    carrier_id integer NOT NULL,
    zip_prefix_id integer NOT NULL
);


--
-- Name: TABLE delivery_zip_prefix_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.delivery_zip_prefix_rel IS 'RELATION BETWEEN delivery_carrier AND delivery_zip_prefix';


--
-- Name: digest_digest; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.digest_digest (
    id integer NOT NULL,
    company_id integer,
    create_uid integer,
    write_uid integer,
    periodicity character varying NOT NULL,
    state character varying,
    next_run_date date,
    name jsonb NOT NULL,
    kpi_res_users_connected boolean,
    kpi_mail_message_total boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    kpi_account_total_revenue boolean,
    kpi_account_bank_cash boolean,
    kpi_all_sale_total boolean,
    kpi_website_sale_total boolean
);


--
-- Name: TABLE digest_digest; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.digest_digest IS 'Digest';


--
-- Name: COLUMN digest_digest.company_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_digest.company_id IS 'Company';


--
-- Name: COLUMN digest_digest.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_digest.create_uid IS 'Created by';


--
-- Name: COLUMN digest_digest.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_digest.write_uid IS 'Last Updated by';


--
-- Name: COLUMN digest_digest.periodicity; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_digest.periodicity IS 'Periodicity';


--
-- Name: COLUMN digest_digest.state; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_digest.state IS 'Status';


--
-- Name: COLUMN digest_digest.next_run_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_digest.next_run_date IS 'Next Mailing Date';


--
-- Name: COLUMN digest_digest.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_digest.name IS 'Name';


--
-- Name: COLUMN digest_digest.kpi_res_users_connected; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_digest.kpi_res_users_connected IS 'Connected Users';


--
-- Name: COLUMN digest_digest.kpi_mail_message_total; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_digest.kpi_mail_message_total IS 'Messages Sent';


--
-- Name: COLUMN digest_digest.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_digest.create_date IS 'Created on';


--
-- Name: COLUMN digest_digest.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_digest.write_date IS 'Last Updated on';


--
-- Name: COLUMN digest_digest.kpi_account_total_revenue; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_digest.kpi_account_total_revenue IS 'Revenue';


--
-- Name: COLUMN digest_digest.kpi_account_bank_cash; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_digest.kpi_account_bank_cash IS 'Bank & Cash Moves';


--
-- Name: COLUMN digest_digest.kpi_all_sale_total; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_digest.kpi_all_sale_total IS 'All Sales';


--
-- Name: COLUMN digest_digest.kpi_website_sale_total; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_digest.kpi_website_sale_total IS 'eCommerce Sales';


--
-- Name: digest_digest_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.digest_digest_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: digest_digest_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.digest_digest_id_seq OWNED BY public.digest_digest.id;


--
-- Name: digest_digest_res_users_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.digest_digest_res_users_rel (
    digest_digest_id integer NOT NULL,
    res_users_id integer NOT NULL
);


--
-- Name: TABLE digest_digest_res_users_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.digest_digest_res_users_rel IS 'RELATION BETWEEN digest_digest AND res_users';


--
-- Name: digest_tip; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.digest_tip (
    id integer NOT NULL,
    sequence integer,
    group_id integer,
    create_uid integer,
    write_uid integer,
    name jsonb,
    tip_description jsonb,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE digest_tip; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.digest_tip IS 'Digest Tips';


--
-- Name: COLUMN digest_tip.sequence; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_tip.sequence IS 'Sequence';


--
-- Name: COLUMN digest_tip.group_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_tip.group_id IS 'Authorized Group';


--
-- Name: COLUMN digest_tip.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_tip.create_uid IS 'Created by';


--
-- Name: COLUMN digest_tip.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_tip.write_uid IS 'Last Updated by';


--
-- Name: COLUMN digest_tip.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_tip.name IS 'Name';


--
-- Name: COLUMN digest_tip.tip_description; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_tip.tip_description IS 'Tip description';


--
-- Name: COLUMN digest_tip.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_tip.create_date IS 'Created on';


--
-- Name: COLUMN digest_tip.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.digest_tip.write_date IS 'Last Updated on';


--
-- Name: digest_tip_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.digest_tip_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: digest_tip_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.digest_tip_id_seq OWNED BY public.digest_tip.id;


--
-- Name: digest_tip_res_users_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.digest_tip_res_users_rel (
    digest_tip_id integer NOT NULL,
    res_users_id integer NOT NULL
);


--
-- Name: TABLE digest_tip_res_users_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.digest_tip_res_users_rel IS 'RELATION BETWEEN digest_tip AND res_users';


--
-- Name: discuss_call_history; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.discuss_call_history (
    id integer NOT NULL,
    channel_id integer NOT NULL,
    start_call_message_id integer,
    create_uid integer,
    write_uid integer,
    start_dt timestamp without time zone NOT NULL,
    end_dt timestamp without time zone,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    CONSTRAINT discuss_call_history_channel_id_not_null_constraint CHECK ((channel_id IS NOT NULL)),
    CONSTRAINT discuss_call_history_start_dt_is_not_null_constraint CHECK ((start_dt IS NOT NULL))
);


--
-- Name: TABLE discuss_call_history; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.discuss_call_history IS 'Keep the call history';


--
-- Name: COLUMN discuss_call_history.channel_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_call_history.channel_id IS 'Channel';


--
-- Name: COLUMN discuss_call_history.start_call_message_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_call_history.start_call_message_id IS 'Start Call Message';


--
-- Name: COLUMN discuss_call_history.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_call_history.create_uid IS 'Created by';


--
-- Name: COLUMN discuss_call_history.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_call_history.write_uid IS 'Last Updated by';


--
-- Name: COLUMN discuss_call_history.start_dt; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_call_history.start_dt IS 'Start Dt';


--
-- Name: COLUMN discuss_call_history.end_dt; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_call_history.end_dt IS 'End Dt';


--
-- Name: COLUMN discuss_call_history.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_call_history.create_date IS 'Created on';


--
-- Name: COLUMN discuss_call_history.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_call_history.write_date IS 'Last Updated on';


--
-- Name: CONSTRAINT discuss_call_history_channel_id_not_null_constraint ON discuss_call_history; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON CONSTRAINT discuss_call_history_channel_id_not_null_constraint ON public.discuss_call_history IS 'CHECK (channel_id IS NOT NULL)';


--
-- Name: CONSTRAINT discuss_call_history_start_dt_is_not_null_constraint ON discuss_call_history; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON CONSTRAINT discuss_call_history_start_dt_is_not_null_constraint ON public.discuss_call_history IS 'CHECK (start_dt IS NOT NULL)';


--
-- Name: discuss_call_history_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.discuss_call_history_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: discuss_call_history_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.discuss_call_history_id_seq OWNED BY public.discuss_call_history.id;


--
-- Name: discuss_channel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.discuss_channel (
    id integer NOT NULL,
    parent_channel_id integer,
    from_message_id integer,
    group_public_id integer,
    create_uid integer,
    write_uid integer,
    name character varying NOT NULL,
    channel_type character varying NOT NULL,
    default_display_mode character varying,
    sfu_channel_uuid character varying,
    sfu_server_url character varying,
    uuid character varying(50),
    description text,
    active boolean,
    last_interest_dt timestamp without time zone,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    CONSTRAINT discuss_channel_channel_type_not_null CHECK ((channel_type IS NOT NULL)),
    CONSTRAINT discuss_channel_group_public_id_check CHECK ((((channel_type)::text = 'channel'::text) OR (group_public_id IS NULL)))
);


--
-- Name: TABLE discuss_channel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.discuss_channel IS 'Discussion Channel';


--
-- Name: COLUMN discuss_channel.parent_channel_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel.parent_channel_id IS 'Parent Channel';


--
-- Name: COLUMN discuss_channel.from_message_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel.from_message_id IS 'From Message';


--
-- Name: COLUMN discuss_channel.group_public_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel.group_public_id IS 'Authorized Group';


--
-- Name: COLUMN discuss_channel.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel.create_uid IS 'Created by';


--
-- Name: COLUMN discuss_channel.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel.write_uid IS 'Last Updated by';


--
-- Name: COLUMN discuss_channel.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel.name IS 'Name';


--
-- Name: COLUMN discuss_channel.channel_type; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel.channel_type IS 'Channel Type';


--
-- Name: COLUMN discuss_channel.default_display_mode; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel.default_display_mode IS 'Default Display Mode';


--
-- Name: COLUMN discuss_channel.sfu_channel_uuid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel.sfu_channel_uuid IS 'Sfu Channel Uuid';


--
-- Name: COLUMN discuss_channel.sfu_server_url; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel.sfu_server_url IS 'Sfu Server Url';


--
-- Name: COLUMN discuss_channel.uuid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel.uuid IS 'UUID';


--
-- Name: COLUMN discuss_channel.description; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel.description IS 'Description';


--
-- Name: COLUMN discuss_channel.active; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel.active IS 'Active';


--
-- Name: COLUMN discuss_channel.last_interest_dt; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel.last_interest_dt IS 'Last Interest';


--
-- Name: COLUMN discuss_channel.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel.create_date IS 'Created on';


--
-- Name: COLUMN discuss_channel.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel.write_date IS 'Last Updated on';


--
-- Name: CONSTRAINT discuss_channel_channel_type_not_null ON discuss_channel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON CONSTRAINT discuss_channel_channel_type_not_null ON public.discuss_channel IS 'CHECK(channel_type IS NOT NULL)';


--
-- Name: CONSTRAINT discuss_channel_group_public_id_check ON discuss_channel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON CONSTRAINT discuss_channel_group_public_id_check ON public.discuss_channel IS 'CHECK (channel_type = ''channel'' OR group_public_id IS NULL)';


--
-- Name: discuss_channel_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.discuss_channel_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: discuss_channel_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.discuss_channel_id_seq OWNED BY public.discuss_channel.id;


--
-- Name: discuss_channel_member; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.discuss_channel_member (
    id integer NOT NULL,
    partner_id integer,
    guest_id integer,
    channel_id integer NOT NULL,
    fetched_message_id integer,
    seen_message_id integer,
    new_message_separator integer NOT NULL,
    rtc_inviting_session_id integer,
    create_uid integer,
    write_uid integer,
    custom_channel_name character varying,
    custom_notifications character varying,
    mute_until_dt timestamp without time zone,
    unpin_dt timestamp without time zone,
    last_interest_dt timestamp without time zone,
    last_seen_dt timestamp without time zone,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    CONSTRAINT discuss_channel_member_partner_or_guest_exists CHECK ((((partner_id IS NOT NULL) AND (guest_id IS NULL)) OR ((partner_id IS NULL) AND (guest_id IS NOT NULL))))
);


--
-- Name: TABLE discuss_channel_member; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.discuss_channel_member IS 'Channel Member';


--
-- Name: COLUMN discuss_channel_member.partner_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_member.partner_id IS 'Partner';


--
-- Name: COLUMN discuss_channel_member.guest_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_member.guest_id IS 'Guest';


--
-- Name: COLUMN discuss_channel_member.channel_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_member.channel_id IS 'Channel';


--
-- Name: COLUMN discuss_channel_member.fetched_message_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_member.fetched_message_id IS 'Last Fetched';


--
-- Name: COLUMN discuss_channel_member.seen_message_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_member.seen_message_id IS 'Last Seen';


--
-- Name: COLUMN discuss_channel_member.new_message_separator; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_member.new_message_separator IS 'New Message Separator';


--
-- Name: COLUMN discuss_channel_member.rtc_inviting_session_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_member.rtc_inviting_session_id IS 'Ringing session';


--
-- Name: COLUMN discuss_channel_member.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_member.create_uid IS 'Created by';


--
-- Name: COLUMN discuss_channel_member.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_member.write_uid IS 'Last Updated by';


--
-- Name: COLUMN discuss_channel_member.custom_channel_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_member.custom_channel_name IS 'Custom channel name';


--
-- Name: COLUMN discuss_channel_member.custom_notifications; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_member.custom_notifications IS 'Customized Notifications';


--
-- Name: COLUMN discuss_channel_member.mute_until_dt; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_member.mute_until_dt IS 'Mute notifications until';


--
-- Name: COLUMN discuss_channel_member.unpin_dt; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_member.unpin_dt IS 'Unpin date';


--
-- Name: COLUMN discuss_channel_member.last_interest_dt; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_member.last_interest_dt IS 'Last Interest';


--
-- Name: COLUMN discuss_channel_member.last_seen_dt; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_member.last_seen_dt IS 'Last seen date';


--
-- Name: COLUMN discuss_channel_member.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_member.create_date IS 'Created on';


--
-- Name: COLUMN discuss_channel_member.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_member.write_date IS 'Last Updated on';


--
-- Name: CONSTRAINT discuss_channel_member_partner_or_guest_exists ON discuss_channel_member; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON CONSTRAINT discuss_channel_member_partner_or_guest_exists ON public.discuss_channel_member IS 'CHECK((partner_id IS NOT NULL AND guest_id IS NULL) OR (partner_id IS NULL AND guest_id IS NOT NULL))';


--
-- Name: discuss_channel_member_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.discuss_channel_member_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: discuss_channel_member_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.discuss_channel_member_id_seq OWNED BY public.discuss_channel_member.id;


--
-- Name: discuss_channel_res_groups_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.discuss_channel_res_groups_rel (
    discuss_channel_id integer NOT NULL,
    res_groups_id integer NOT NULL
);


--
-- Name: TABLE discuss_channel_res_groups_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.discuss_channel_res_groups_rel IS 'RELATION BETWEEN discuss_channel AND res_groups';


--
-- Name: discuss_channel_rtc_session; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.discuss_channel_rtc_session (
    id integer NOT NULL,
    channel_member_id integer NOT NULL,
    channel_id integer,
    partner_id integer,
    create_uid integer,
    write_uid integer,
    is_screen_sharing_on boolean,
    is_camera_on boolean,
    is_muted boolean,
    is_deaf boolean,
    write_date timestamp without time zone,
    create_date timestamp without time zone
);


--
-- Name: TABLE discuss_channel_rtc_session; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.discuss_channel_rtc_session IS 'Mail RTC session';


--
-- Name: COLUMN discuss_channel_rtc_session.channel_member_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_rtc_session.channel_member_id IS 'Channel Member';


--
-- Name: COLUMN discuss_channel_rtc_session.channel_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_rtc_session.channel_id IS 'Channel';


--
-- Name: COLUMN discuss_channel_rtc_session.partner_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_rtc_session.partner_id IS 'Partner';


--
-- Name: COLUMN discuss_channel_rtc_session.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_rtc_session.create_uid IS 'Created by';


--
-- Name: COLUMN discuss_channel_rtc_session.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_rtc_session.write_uid IS 'Last Updated by';


--
-- Name: COLUMN discuss_channel_rtc_session.is_screen_sharing_on; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_rtc_session.is_screen_sharing_on IS 'Is sharing the screen';


--
-- Name: COLUMN discuss_channel_rtc_session.is_camera_on; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_rtc_session.is_camera_on IS 'Is sending user video';


--
-- Name: COLUMN discuss_channel_rtc_session.is_muted; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_rtc_session.is_muted IS 'Is microphone muted';


--
-- Name: COLUMN discuss_channel_rtc_session.is_deaf; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_rtc_session.is_deaf IS 'Has disabled incoming sound';


--
-- Name: COLUMN discuss_channel_rtc_session.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_rtc_session.write_date IS 'Last Updated On';


--
-- Name: COLUMN discuss_channel_rtc_session.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_channel_rtc_session.create_date IS 'Created on';


--
-- Name: discuss_channel_rtc_session_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.discuss_channel_rtc_session_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: discuss_channel_rtc_session_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.discuss_channel_rtc_session_id_seq OWNED BY public.discuss_channel_rtc_session.id;


--
-- Name: discuss_gif_favorite; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.discuss_gif_favorite (
    id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    tenor_gif_id character varying NOT NULL,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE discuss_gif_favorite; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.discuss_gif_favorite IS 'Save favorite GIF from Tenor API';


--
-- Name: COLUMN discuss_gif_favorite.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_gif_favorite.create_uid IS 'Created by';


--
-- Name: COLUMN discuss_gif_favorite.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_gif_favorite.write_uid IS 'Last Updated by';


--
-- Name: COLUMN discuss_gif_favorite.tenor_gif_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_gif_favorite.tenor_gif_id IS 'GIF id from Tenor';


--
-- Name: COLUMN discuss_gif_favorite.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_gif_favorite.create_date IS 'Created on';


--
-- Name: COLUMN discuss_gif_favorite.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_gif_favorite.write_date IS 'Last Updated on';


--
-- Name: discuss_gif_favorite_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.discuss_gif_favorite_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: discuss_gif_favorite_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.discuss_gif_favorite_id_seq OWNED BY public.discuss_gif_favorite.id;


--
-- Name: discuss_voice_metadata; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.discuss_voice_metadata (
    id integer NOT NULL,
    attachment_id integer,
    create_uid integer,
    write_uid integer,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE discuss_voice_metadata; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.discuss_voice_metadata IS 'Metadata for voice attachments';


--
-- Name: COLUMN discuss_voice_metadata.attachment_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_voice_metadata.attachment_id IS 'Attachment';


--
-- Name: COLUMN discuss_voice_metadata.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_voice_metadata.create_uid IS 'Created by';


--
-- Name: COLUMN discuss_voice_metadata.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_voice_metadata.write_uid IS 'Last Updated by';


--
-- Name: COLUMN discuss_voice_metadata.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_voice_metadata.create_date IS 'Created on';


--
-- Name: COLUMN discuss_voice_metadata.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.discuss_voice_metadata.write_date IS 'Last Updated on';


--
-- Name: discuss_voice_metadata_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.discuss_voice_metadata_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: discuss_voice_metadata_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.discuss_voice_metadata_id_seq OWNED BY public.discuss_voice_metadata.id;


--
-- Name: dms_acc_rep_export_wizard_format_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.dms_acc_rep_export_wizard_format_rel (
    account_reports_export_wizard_id integer NOT NULL,
    account_reports_export_wizard_format_id integer NOT NULL
);


--
-- Name: TABLE dms_acc_rep_export_wizard_format_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.dms_acc_rep_export_wizard_format_rel IS 'RELATION BETWEEN account_reports_export_wizard AND account_reports_export_wizard_format';


--
-- Name: email_template_attachment_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.email_template_attachment_rel (
    email_template_id integer NOT NULL,
    attachment_id integer NOT NULL
);


--
-- Name: TABLE email_template_attachment_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.email_template_attachment_rel IS 'RELATION BETWEEN mail_template AND ir_attachment';


--
-- Name: event_event; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.event_event (
    id integer NOT NULL,
    user_id integer,
    company_id integer,
    organizer_id integer,
    event_type_id integer,
    stage_id integer,
    seats_max integer,
    address_id integer,
    country_id integer,
    create_uid integer,
    write_uid integer,
    kanban_state character varying,
    kanban_state_label character varying,
    date_tz character varying NOT NULL,
    event_url character varying,
    lang character varying,
    badge_format character varying NOT NULL,
    name jsonb NOT NULL,
    description jsonb,
    registration_properties_definition jsonb,
    ticket_instructions jsonb,
    note text,
    active boolean,
    seats_limited boolean NOT NULL,
    is_multi_slots boolean,
    date_begin timestamp without time zone NOT NULL,
    date_end timestamp without time zone NOT NULL,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    website_id integer,
    menu_id integer,
    website_meta_og_img character varying,
    website_visibility character varying NOT NULL,
    website_meta_title jsonb,
    website_meta_description jsonb,
    website_meta_keywords jsonb,
    seo_name jsonb,
    subtitle jsonb,
    cover_properties text,
    header_visible boolean,
    footer_visible boolean,
    is_published boolean,
    is_seo_optimized boolean,
    website_menu boolean,
    introduction_menu boolean,
    register_menu boolean,
    community_menu boolean
);


--
-- Name: TABLE event_event; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.event_event IS 'Event';


--
-- Name: COLUMN event_event.user_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.user_id IS 'Responsible';


--
-- Name: COLUMN event_event.company_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.company_id IS 'Company';


--
-- Name: COLUMN event_event.organizer_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.organizer_id IS 'Organizer';


--
-- Name: COLUMN event_event.event_type_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.event_type_id IS 'Template';


--
-- Name: COLUMN event_event.stage_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.stage_id IS 'Stage';


--
-- Name: COLUMN event_event.seats_max; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.seats_max IS 'Maximum Attendees';


--
-- Name: COLUMN event_event.address_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.address_id IS 'Venue';


--
-- Name: COLUMN event_event.country_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.country_id IS 'Country';


--
-- Name: COLUMN event_event.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.create_uid IS 'Created by';


--
-- Name: COLUMN event_event.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.write_uid IS 'Last Updated by';


--
-- Name: COLUMN event_event.kanban_state; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.kanban_state IS 'Kanban State';


--
-- Name: COLUMN event_event.kanban_state_label; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.kanban_state_label IS 'Kanban State Label';


--
-- Name: COLUMN event_event.date_tz; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.date_tz IS 'Display Timezone';


--
-- Name: COLUMN event_event.event_url; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.event_url IS 'Online Event URL';


--
-- Name: COLUMN event_event.lang; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.lang IS 'Language';


--
-- Name: COLUMN event_event.badge_format; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.badge_format IS 'Badge Dimension';


--
-- Name: COLUMN event_event.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.name IS 'Event';


--
-- Name: COLUMN event_event.description; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.description IS 'Description';


--
-- Name: COLUMN event_event.registration_properties_definition; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.registration_properties_definition IS 'Registration Properties';


--
-- Name: COLUMN event_event.ticket_instructions; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.ticket_instructions IS 'Ticket Instructions';


--
-- Name: COLUMN event_event.note; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.note IS 'Note';


--
-- Name: COLUMN event_event.active; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.active IS 'Active';


--
-- Name: COLUMN event_event.seats_limited; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.seats_limited IS 'Limit Attendees';


--
-- Name: COLUMN event_event.is_multi_slots; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.is_multi_slots IS 'Is Multi Slots';


--
-- Name: COLUMN event_event.date_begin; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.date_begin IS 'Start Date';


--
-- Name: COLUMN event_event.date_end; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.date_end IS 'End Date';


--
-- Name: COLUMN event_event.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.create_date IS 'Created on';


--
-- Name: COLUMN event_event.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.write_date IS 'Last Updated on';


--
-- Name: COLUMN event_event.website_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.website_id IS 'Website';


--
-- Name: COLUMN event_event.menu_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.menu_id IS 'Event Menu';


--
-- Name: COLUMN event_event.website_meta_og_img; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.website_meta_og_img IS 'Website opengraph image';


--
-- Name: COLUMN event_event.website_visibility; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.website_visibility IS 'Website Visibility';


--
-- Name: COLUMN event_event.website_meta_title; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.website_meta_title IS 'Website meta title';


--
-- Name: COLUMN event_event.website_meta_description; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.website_meta_description IS 'Website meta description';


--
-- Name: COLUMN event_event.website_meta_keywords; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.website_meta_keywords IS 'Website meta keywords';


--
-- Name: COLUMN event_event.seo_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.seo_name IS 'Seo name';


--
-- Name: COLUMN event_event.subtitle; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.subtitle IS 'Event Subtitle';


--
-- Name: COLUMN event_event.cover_properties; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.cover_properties IS 'Cover Properties';


--
-- Name: COLUMN event_event.header_visible; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.header_visible IS 'Header Visible';


--
-- Name: COLUMN event_event.footer_visible; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.footer_visible IS 'Footer Visible';


--
-- Name: COLUMN event_event.is_published; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.is_published IS 'Is Published';


--
-- Name: COLUMN event_event.is_seo_optimized; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.is_seo_optimized IS 'SEO optimized';


--
-- Name: COLUMN event_event.website_menu; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.website_menu IS 'Website Menu';


--
-- Name: COLUMN event_event.introduction_menu; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.introduction_menu IS 'Introduction Menu';


--
-- Name: COLUMN event_event.register_menu; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.register_menu IS 'Register Menu';


--
-- Name: COLUMN event_event.community_menu; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event.community_menu IS 'Community Menu';


--
-- Name: event_event_configurator; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.event_event_configurator (
    id integer NOT NULL,
    product_id integer,
    event_id integer,
    event_slot_id integer,
    event_ticket_id integer,
    create_uid integer,
    write_uid integer,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE event_event_configurator; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.event_event_configurator IS 'Event Configurator';


--
-- Name: COLUMN event_event_configurator.product_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_configurator.product_id IS 'Product';


--
-- Name: COLUMN event_event_configurator.event_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_configurator.event_id IS 'Event';


--
-- Name: COLUMN event_event_configurator.event_slot_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_configurator.event_slot_id IS 'Slot';


--
-- Name: COLUMN event_event_configurator.event_ticket_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_configurator.event_ticket_id IS 'Ticket Type';


--
-- Name: COLUMN event_event_configurator.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_configurator.create_uid IS 'Created by';


--
-- Name: COLUMN event_event_configurator.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_configurator.write_uid IS 'Last Updated by';


--
-- Name: COLUMN event_event_configurator.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_configurator.create_date IS 'Created on';


--
-- Name: COLUMN event_event_configurator.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_configurator.write_date IS 'Last Updated on';


--
-- Name: event_event_configurator_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.event_event_configurator_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: event_event_configurator_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.event_event_configurator_id_seq OWNED BY public.event_event_configurator.id;


--
-- Name: event_event_event_tag_rel; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.event_event_event_tag_rel (
    event_event_id integer NOT NULL,
    event_tag_id integer NOT NULL
);


--
-- Name: TABLE event_event_event_tag_rel; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.event_event_event_tag_rel IS 'RELATION BETWEEN event_event AND event_tag';


--
-- Name: event_event_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.event_event_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: event_event_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.event_event_id_seq OWNED BY public.event_event.id;


--
-- Name: event_event_ticket; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.event_event_ticket (
    id integer NOT NULL,
    sequence integer,
    event_type_id integer,
    seats_max integer,
    create_uid integer,
    write_uid integer,
    event_id integer NOT NULL,
    color character varying,
    name jsonb NOT NULL,
    description jsonb,
    seats_limited boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    start_sale_datetime timestamp without time zone,
    end_sale_datetime timestamp without time zone,
    product_id integer NOT NULL,
    price numeric
);


--
-- Name: TABLE event_event_ticket; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.event_event_ticket IS 'Event Ticket';


--
-- Name: COLUMN event_event_ticket.sequence; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_ticket.sequence IS 'Sequence';


--
-- Name: COLUMN event_event_ticket.event_type_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_ticket.event_type_id IS 'Event Category';


--
-- Name: COLUMN event_event_ticket.seats_max; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_ticket.seats_max IS 'Maximum Attendees';


--
-- Name: COLUMN event_event_ticket.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_ticket.create_uid IS 'Created by';


--
-- Name: COLUMN event_event_ticket.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_ticket.write_uid IS 'Last Updated by';


--
-- Name: COLUMN event_event_ticket.event_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_ticket.event_id IS 'Event';


--
-- Name: COLUMN event_event_ticket.color; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_ticket.color IS 'Color';


--
-- Name: COLUMN event_event_ticket.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_ticket.name IS 'Name';


--
-- Name: COLUMN event_event_ticket.description; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_ticket.description IS 'Description';


--
-- Name: COLUMN event_event_ticket.seats_limited; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_ticket.seats_limited IS 'Limit Attendees';


--
-- Name: COLUMN event_event_ticket.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_ticket.create_date IS 'Created on';


--
-- Name: COLUMN event_event_ticket.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_ticket.write_date IS 'Last Updated on';


--
-- Name: COLUMN event_event_ticket.start_sale_datetime; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_ticket.start_sale_datetime IS 'Registration Start';


--
-- Name: COLUMN event_event_ticket.end_sale_datetime; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_ticket.end_sale_datetime IS 'Registration End';


--
-- Name: COLUMN event_event_ticket.product_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_ticket.product_id IS 'Product';


--
-- Name: COLUMN event_event_ticket.price; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_event_ticket.price IS 'Price';


--
-- Name: event_event_ticket_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.event_event_ticket_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: event_event_ticket_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.event_event_ticket_id_seq OWNED BY public.event_event_ticket.id;


--
-- Name: event_mail; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.event_mail (
    id integer NOT NULL,
    event_id integer NOT NULL,
    sequence integer,
    interval_nbr integer,
    last_registration_id integer,
    mail_count_done integer,
    create_uid integer,
    write_uid integer,
    interval_unit character varying NOT NULL,
    interval_type character varying NOT NULL,
    template_ref character varying NOT NULL,
    mail_done boolean,
    scheduled_date timestamp without time zone,
    error_datetime timestamp without time zone,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE event_mail; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.event_mail IS 'Event Automated Mailing';


--
-- Name: COLUMN event_mail.event_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail.event_id IS 'Event';


--
-- Name: COLUMN event_mail.sequence; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail.sequence IS 'Display order';


--
-- Name: COLUMN event_mail.interval_nbr; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail.interval_nbr IS 'Interval';


--
-- Name: COLUMN event_mail.last_registration_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail.last_registration_id IS 'Last Attendee';


--
-- Name: COLUMN event_mail.mail_count_done; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail.mail_count_done IS '# Sent';


--
-- Name: COLUMN event_mail.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail.create_uid IS 'Created by';


--
-- Name: COLUMN event_mail.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail.write_uid IS 'Last Updated by';


--
-- Name: COLUMN event_mail.interval_unit; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail.interval_unit IS 'Unit';


--
-- Name: COLUMN event_mail.interval_type; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail.interval_type IS 'Trigger ';


--
-- Name: COLUMN event_mail.template_ref; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail.template_ref IS 'Template';


--
-- Name: COLUMN event_mail.mail_done; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail.mail_done IS 'Sent';


--
-- Name: COLUMN event_mail.scheduled_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail.scheduled_date IS 'Schedule Date';


--
-- Name: COLUMN event_mail.error_datetime; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail.error_datetime IS 'Last Error';


--
-- Name: COLUMN event_mail.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail.create_date IS 'Created on';


--
-- Name: COLUMN event_mail.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail.write_date IS 'Last Updated on';


--
-- Name: event_mail_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.event_mail_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: event_mail_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.event_mail_id_seq OWNED BY public.event_mail.id;


--
-- Name: event_mail_registration; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.event_mail_registration (
    id integer NOT NULL,
    scheduler_id integer NOT NULL,
    registration_id integer NOT NULL,
    create_uid integer,
    write_uid integer,
    mail_sent boolean,
    scheduled_date timestamp without time zone,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE event_mail_registration; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.event_mail_registration IS 'Registration Mail Scheduler';


--
-- Name: COLUMN event_mail_registration.scheduler_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail_registration.scheduler_id IS 'Mail Scheduler';


--
-- Name: COLUMN event_mail_registration.registration_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail_registration.registration_id IS 'Attendee';


--
-- Name: COLUMN event_mail_registration.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail_registration.create_uid IS 'Created by';


--
-- Name: COLUMN event_mail_registration.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail_registration.write_uid IS 'Last Updated by';


--
-- Name: COLUMN event_mail_registration.mail_sent; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail_registration.mail_sent IS 'Mail Sent';


--
-- Name: COLUMN event_mail_registration.scheduled_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail_registration.scheduled_date IS 'Scheduled Time';


--
-- Name: COLUMN event_mail_registration.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail_registration.create_date IS 'Created on';


--
-- Name: COLUMN event_mail_registration.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail_registration.write_date IS 'Last Updated on';


--
-- Name: event_mail_registration_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.event_mail_registration_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: event_mail_registration_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.event_mail_registration_id_seq OWNED BY public.event_mail_registration.id;


--
-- Name: event_mail_slot; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.event_mail_slot (
    id integer NOT NULL,
    event_slot_id integer NOT NULL,
    scheduler_id integer NOT NULL,
    last_registration_id integer,
    mail_count_done integer,
    create_uid integer,
    write_uid integer,
    mail_done boolean,
    scheduled_date timestamp without time zone,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE event_mail_slot; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.event_mail_slot IS 'Slot Mail Scheduler';


--
-- Name: COLUMN event_mail_slot.event_slot_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail_slot.event_slot_id IS 'Slot';


--
-- Name: COLUMN event_mail_slot.scheduler_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail_slot.scheduler_id IS 'Mail Scheduler';


--
-- Name: COLUMN event_mail_slot.last_registration_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail_slot.last_registration_id IS 'Last Attendee';


--
-- Name: COLUMN event_mail_slot.mail_count_done; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail_slot.mail_count_done IS '# Sent';


--
-- Name: COLUMN event_mail_slot.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail_slot.create_uid IS 'Created by';


--
-- Name: COLUMN event_mail_slot.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail_slot.write_uid IS 'Last Updated by';


--
-- Name: COLUMN event_mail_slot.mail_done; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail_slot.mail_done IS 'Sent';


--
-- Name: COLUMN event_mail_slot.scheduled_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail_slot.scheduled_date IS 'Schedule Date';


--
-- Name: COLUMN event_mail_slot.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail_slot.create_date IS 'Created on';


--
-- Name: COLUMN event_mail_slot.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_mail_slot.write_date IS 'Last Updated on';


--
-- Name: event_mail_slot_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.event_mail_slot_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: event_mail_slot_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.event_mail_slot_id_seq OWNED BY public.event_mail_slot.id;


--
-- Name: event_question; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.event_question (
    id integer NOT NULL,
    event_type_id integer,
    event_id integer,
    sequence integer,
    create_uid integer,
    write_uid integer,
    question_type character varying NOT NULL,
    title jsonb NOT NULL,
    once_per_order boolean,
    is_mandatory_answer boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE event_question; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.event_question IS 'Event Question';


--
-- Name: COLUMN event_question.event_type_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_question.event_type_id IS 'Event Type';


--
-- Name: COLUMN event_question.event_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_question.event_id IS 'Event';


--
-- Name: COLUMN event_question.sequence; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_question.sequence IS 'Sequence';


--
-- Name: COLUMN event_question.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_question.create_uid IS 'Created by';


--
-- Name: COLUMN event_question.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_question.write_uid IS 'Last Updated by';


--
-- Name: COLUMN event_question.question_type; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_question.question_type IS 'Question Type';


--
-- Name: COLUMN event_question.title; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_question.title IS 'Title';


--
-- Name: COLUMN event_question.once_per_order; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_question.once_per_order IS 'Ask once per order';


--
-- Name: COLUMN event_question.is_mandatory_answer; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_question.is_mandatory_answer IS 'Mandatory Answer';


--
-- Name: COLUMN event_question.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_question.create_date IS 'Created on';


--
-- Name: COLUMN event_question.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_question.write_date IS 'Last Updated on';


--
-- Name: event_question_answer; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.event_question_answer (
    id integer NOT NULL,
    question_id integer NOT NULL,
    sequence integer,
    create_uid integer,
    write_uid integer,
    name jsonb NOT NULL,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE event_question_answer; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.event_question_answer IS 'Event Question Answer';


--
-- Name: COLUMN event_question_answer.question_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_question_answer.question_id IS 'Question';


--
-- Name: COLUMN event_question_answer.sequence; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_question_answer.sequence IS 'Sequence';


--
-- Name: COLUMN event_question_answer.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_question_answer.create_uid IS 'Created by';


--
-- Name: COLUMN event_question_answer.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_question_answer.write_uid IS 'Last Updated by';


--
-- Name: COLUMN event_question_answer.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_question_answer.name IS 'Answer';


--
-- Name: COLUMN event_question_answer.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_question_answer.create_date IS 'Created on';


--
-- Name: COLUMN event_question_answer.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_question_answer.write_date IS 'Last Updated on';


--
-- Name: event_question_answer_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.event_question_answer_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: event_question_answer_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.event_question_answer_id_seq OWNED BY public.event_question_answer.id;


--
-- Name: event_question_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.event_question_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: event_question_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.event_question_id_seq OWNED BY public.event_question.id;


--
-- Name: event_registration; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.event_registration (
    id integer NOT NULL,
    event_id integer NOT NULL,
    event_slot_id integer,
    event_ticket_id integer,
    utm_campaign_id integer,
    utm_source_id integer,
    utm_medium_id integer,
    partner_id integer,
    company_id integer,
    create_uid integer,
    write_uid integer,
    barcode character varying,
    name character varying,
    email character varying,
    phone character varying,
    company_name character varying,
    state character varying,
    registration_properties jsonb,
    active boolean,
    date_closed timestamp without time zone,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    event_begin_date timestamp without time zone,
    sale_status character varying,
    visitor_id integer,
    sale_order_id integer,
    sale_order_line_id integer
);


--
-- Name: TABLE event_registration; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.event_registration IS 'Event Registration';


--
-- Name: COLUMN event_registration.event_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.event_id IS 'Event';


--
-- Name: COLUMN event_registration.event_slot_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.event_slot_id IS 'Slot';


--
-- Name: COLUMN event_registration.event_ticket_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.event_ticket_id IS 'Ticket Type';


--
-- Name: COLUMN event_registration.utm_campaign_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.utm_campaign_id IS 'Campaign';


--
-- Name: COLUMN event_registration.utm_source_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.utm_source_id IS 'Source';


--
-- Name: COLUMN event_registration.utm_medium_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.utm_medium_id IS 'Medium';


--
-- Name: COLUMN event_registration.partner_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.partner_id IS 'Booked by';


--
-- Name: COLUMN event_registration.company_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.company_id IS 'Company';


--
-- Name: COLUMN event_registration.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.create_uid IS 'Created by';


--
-- Name: COLUMN event_registration.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.write_uid IS 'Last Updated by';


--
-- Name: COLUMN event_registration.barcode; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.barcode IS 'Barcode';


--
-- Name: COLUMN event_registration.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.name IS 'Attendee Name';


--
-- Name: COLUMN event_registration.email; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.email IS 'Email';


--
-- Name: COLUMN event_registration.phone; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.phone IS 'Phone';


--
-- Name: COLUMN event_registration.company_name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.company_name IS 'Company Name';


--
-- Name: COLUMN event_registration.state; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.state IS 'Status';


--
-- Name: COLUMN event_registration.registration_properties; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.registration_properties IS 'Properties';


--
-- Name: COLUMN event_registration.active; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.active IS 'Active';


--
-- Name: COLUMN event_registration.date_closed; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.date_closed IS 'Attended Date';


--
-- Name: COLUMN event_registration.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.create_date IS 'Created on';


--
-- Name: COLUMN event_registration.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.write_date IS 'Last Updated on';


--
-- Name: COLUMN event_registration.event_begin_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.event_begin_date IS 'Event Start Date';


--
-- Name: COLUMN event_registration.sale_status; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.sale_status IS 'Sale Status';


--
-- Name: COLUMN event_registration.visitor_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.visitor_id IS 'Visitor';


--
-- Name: COLUMN event_registration.sale_order_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.sale_order_id IS 'Sales Order';


--
-- Name: COLUMN event_registration.sale_order_line_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration.sale_order_line_id IS 'Sales Order Line';


--
-- Name: event_registration_answer; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.event_registration_answer (
    id integer NOT NULL,
    question_id integer NOT NULL,
    registration_id integer NOT NULL,
    value_answer_id integer,
    create_uid integer,
    write_uid integer,
    value_text_box text,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    CONSTRAINT event_registration_answer_value_check CHECK (((value_answer_id IS NOT NULL) OR (COALESCE(value_text_box, ''::text) <> ''::text)))
);


--
-- Name: TABLE event_registration_answer; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.event_registration_answer IS 'Event Registration Answer';


--
-- Name: COLUMN event_registration_answer.question_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration_answer.question_id IS 'Question';


--
-- Name: COLUMN event_registration_answer.registration_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration_answer.registration_id IS 'Registration';


--
-- Name: COLUMN event_registration_answer.value_answer_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration_answer.value_answer_id IS 'Suggested answer';


--
-- Name: COLUMN event_registration_answer.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration_answer.create_uid IS 'Created by';


--
-- Name: COLUMN event_registration_answer.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration_answer.write_uid IS 'Last Updated by';


--
-- Name: COLUMN event_registration_answer.value_text_box; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration_answer.value_text_box IS 'Text answer';


--
-- Name: COLUMN event_registration_answer.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration_answer.create_date IS 'Created on';


--
-- Name: COLUMN event_registration_answer.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_registration_answer.write_date IS 'Last Updated on';


--
-- Name: CONSTRAINT event_registration_answer_value_check ON event_registration_answer; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON CONSTRAINT event_registration_answer_value_check ON public.event_registration_answer IS 'CHECK(value_answer_id IS NOT NULL OR COALESCE(value_text_box, '''') <> '''')';


--
-- Name: event_registration_answer_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.event_registration_answer_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: event_registration_answer_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.event_registration_answer_id_seq OWNED BY public.event_registration_answer.id;


--
-- Name: event_registration_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.event_registration_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: event_registration_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.event_registration_id_seq OWNED BY public.event_registration.id;


--
-- Name: event_slot; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.event_slot (
    id integer NOT NULL,
    event_id integer NOT NULL,
    color integer,
    create_uid integer,
    write_uid integer,
    date date NOT NULL,
    start_datetime timestamp without time zone,
    end_datetime timestamp without time zone,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    start_hour double precision NOT NULL,
    end_hour double precision NOT NULL
);


--
-- Name: TABLE event_slot; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.event_slot IS 'Event Slot';


--
-- Name: COLUMN event_slot.event_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_slot.event_id IS 'Event';


--
-- Name: COLUMN event_slot.color; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_slot.color IS 'Color';


--
-- Name: COLUMN event_slot.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_slot.create_uid IS 'Created by';


--
-- Name: COLUMN event_slot.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_slot.write_uid IS 'Last Updated by';


--
-- Name: COLUMN event_slot.date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_slot.date IS 'Date';


--
-- Name: COLUMN event_slot.start_datetime; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_slot.start_datetime IS 'Start Datetime';


--
-- Name: COLUMN event_slot.end_datetime; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_slot.end_datetime IS 'End Datetime';


--
-- Name: COLUMN event_slot.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_slot.create_date IS 'Created on';


--
-- Name: COLUMN event_slot.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_slot.write_date IS 'Last Updated on';


--
-- Name: COLUMN event_slot.start_hour; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_slot.start_hour IS 'Starting Hour';


--
-- Name: COLUMN event_slot.end_hour; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_slot.end_hour IS 'Ending Hour';


--
-- Name: sale_order; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.sale_order (
    id integer NOT NULL,
    campaign_id integer,
    source_id integer,
    medium_id integer,
    company_id integer NOT NULL,
    partner_id integer NOT NULL,
    pending_email_template_id integer,
    journal_id integer,
    partner_invoice_id integer NOT NULL,
    partner_shipping_id integer NOT NULL,
    fiscal_position_id integer,
    payment_term_id integer,
    pricelist_id integer,
    currency_id integer,
    user_id integer,
    team_id integer,
    create_uid integer,
    write_uid integer,
    access_token character varying,
    name character varying NOT NULL,
    state character varying,
    client_order_ref character varying,
    origin character varying,
    reference character varying,
    signed_by character varying,
    invoice_status character varying,
    validity_date date,
    note text,
    currency_rate numeric,
    amount_untaxed numeric,
    amount_tax numeric,
    amount_total numeric,
    locked boolean,
    require_signature boolean,
    require_payment boolean,
    create_date timestamp without time zone,
    commitment_date timestamp without time zone,
    date_order timestamp without time zone NOT NULL,
    signed_on timestamp without time zone,
    write_date timestamp without time zone,
    prepayment_percent double precision,
    carrier_id integer,
    delivery_message character varying,
    pickup_location_data jsonb,
    recompute_delivery_price boolean,
    shipping_weight double precision,
    sale_order_template_id integer,
    customizable_pdf_form_fields jsonb,
    website_id integer,
    shop_warning character varying,
    cart_recovery_email_sent boolean,
    CONSTRAINT sale_order_date_order_conditional_required CHECK (((((state)::text = 'sale'::text) AND (date_order IS NOT NULL)) OR ((state)::text <> 'sale'::text)))
);


--
-- Name: TABLE sale_order; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.sale_order IS 'Sales Order';


--
-- Name: COLUMN sale_order.campaign_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.campaign_id IS 'Campaign';


--
-- Name: COLUMN sale_order.source_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.source_id IS 'Source';


--
-- Name: COLUMN sale_order.medium_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.medium_id IS 'Medium';


--
-- Name: COLUMN sale_order.company_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.company_id IS 'Company';


--
-- Name: COLUMN sale_order.partner_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.partner_id IS 'Customer';


--
-- Name: COLUMN sale_order.pending_email_template_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.pending_email_template_id IS 'Pending Email Template';


--
-- Name: COLUMN sale_order.journal_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.journal_id IS 'Invoicing Journal';


--
-- Name: COLUMN sale_order.partner_invoice_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.partner_invoice_id IS 'Invoice Address';


--
-- Name: COLUMN sale_order.partner_shipping_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.partner_shipping_id IS 'Delivery Address';


--
-- Name: COLUMN sale_order.fiscal_position_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.fiscal_position_id IS 'Fiscal Position';


--
-- Name: COLUMN sale_order.payment_term_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.payment_term_id IS 'Payment Terms';


--
-- Name: COLUMN sale_order.pricelist_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.pricelist_id IS 'Pricelist';


--
-- Name: COLUMN sale_order.currency_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.currency_id IS 'Currency';


--
-- Name: COLUMN sale_order.user_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.user_id IS 'Salesperson';


--
-- Name: COLUMN sale_order.team_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.team_id IS 'Sales Team';


--
-- Name: COLUMN sale_order.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.create_uid IS 'Created by';


--
-- Name: COLUMN sale_order.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.write_uid IS 'Last Updated by';


--
-- Name: COLUMN sale_order.access_token; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.access_token IS 'Security Token';


--
-- Name: COLUMN sale_order.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.name IS 'Order Reference';


--
-- Name: COLUMN sale_order.state; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.state IS 'Status';


--
-- Name: COLUMN sale_order.client_order_ref; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.client_order_ref IS 'Customer Reference';


--
-- Name: COLUMN sale_order.origin; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.origin IS 'Source Document';


--
-- Name: COLUMN sale_order.reference; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.reference IS 'Payment Ref.';


--
-- Name: COLUMN sale_order.signed_by; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.signed_by IS 'Signed By';


--
-- Name: COLUMN sale_order.invoice_status; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.invoice_status IS 'Invoice Status';


--
-- Name: COLUMN sale_order.validity_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.validity_date IS 'Expiration';


--
-- Name: COLUMN sale_order.note; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.note IS 'Terms and conditions';


--
-- Name: COLUMN sale_order.currency_rate; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.currency_rate IS 'Currency Rate';


--
-- Name: COLUMN sale_order.amount_untaxed; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.amount_untaxed IS 'Untaxed Amount';


--
-- Name: COLUMN sale_order.amount_tax; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.amount_tax IS 'Taxes';


--
-- Name: COLUMN sale_order.amount_total; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.amount_total IS 'Total';


--
-- Name: COLUMN sale_order.locked; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.locked IS 'Locked';


--
-- Name: COLUMN sale_order.require_signature; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.require_signature IS 'Online signature';


--
-- Name: COLUMN sale_order.require_payment; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.require_payment IS 'Online payment';


--
-- Name: COLUMN sale_order.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.create_date IS 'Creation Date';


--
-- Name: COLUMN sale_order.commitment_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.commitment_date IS 'Delivery Date';


--
-- Name: COLUMN sale_order.date_order; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.date_order IS 'Order Date';


--
-- Name: COLUMN sale_order.signed_on; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.signed_on IS 'Signed On';


--
-- Name: COLUMN sale_order.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.write_date IS 'Last Updated on';


--
-- Name: COLUMN sale_order.prepayment_percent; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.prepayment_percent IS 'Prepayment percentage';


--
-- Name: COLUMN sale_order.carrier_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.carrier_id IS 'Delivery Method';


--
-- Name: COLUMN sale_order.delivery_message; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.delivery_message IS 'Delivery Message';


--
-- Name: COLUMN sale_order.pickup_location_data; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.pickup_location_data IS 'Pickup Location Data';


--
-- Name: COLUMN sale_order.recompute_delivery_price; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.recompute_delivery_price IS 'Delivery cost should be recomputed';


--
-- Name: COLUMN sale_order.shipping_weight; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.shipping_weight IS 'Shipping Weight';


--
-- Name: COLUMN sale_order.customizable_pdf_form_fields; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.customizable_pdf_form_fields IS 'Customizable PDF Form Fields';


--
-- Name: COLUMN sale_order.website_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.website_id IS 'Website';


--
-- Name: COLUMN sale_order.shop_warning; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.shop_warning IS 'Warning';


--
-- Name: COLUMN sale_order.cart_recovery_email_sent; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order.cart_recovery_email_sent IS 'Cart recovery email already sent';


--
-- Name: CONSTRAINT sale_order_date_order_conditional_required ON sale_order; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON CONSTRAINT sale_order_date_order_conditional_required ON public.sale_order IS 'CHECK((state = ''sale'' AND date_order IS NOT NULL) OR state != ''sale'')';


--
-- Name: sale_order_line; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.sale_order_line (
    id integer NOT NULL,
    order_id integer NOT NULL,
    sequence integer,
    company_id integer,
    currency_id integer,
    order_partner_id integer,
    salesman_id integer,
    product_id integer,
    product_uom_id integer,
    linked_line_id integer,
    combo_item_id integer,
    create_uid integer,
    write_uid integer,
    state character varying,
    display_type character varying,
    virtual_id character varying,
    linked_virtual_id character varying,
    qty_delivered_method character varying,
    invoice_status character varying,
    analytic_distribution jsonb,
    extra_tax_data jsonb,
    name text NOT NULL,
    product_uom_qty numeric NOT NULL,
    price_unit numeric NOT NULL,
    discount numeric,
    price_subtotal numeric,
    price_total numeric,
    price_reduce_taxexcl numeric,
    price_reduce_taxinc numeric,
    qty_delivered numeric,
    qty_invoiced numeric,
    qty_to_invoice numeric,
    untaxed_amount_invoiced numeric,
    untaxed_amount_to_invoice numeric,
    is_downpayment boolean,
    is_expense boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    technical_price_unit double precision,
    price_tax double precision,
    customer_lead double precision NOT NULL,
    is_delivery boolean,
    event_id integer,
    event_slot_id integer,
    event_ticket_id integer,
    shop_warning character varying,
    CONSTRAINT sale_order_line_accountable_required_fields CHECK (((display_type IS NOT NULL) OR is_downpayment OR ((product_id IS NOT NULL) AND (product_uom_id IS NOT NULL)))),
    CONSTRAINT sale_order_line_non_accountable_null_fields CHECK (((display_type IS NULL) OR ((product_id IS NULL) AND (price_unit = (0)::numeric) AND (product_uom_qty = (0)::numeric) AND (product_uom_id IS NULL) AND (customer_lead = (0)::double precision))))
);


--
-- Name: TABLE sale_order_line; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.sale_order_line IS 'Sales Order Line';


--
-- Name: COLUMN sale_order_line.order_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.order_id IS 'Order Reference';


--
-- Name: COLUMN sale_order_line.sequence; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.sequence IS 'Sequence';


--
-- Name: COLUMN sale_order_line.company_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.company_id IS 'Company';


--
-- Name: COLUMN sale_order_line.currency_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.currency_id IS 'Currency';


--
-- Name: COLUMN sale_order_line.order_partner_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.order_partner_id IS 'Customer';


--
-- Name: COLUMN sale_order_line.salesman_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.salesman_id IS 'Salesperson';


--
-- Name: COLUMN sale_order_line.product_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.product_id IS 'Product';


--
-- Name: COLUMN sale_order_line.product_uom_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.product_uom_id IS 'Unit';


--
-- Name: COLUMN sale_order_line.linked_line_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.linked_line_id IS 'Linked Order Line';


--
-- Name: COLUMN sale_order_line.combo_item_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.combo_item_id IS 'Combo Item';


--
-- Name: COLUMN sale_order_line.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.create_uid IS 'Created by';


--
-- Name: COLUMN sale_order_line.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.write_uid IS 'Last Updated by';


--
-- Name: COLUMN sale_order_line.state; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.state IS 'Order Status';


--
-- Name: COLUMN sale_order_line.display_type; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.display_type IS 'Display Type';


--
-- Name: COLUMN sale_order_line.virtual_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.virtual_id IS 'Virtual';


--
-- Name: COLUMN sale_order_line.linked_virtual_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.linked_virtual_id IS 'Linked Virtual';


--
-- Name: COLUMN sale_order_line.qty_delivered_method; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.qty_delivered_method IS 'Method to update delivered qty';


--
-- Name: COLUMN sale_order_line.invoice_status; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.invoice_status IS 'Invoice Status';


--
-- Name: COLUMN sale_order_line.analytic_distribution; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.analytic_distribution IS 'Analytic Distribution';


--
-- Name: COLUMN sale_order_line.extra_tax_data; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.extra_tax_data IS 'Extra Tax Data';


--
-- Name: COLUMN sale_order_line.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.name IS 'Description';


--
-- Name: COLUMN sale_order_line.product_uom_qty; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.product_uom_qty IS 'Quantity';


--
-- Name: COLUMN sale_order_line.price_unit; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.price_unit IS 'Unit Price';


--
-- Name: COLUMN sale_order_line.discount; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.discount IS 'Discount (%)';


--
-- Name: COLUMN sale_order_line.price_subtotal; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.price_subtotal IS 'Subtotal';


--
-- Name: COLUMN sale_order_line.price_total; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.price_total IS 'Total';


--
-- Name: COLUMN sale_order_line.price_reduce_taxexcl; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.price_reduce_taxexcl IS 'Price Reduce Tax excl';


--
-- Name: COLUMN sale_order_line.price_reduce_taxinc; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.price_reduce_taxinc IS 'Price Reduce Tax incl';


--
-- Name: COLUMN sale_order_line.qty_delivered; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.qty_delivered IS 'Delivery Quantity';


--
-- Name: COLUMN sale_order_line.qty_invoiced; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.qty_invoiced IS 'Invoiced Quantity';


--
-- Name: COLUMN sale_order_line.qty_to_invoice; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.qty_to_invoice IS 'Quantity To Invoice';


--
-- Name: COLUMN sale_order_line.untaxed_amount_invoiced; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.untaxed_amount_invoiced IS 'Untaxed Invoiced Amount';


--
-- Name: COLUMN sale_order_line.untaxed_amount_to_invoice; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.untaxed_amount_to_invoice IS 'Untaxed Amount To Invoice';


--
-- Name: COLUMN sale_order_line.is_downpayment; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.is_downpayment IS 'Is a down payment';


--
-- Name: COLUMN sale_order_line.is_expense; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.is_expense IS 'Is expense';


--
-- Name: COLUMN sale_order_line.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.create_date IS 'Created on';


--
-- Name: COLUMN sale_order_line.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.write_date IS 'Last Updated on';


--
-- Name: COLUMN sale_order_line.technical_price_unit; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.technical_price_unit IS 'Technical Price Unit';


--
-- Name: COLUMN sale_order_line.price_tax; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.price_tax IS 'Total Tax';


--
-- Name: COLUMN sale_order_line.customer_lead; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.customer_lead IS 'Lead Time';


--
-- Name: COLUMN sale_order_line.is_delivery; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.is_delivery IS 'Is a Delivery';


--
-- Name: COLUMN sale_order_line.event_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.event_id IS 'Event';


--
-- Name: COLUMN sale_order_line.event_slot_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.event_slot_id IS 'Slot';


--
-- Name: COLUMN sale_order_line.event_ticket_id; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.event_ticket_id IS 'Ticket Type';


--
-- Name: COLUMN sale_order_line.shop_warning; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.sale_order_line.shop_warning IS 'Warning';


--
-- Name: CONSTRAINT sale_order_line_accountable_required_fields ON sale_order_line; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON CONSTRAINT sale_order_line_accountable_required_fields ON public.sale_order_line IS 'CHECK(display_type IS NOT NULL OR is_downpayment OR (product_id IS NOT NULL AND product_uom_id IS NOT NULL))';


--
-- Name: CONSTRAINT sale_order_line_non_accountable_null_fields ON sale_order_line; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON CONSTRAINT sale_order_line_non_accountable_null_fields ON public.sale_order_line IS 'CHECK(display_type IS NULL OR (product_id IS NULL AND price_unit = 0 AND product_uom_qty = 0 AND product_uom_id IS NULL AND customer_lead = 0))';


--
-- Name: event_sale_report; Type: VIEW; Schema: public; Owner: -
--

CREATE VIEW public.event_sale_report AS
 SELECT row_number() OVER (ORDER BY event_registration.id) AS id,
    event_registration.id AS event_registration_id,
    event_registration.company_id,
    event_registration.event_id,
    event_registration.event_slot_id,
    event_registration.event_ticket_id,
    event_registration.create_date AS event_registration_create_date,
    event_registration.name AS event_registration_name,
    event_registration.state AS event_registration_state,
    event_registration.active,
    event_registration.sale_order_id,
    event_registration.sale_order_line_id,
    event_registration.sale_status,
    event_event.event_type_id,
    event_event.date_begin AS event_date_begin,
    event_event.date_end AS event_date_end,
    event_event_ticket.price AS event_ticket_price,
    sale_order.date_order AS sale_order_date,
    sale_order.partner_invoice_id AS invoice_partner_id,
    sale_order.partner_id AS sale_order_partner_id,
    sale_order.state AS sale_order_state,
    sale_order.user_id AS sale_order_user_id,
    sale_order_line.product_id,
        CASE
            WHEN (sale_order_line.product_uom_qty = (0)::numeric) THEN (0)::numeric
            ELSE ((sale_order_line.price_total /
            CASE COALESCE(sale_order.currency_rate, (0)::numeric)
                WHEN 0 THEN 1.0
                ELSE sale_order.currency_rate
            END) / sale_order_line.product_uom_qty)
        END AS sale_price,
        CASE
            WHEN (sale_order_line.product_uom_qty = (0)::numeric) THEN (0)::numeric
            ELSE ((sale_order_line.price_subtotal /
            CASE COALESCE(sale_order.currency_rate, (0)::numeric)
                WHEN 0 THEN 1.0
                ELSE sale_order.currency_rate
            END) / sale_order_line.product_uom_qty)
        END AS sale_price_untaxed,
    event_event.is_published
   FROM (((((public.event_registration
     LEFT JOIN public.event_event ON ((event_event.id = event_registration.event_id)))
     LEFT JOIN public.event_slot ON ((event_slot.id = event_registration.event_slot_id)))
     LEFT JOIN public.event_event_ticket ON ((event_event_ticket.id = event_registration.event_ticket_id)))
     LEFT JOIN public.sale_order ON ((sale_order.id = event_registration.sale_order_id)))
     LEFT JOIN public.sale_order_line ON ((sale_order_line.id = event_registration.sale_order_line_id)));


--
-- Name: event_slot_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.event_slot_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: event_slot_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.event_slot_id_seq OWNED BY public.event_slot.id;


--
-- Name: event_stage; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.event_stage (
    id integer NOT NULL,
    sequence integer,
    create_uid integer,
    write_uid integer,
    name jsonb NOT NULL,
    description jsonb,
    legend_blocked jsonb NOT NULL,
    legend_done jsonb NOT NULL,
    legend_normal jsonb NOT NULL,
    fold boolean,
    pipe_end boolean,
    create_date timestamp without time zone,
    write_date timestamp without time zone
);


--
-- Name: TABLE event_stage; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON TABLE public.event_stage IS 'Event Stage';


--
-- Name: COLUMN event_stage.sequence; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_stage.sequence IS 'Sequence';


--
-- Name: COLUMN event_stage.create_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_stage.create_uid IS 'Created by';


--
-- Name: COLUMN event_stage.write_uid; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_stage.write_uid IS 'Last Updated by';


--
-- Name: COLUMN event_stage.name; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_stage.name IS 'Stage Name';


--
-- Name: COLUMN event_stage.description; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_stage.description IS 'Stage description';


--
-- Name: COLUMN event_stage.legend_blocked; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_stage.legend_blocked IS 'Red Kanban Label';


--
-- Name: COLUMN event_stage.legend_done; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_stage.legend_done IS 'Green Kanban Label';


--
-- Name: COLUMN event_stage.legend_normal; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_stage.legend_normal IS 'Grey Kanban Label';


--
-- Name: COLUMN event_stage.fold; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_stage.fold IS 'Folded in Kanban';


--
-- Name: COLUMN event_stage.pipe_end; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_stage.pipe_end IS 'End Stage';


--
-- Name: COLUMN event_stage.create_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_stage.create_date IS 'Created on';


--
-- Name: COLUMN event_stage.write_date; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN public.event_stage.write_date IS 'Last Updated on';


--
-- Name: event_stage_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.event_stage_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


--
-- Name: event_stage_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.event_stage_id_seq OWNED BY public.event_stage.id;


--
-- Name: event_tag; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.event_tag (
    id integer NOT NULL,
    sequence integer,
    category_id integer NOT NULL,
    category_sequence integer,
    color integer,
    create_uid integer,
    write_uid integer,
    name jsonb NOT NULL,
    create_date timestamp without time zone,
    write_date timestamp without time zone,
    website_id integer,
    is_published boolean
);


--
