--
--



--
-- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA public;


--
-- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner: 
--

COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)';




--
-- Name: account_types; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.account_types (
    id bigint NOT NULL,
    name text NOT NULL,
    is_active character varying(1) NOT NULL
);


ALTER TABLE public.account_types OWNER TO postgres;

--
-- Name: account_types_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.account_types_id_seq OWNER TO postgres;

--
-- Name: account_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.account_types_id_seq OWNED BY public.account_types.id;


--
-- Name: brands; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.brands (
    id bigint NOT NULL,
    name text NOT NULL,
    is_deleted boolean NOT NULL
);


ALTER TABLE public.brands OWNER TO postgres;

--
-- Name: brands_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.brands_id_seq OWNER TO postgres;

--
-- Name: brands_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.brands_id_seq OWNED BY public.brands.id;


--
-- Name: campaigns; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.campaigns (
    id bigint NOT NULL,
    name text NOT NULL,
    start_date bigint NOT NULL,
    end_date bigint NOT NULL
);


ALTER TABLE public.campaigns OWNER TO postgres;

--
-- Name: campaigns_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.campaigns_id_seq OWNER TO postgres;

--
-- Name: campaigns_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.campaigns_id_seq OWNED BY public.campaigns.id;


--
-- Name: campaigns_to_plans; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.campaigns_to_plans (
    id bigint NOT NULL,
    campaigns_id bigint NOT NULL,
    plans_id bigint NOT NULL
);


ALTER TABLE public.campaigns_to_plans OWNER TO postgres;

--
-- Name: campaigns_to_plans_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.campaigns_to_plans_id_seq OWNER TO postgres;

--
-- Name: campaigns_to_plans_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.campaigns_to_plans_id_seq OWNED BY public.campaigns_to_plans.id;


--
-- Name: combinations; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.combinations (
    id bigint NOT NULL,
    filter_types_id bigint NOT NULL,
    filters_id bigint NOT NULL
);


ALTER TABLE public.combinations OWNER TO postgres;

--
-- Name: combinations_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.combinations_id_seq OWNER TO postgres;

--
-- Name: combinations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.combinations_id_seq OWNED BY public.combinations.id;


--
-- Name: devices; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.devices (
    id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
    mac character varying(12) NOT NULL,
    is_deleted boolean NOT NULL,
    pon text,
    serie character varying(200),
    mac_wan character varying(12),
    created_at timestamp with time zone,
    updated_at timestamp with time zone,
    deleted_at timestamp with time zone,
    models_id bigint,
    subscribers_id character varying(20) NOT NULL
);


ALTER TABLE public.devices OWNER TO postgres;

--
-- Name: download_limits; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.download_limits (
    id bigint NOT NULL,
    code character varying(2) NOT NULL,
    value bigint NOT NULL,
    is_active character varying(1) NOT NULL
);


ALTER TABLE public.download_limits OWNER TO postgres;

--
-- Name: download_limits_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.download_limits_id_seq OWNER TO postgres;

--
-- Name: download_limits_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.download_limits_id_seq OWNED BY public.download_limits.id;


--
-- Name: filter_types; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.filter_types (
    id bigint NOT NULL,
    name text NOT NULL,
    is_active character varying(1) NOT NULL
);


ALTER TABLE public.filter_types OWNER TO postgres;

--
-- Name: filter_types_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.filter_types_id_seq OWNER TO postgres;

--
-- Name: filter_types_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.filter_types_id_seq OWNED BY public.filter_types.id;


--
-- Name: filters; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.filters (
    id bigint NOT NULL,
    name text NOT NULL,
    is_deleted boolean NOT NULL
);


ALTER TABLE public.filters OWNER TO postgres;

--
-- Name: filters_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.filters_id_seq OWNER TO postgres;

--
-- Name: filters_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.filters_id_seq OWNED BY public.filters.id;


--
-- Name: menus; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.menus (
    id bigint NOT NULL,
    name text NOT NULL,
    icon text,
    menus_id bigint,
    alias character varying(50) NOT NULL,
    description text,
    is_leaf boolean,
    orden bigint
);


ALTER TABLE public.menus OWNER TO postgres;

--
-- Name: menus_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.menus_id_seq OWNER TO postgres;

--
-- Name: menus_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.menus_id_seq OWNED BY public.menus.id;


--
-- Name: migration_versions; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.migration_versions (
    version character varying(14) NOT NULL,
    executed_at timestamp(0) without time zone NOT NULL
);


ALTER TABLE public.migration_versions OWNER TO postgres;

--
-- Name: COLUMN migration_versions.executed_at; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.migration_versions.executed_at IS '(DC2Type:datetime_immutable)';


--
-- Name: models; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.models (
    id bigint NOT NULL,
    name text NOT NULL,
    equation text NOT NULL,
    is_deleted boolean NOT NULL,
    brands_id bigint NOT NULL
);


ALTER TABLE public.models OWNER TO postgres;

--
-- Name: models_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.models_id_seq OWNER TO postgres;

--
-- Name: models_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.models_id_seq OWNED BY public.models.id;


--
-- Name: plans; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.plans (
    id bigint NOT NULL,
    code character varying(50) NOT NULL,
    name text NOT NULL,
    description text,
    valid_since bigint NOT NULL,
    valid_to bigint NOT NULL,
    duration bigint NOT NULL,
    allow_recharges character varying(1) NOT NULL,
    is_deleted boolean NOT NULL,
    duration_type character varying(20),
    download_limits_id bigint NOT NULL,
    speed_down bigint NOT NULL,
    speed_up bigint NOT NULL
);


ALTER TABLE public.plans OWNER TO postgres;

--
-- Name: plans_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.plans_id_seq OWNER TO postgres;

--
-- Name: plans_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.plans_id_seq OWNED BY public.plans.id;


--
-- Name: plans_to_filters; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.plans_to_filters (
    id bigint NOT NULL,
    filters_id bigint NOT NULL,
    plans_id bigint NOT NULL
);


ALTER TABLE public.plans_to_filters OWNER TO postgres;

--
-- Name: plans_to_filters_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.plans_to_filters_id_seq OWNER TO postgres;

--
-- Name: plans_to_filters_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.plans_to_filters_id_seq OWNED BY public.plans_to_filters.id;


--
-- Name: profiles; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.profiles (
    id bigint NOT NULL,
    name text NOT NULL,
    description text
);


ALTER TABLE public.profiles OWNER TO postgres;

--
-- Name: profiles_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.profiles_id_seq OWNER TO postgres;

--
-- Name: profiles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.profiles_id_seq OWNED BY public.profiles.id;


--
-- Name: profiles_to_menus; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.profiles_to_menus (
    id bigint NOT NULL,
    menus_id bigint NOT NULL,
    profiles_id bigint NOT NULL
);


ALTER TABLE public.profiles_to_menus OWNER TO postgres;

--
-- Name: profiles_to_menus_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.profiles_to_menus_id_seq OWNER TO postgres;

--
-- Name: profiles_to_menus_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.profiles_to_menus_id_seq OWNED BY public.profiles_to_menus.id;


--
-- Name: recharges; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.recharges (
    id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
    is_finished character varying(1) NOT NULL,
    created_at timestamp with time zone,
    is_deleted boolean NOT NULL,
    deleted_at timestamp with time zone,
    start_date timestamp with time zone,
    end_date timestamp with time zone,
    devices_id uuid,
    plans_id bigint NOT NULL,
    subscribers_id character varying(20) NOT NULL
);


ALTER TABLE public.recharges OWNER TO postgres;

--
-- Name: speeds; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.speeds (
    id bigint NOT NULL,
    code character varying(4) NOT NULL,
    value bigint NOT NULL,
    is_active character varying(1) NOT NULL
);


ALTER TABLE public.speeds OWNER TO postgres;

--
-- Name: speeds_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.speeds_id_seq OWNER TO postgres;

--
-- Name: speeds_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.speeds_id_seq OWNED BY public.speeds.id;


--
-- Name: subscribers; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.subscribers (
    first_name text,
    last_name text,
    phone character varying(50),
    email character varying(100),
    type_ciu character varying(10),
    ciu character varying(20) NOT NULL,
    is_deleted boolean NOT NULL,
    account_types_id bigint NOT NULL
);


ALTER TABLE public.subscribers OWNER TO postgres;

--
-- Name: users_subscribers; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.users_subscribers (
    id uuid NOT NULL,
    users_id uuid,
    subscribers_id character varying(20)
);


ALTER TABLE public.users_subscribers OWNER TO postgres;

--
-- Name: users_to_profiles; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.users_to_profiles (
    id bigint NOT NULL,
    profiles_id bigint NOT NULL,
    users_id uuid NOT NULL
);


ALTER TABLE public.users_to_profiles OWNER TO postgres;

--
-- Name: users_to_profiles_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.users_to_profiles_id_seq OWNER TO postgres;

--
-- Name: users_to_profiles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.users_to_profiles_id_seq OWNED BY public.users_to_profiles.id;


--
-- Name: account_types id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.account_types ALTER COLUMN id SET DEFAULT nextval('public.account_types_id_seq'::regclass);


--
-- Name: brands id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.brands ALTER COLUMN id SET DEFAULT nextval('public.brands_id_seq'::regclass);


--
-- Name: campaigns id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.campaigns ALTER COLUMN id SET DEFAULT nextval('public.campaigns_id_seq'::regclass);


--
-- Name: campaigns_to_plans id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.campaigns_to_plans ALTER COLUMN id SET DEFAULT nextval('public.campaigns_to_plans_id_seq'::regclass);


--
-- Name: combinations id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.combinations ALTER COLUMN id SET DEFAULT nextval('public.combinations_id_seq'::regclass);


--
-- Name: download_limits id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.download_limits ALTER COLUMN id SET DEFAULT nextval('public.download_limits_id_seq'::regclass);


--
-- Name: filter_types id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.filter_types ALTER COLUMN id SET DEFAULT nextval('public.filter_types_id_seq'::regclass);


--
-- Name: filters id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.filters ALTER COLUMN id SET DEFAULT nextval('public.filters_id_seq'::regclass);


--
-- Name: menus id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.menus ALTER COLUMN id SET DEFAULT nextval('public.menus_id_seq'::regclass);


--
-- Name: models id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.models ALTER COLUMN id SET DEFAULT nextval('public.models_id_seq'::regclass);


--
-- Name: plans id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.plans ALTER COLUMN id SET DEFAULT nextval('public.plans_id_seq'::regclass);


--
-- Name: plans_to_filters id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.plans_to_filters ALTER COLUMN id SET DEFAULT nextval('public.plans_to_filters_id_seq'::regclass);


--
-- Name: profiles id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.profiles ALTER COLUMN id SET DEFAULT nextval('public.profiles_id_seq'::regclass);


--
-- Name: profiles_to_menus id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.profiles_to_menus ALTER COLUMN id SET DEFAULT nextval('public.profiles_to_menus_id_seq'::regclass);


--
-- Name: speeds id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.speeds ALTER COLUMN id SET DEFAULT nextval('public.speeds_id_seq'::regclass);


--
-- Name: users_to_profiles id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.users_to_profiles ALTER COLUMN id SET DEFAULT nextval('public.users_to_profiles_id_seq'::regclass);


--
-- Data for Name: account_types; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.account_types (id, name, is_active) FROM stdin;
1	Pre - Pago	1
2	Post - Pago	1
3	Otro	1
4	Test	1
6	Test-t	1
5	Test-test	1
\.


--
-- Data for Name: brands; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.brands (id, name, is_deleted) FROM stdin;
1	HUAWEI	f
2	OPTICTIMES	f
3	Felix Miguel	t
4	Felix	t
5	LG	t
10	H	t
11	LLL	t
\.


--
-- Data for Name: campaigns; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.campaigns (id, name, start_date, end_date) FROM stdin;
\.


--
-- Data for Name: campaigns_to_plans; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.campaigns_to_plans (id, campaigns_id, plans_id) FROM stdin;
\.


--
-- Data for Name: combinations; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.combinations (id, filter_types_id, filters_id) FROM stdin;
1	1	17
5	2	17
\.


--
-- Data for Name: devices; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.devices (id, mac, is_deleted, pon, serie, mac_wan, created_at, updated_at, deleted_at, models_id, subscribers_id) FROM stdin;
9d7b05d3-e6e0-4095-9553-4fb147f506ab	AABBCCDDFF22	t	ASDFGHÑLKJHG	11223344	AABBCCDDFF33	\N	\N	2018-06-27 10:54:44-05	1	123456789
cd891f38-fb56-419b-91e7-ee809f41dd5e	11AAEEFFCCBB	t	CDEXSWZAQ	qazwsxedc	11AAEEFFCCCC	\N	\N	2018-06-27 10:54:44-05	1	123456789
513e5f73-be63-4fcd-9438-2e3ee177a7c4	ABCDEF123456	f	2323	23213132	ABCDEF123467	\N	\N	\N	1	43433845
250c06ee-e338-419b-a68d-a7c0da28b83c	FFCCEEBB0000	f	QAZWSXEDCVFR	QWERTYPOIUY	FFCCEEBB0001	\N	\N	\N	1	123456
f78c437a-0ff9-4db5-8ca8-056baa20d80c	AAEE1122BB10	t	MNBV1234ÑLJ567823456	MNBV1234ÑLJ5678	AAEE1122BB11	2018-06-26 05:08:42-05	\N	2018-06-27 10:54:48-05	1	654987321
9297ad79-9d3b-4a84-8c11-1a1e09fbe4dc	345345345345	t	345345345	32534534	34534534534A	2018-06-26 08:19:43-05	\N	2018-06-27 10:54:39-05	2	12345678
0d840574-818e-4ccf-a8bf-81969d2f02ec	234234234234	t	32434234	23423423	234234234235	2018-06-26 08:23:02-05	\N	2018-06-27 10:54:39-05	1	12345678
f90d3f23-594a-4dd3-ae2d-9c0548ff7469	CCBBAA112233	t	OKMIJNUHB	qazwsxvfrcde	CCBBAA112234	2018-06-27 05:38:45-05	\N	2018-06-27 10:54:52-05	1	135792468
a788d225-362b-460b-a465-0dfc68ed91e2	00DDB3AAEEFF	t	OKMNBVGFRDAS465	EDCUHBRFVYGV	DDB3AAEF04	2018-06-27 06:26:02-05	\N	2018-06-27 07:23:26-05	2	246813579
2d82db37-3d2d-43ea-ac5e-b6f168c62c0a	11223344EEFF	t	DFHSRTHSRFTHST	ASXASDAEGFVA	11223344EF00	2018-06-27 07:00:10-05	\N	2018-06-27 07:23:26-05	1	246813579
684518cd-eb25-4598-ad2a-26f27f15bfda	22223344EEFF	t	DTHSFTHJSRTJ	DRSHASDRHNINL	22223344EF04	2018-06-27 07:01:34-05	\N	2018-06-27 07:23:26-05	2	246813579
c699175f-081a-454a-ab7d-feba4d5309a3	00DD4455EEFF	t	DSRHASWERYH	OJUBGSIYVBFLUS	DD4455EF00	2018-06-27 07:02:23-05	\N	2018-06-27 07:23:26-05	1	246813579
001a3b9b-1590-49f1-a81c-4b84604ee6ca	00113355EEFF	t	XSRGADRH	ADRGHFTHJSGDH	113355EF04	2018-06-27 07:06:39-05	\N	2018-06-27 07:23:26-05	2	246813579
402fec52-373d-4950-bb1d-1a12341ed008	00224466EEFF	t	DTYJUIRTYKI	SERGSRTH	224466EF00	2018-06-27 07:06:56-05	\N	2018-06-27 07:23:26-05	1	246813579
edff4ffa-5201-4bfd-9d8f-177494998461	CCBBAA112233	t	SEDGFLIHSA	QEÑOHJASEGÑNº	CCBBAA112238	2018-06-27 10:46:55-05	\N	2018-06-27 10:54:52-05	2	135792468
1d3b9fc6-21d0-4328-88ad-0e36fa4612cb	00112233EEFF	t	DRHRB5YRG	RFVTGBYHNUJM	00112233EF04	2018-06-27 10:49:29-05	\N	2018-06-27 10:54:39-05	2	12345678
b78a8876-f2f7-43a8-a482-ef0c43181c18	0011AABBEEFF	t	QAZOKMWSXIJN	QAZCDETGB	0011AABBEF00	2018-07-03 07:16:05-05	\N	2018-07-03 07:28:27-05	1	12345
f0ce92b8-fa63-4f42-af30-adb6c9144968	E00084A2CF48	f	E00084A2CF48w	isdfq	E00084A2CF49	2020-04-24 15:14:01-05	\N	\N	1	20518158741
fa1081fe-43db-4def-a74f-722f5f1caf1e	4857544343FB	t	4857544383243F	132av123casa	4857544343FC	2020-04-23 19:16:15-05	\N	2020-04-24 15:14:24-05	3	20518158741
74f0eef9-7b4a-4e45-8e7c-e8803b0f2c5e	E00084A2CEC0	f	E00084A2CEC0rr	y654	E00084A2CEC1	2020-04-24 15:16:34-05	\N	\N	1	20518158741
811111bd-6eff-407f-b32a-658e4cd72996	01020303AABB	t	QWER1234	Q1W2E3R4T5Y6	01020303AABC	2018-06-28 07:57:47-05	\N	2020-04-27 19:18:09-05	1	987654321
ab4c4695-c74c-4828-9827-f2d80c63f604	AFC1234567B3	t	QWER1235	122334fd	AFC1234567B4	2020-04-15 13:59:02-05	\N	2020-04-27 19:18:09-05	1	987654321
c161eec3-551b-424c-ae69-dc509ff63a80	AFC1234567B1	t	QWER1235	122334fd	AFC1234567B2	2020-04-15 13:56:38-05	\N	2020-04-27 19:18:09-05	1	987654321
01f4570d-2082-4627-a0d8-c36f456e56bb	C4FF1F55773A	t	48575443FC0E469A	2150083099EGHA005737	C4FF1F55773B	2018-06-28 10:54:55-05	\N	2020-04-27 19:18:26-05	3	19660068
b2bc7faf-b3b8-4e24-a24a-6bebc1a67e82	AAAEEE111333	t	QWERTYPOIUY	11111AAAAA55555	AAAEEE111344	\N	\N	2020-04-27 19:18:44-05	1	1234567890
70aa260b-1881-44e5-adab-adfd5dfe84b1	00112233EEFF	t	EDCRFVTGB	QWERTYPOIUYT	00112233EF04	2018-06-27 10:56:53-05	\N	2020-04-27 19:18:44-05	2	1234567890
ababc6f7-66fb-4d46-9996-f311333fb3c9	00112233EEFA	t	fse	1232314	00112233EEFF	2020-04-17 10:54:09-05	\N	2020-04-27 19:18:44-05	5	1234567890
39311688-b9cb-407f-ba3a-b62ca5feb953	00112233EEFE	t	fse	1232314	00112233EF03	2020-04-17 10:46:47-05	\N	2020-04-27 19:18:44-05	5	1234567890
202cfcc3-c1ac-4ab6-bf32-71f0bd0878e5	123ABC123ABD	t	aasd	5445545	123ABC123ABE	2020-05-06 19:01:59-05	\N	2020-05-11 13:30:55-05	1	20518158741
7b9f1b77-36d7-41ab-bb47-7c7ab7e41c2d	E00084A2C343	f	E00084A2C343w	web342	E00084A2C344	2020-05-12 10:10:00-05	\N	\N	1	48590372
4b7bb1dd-2343-4915-b106-5061bbf6b667	E00084A2CF15	f	E00084A2CF15w	ihgo32	E00084A2CF16	2020-05-12 10:10:29-05	\N	\N	1	48590372
2afca071-d389-4c42-855c-391c523c4d80	FF00FF00FF00	f	2323	1235813	FF00FF00FF05	2020-05-12 11:50:09-05	\N	\N	5	15352015-1
\.


--
-- Data for Name: download_limits; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.download_limits (id, code, value, is_active) FROM stdin;
6	0 	0	1
1	GB	3	0
3	GB	5	0
4	GB	10	0
5	GB	1	0
7	GB	12	0
2	GB	4	1
\.


--
-- Data for Name: filter_types; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.filter_types (id, name, is_active) FROM stdin;
2	RS	1
3	GM	1
4	VIDEO	1
0	Sin Filtros	1
1	XXX	1
5	TE	0
\.


--
-- Data for Name: filters; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.filters (id, name, is_deleted) FROM stdin;
0	Sin Filtros	t
1	Streaming	f
2	Gaming	f
3	Redes Sociales	f
4	XXX	f
7	Pruebas de filtro 2	t
8	XXX RS	f
9	XXX GM	f
10	XXX VIDEO	f
11	RS GM	f
12	RS VIDEO	f
13	GM VIDEO	f
14	XXX RS GM	f
15	XXX GM STREAMING	f
16	RS GM STREAMING	f
17	XXX RS GM STREAMING	f
6	TEST_TEST	t
5	TEST	t
18	Martes-21	f
19	JUEVES-23	f
\.


--
-- Data for Name: menus; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.menus (id, name, icon, menus_id, alias, description, is_leaf, orden) FROM stdin;
1	Planes	fa fa-dashborard	\N	app_plan	Planes	f	2
2	Suscriptores	fa fa-dashborard	\N	app_subscriber	Suscriptores	f	1
3	Filtros	fa fa-dash-board	\N	app_filter	Filtros	f	3
4	Listar Planes		1	app_plan_list	Listar Planes	t	1
5	Crear Nuevos Planes		1	app_plan_add	Crear Nuevos Planes	t	1
6	Editar Planes		1	app_plan_update	Editar Planes	t	1
7	Eliminar Planes		1	app_plan_delete	Eliminar Planes	t	1
8	Listar Suscriptores		2	app_subscriber_list	Listar Suscriptores	t	1
9	Editar Suscriptores	\N	2	app_subscriber_update	Editar Suscriptores	t	1
10	Tipo de Cuenta		\N	app_account_type	Tipos de Cuenta	f	4
11	Tipo de Filtro		\N	app_filter_type	Tipos de Filtro	f	5
12	Límites de descarga		\N	download_limit	Límites de descarga	f	6
13	Velocidades		\N	app_speed	Velocidades	f	7
14	Marcas		\N	app_brand	Marcas	f	8
15	Modelos		\N	app_model	Modelos	f	9
16	Usuarios		\N	app_user	Usuarios	f	10
17	Roles		\N	app_profile	Roles	f	11
18	Crear Nuevos Suscriptores		2	app_subscriber_add	Crear Nuevos Suscriptores	t	1
19	Eliminar Suscriptores		2	app_subscriber_delete	Eliminar Suscriptores	t	1
20	Agregar Nuevos Dispositivos		2	app_subscriber_adddevices	Agregar Nuevos Dispositivos	t	1
21	Dar de baja a los Dispositivos		2	app_subscriber_deletedevices	Dar de baja a los Dispositivos	t	1
22	Listar Recargas		2	app_recharge_list	Listar recargas	t	1
23	Agregar Recargas		2	app_recharge_add	Agregar Recargas	t	1
24	Listar Filtros de Planes		1	app_plan_getplanfilters	Listar Filtros de Planes	t	1
25	Actualizar Filtros de Planes		1	app_plan_updateplanfilters	Actualizar Filtros de Planes	t	1
26	Listar Filtros		3	app_filter_list	Listar Filtros	t	1
27	Crear Nuevos Filtros		3	app_filter_add	Crear Nuevos Filtros	t	1
28	Editar Filtros		3	app_filter_update	Editar Filtros	t	1
29	Eliminar Filtros		3	app_filter_delete	Eliminar Filtros	t	1
30	Listar Combinaciones		3	app_filter_listcombinations	Listar Combinaciones de Filtro	t	1
31	Actualizar Combinaciones		3	app_filter_updatecombinations	Actualizar Combinaciones	t	1
32	Crear Nuevos Tipos de Cuentas		10	app_accounttype_add	Crear Nuevos Tipos de Cuentas	t	1
33	Actualizar Tipos de Cuentas		10	app_accounttype_update	Actualizar Tipos de Cuentas	t	1
34	Crear Nuevos Tipos de Filtro		11	app_filtertype_add	Crear Nuevos Tipos de Filtro	t	1
35	Editar Tipos de Filtros		11	app_filtertype_update	Editar Tipos de Filtros	t	1
36	Crear Nuevos Limites de Descargas		12	app_downloadlimit_add	Crear Nuevos Limites de Descargas	t	1
37	Editar Limites de Descargas		12	app_downloadlimit_update	Editar Limites de Descargas	t	1
38	Crear Nuevas Velocidades		13	app_speed_add	Crear Nuevas Velocidades	t	1
39	Editar Velocidades		13	app_speed_update	Editar Velocidades	t	1
40	Listar Marcas		14	app_brand_listAll	Listar Marcas	t	1
41	Crear Nuevos Marcas		14	app_brand_add	Crear Nuevos Marcas	t	1
42	Editar Marca		14	app_brand_update	Editar Marca	t	1
43	Eliminar Marca		14	app_brand_delete	Eliminar Marca	t	1
44	Listar Modelos		15	app_model_listAll	Listar Modelos	t	1
45	Crear Nuevos Modelos		15	app_model_add	Crear Nuevos Modelos	t	1
46	Editar Modelos		15	app_model_update	Editar Modelos	t	1
47	Eliminar Modelos		15	app_model_delete	Eliminar Modelos	t	1
48	Listar Usuarios		16	app_user_list	Listar Usuarios	t	1
49	Crear Nuevos Usuarios		16	app_user_add	Crear Nuevos Usuarios	t	1
50	Editar Usuarios		16	app_user_update	Editar Usuarios	t	1
51	Eliminar Usuarios		16	app_user_delete	Eliminar Usuarios	t	1
52	Listar Roles		17	app_profile_list	Listar Roles	t	1
53	Crear Nuevos Roles		17	app_profile_add	Crear Nuevos Roles	t	1
54	Editar Roles		17	app_profile_update	Editar Roles	t	1
55	Eliminar Roles		17	app_profile_delete	Eliminar Roles	t	1
56	Listar Dispositivos de Suscriptores		2	app_subscriber_listdevices	Listar Dispositivos de Suscriptores	t	1
57	Trazas del Sistema	fa fa-dashborard	\N	app_log	Trazas del Sistema	f	12
58	Listar Trazas del Sistema		57	app_log_index	Listar Trazas del Sistema	t	1
59	Eliminar Recargas		2	app_recharge_deleteRecharges	Eliminar Recargas	t	1
60	Sesiones	fa fa-dashboard	\N	app_session	Sesiones	f	4
61	Listar Sessiones	\N	60	app_session_activenow	Listar Sessiones	t	1
62	Cerrar Conexion		60	app_session_offconnection	Cerrar Conexion	t	1
63	Consumo por Suscriptor		2	app_subscriber_consumo	Consumo por Suscriptor	t	1
64	Pausar Servicios		2	app_subscriber_pauseService	Pausar Servicios	t	1
\.


--
-- Data for Name: migration_versions; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.migration_versions (version, executed_at) FROM stdin;
20200430205211	2020-04-30 20:58:25
\.


--
-- Data for Name: models; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.models (id, name, equation, is_deleted, brands_id) FROM stdin;
1	HG8245Q2	MAC+1	f	1
2	Generico	MAC+5	f	2
3	HG8245H	MAC+1	f	1
6	H1234HHH	MAC+5	t	10
5	H1234H	MAC+5	t	10
4	H1234H	MAC+5	t	10
7	EG8145V5	MAC+1	f	1
\.


--
-- Data for Name: plans; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.plans (id, code, name, description, valid_since, valid_to, duration, allow_recharges, is_deleted, duration_type, download_limits_id, speed_down, speed_up) FROM stdin;
1	PLAN01	Plan 01	Plan descripción editado	1527489814574	1525971600000	360	1	t	HOUR	1	4	4
7	iw100mbps35d	Internet Wow 100 Mbps	Plan Mensual de 100 Mbps	1585760400000	1648746000000	35	1	f	DAY	6	5	5
8	iw250mbps35d	Internet Wow 250 Mbps	Plan Mensual de  250 Mbps	1585760400000	1648746000000	35	1	f	DAY	6	32	32
9	iw500mbps35d	Internet Wow 500 Mbps	Plan Mensual de  500 Mbps	1585760400000	1648746000000	35	1	f	DAY	6	33	33
10	1Mdegradado	Internet Limitado 1Mbps	Plan Básico Degradación 1Mbps	1585760400000	1648746000000	30	1	f	DAY	4	34	34
11	2Mdegradado	Internet Limitado 2Mbps	Plan Básico Degradación 2Mbps	1585760400000	1648746000000	30	1	f	DAY	6	35	35
5	iw300M35d	Internet Wow 300Mbps	Plan Mensual de  300 Mbps	1584896400000	1584982800000	35	1	f	DAY	1	8	11
2	PLAN02	PLAN PRUEBA	DESCRIPCION ALGO IMPORTANTE	1587229200000	1588266000000	355484100	1	t	HOUR	1	1	1
3	PLAN03	PLAN TEST 15/04/2020	DESCRIPCION ALGO IMPORTANTE	1587229200000	1588266000000	355484100	1	t	HOUR	1	1	1
4	PLAN04	PLAN TEST 15/04/2020	DESCRIPCION ALGO IMPORTANTE	1587229200000	1588266000000	355484100	1	t	HOUR	1	1	1
6	1w50mpbs35d	Internet Wow 50 Mpbs	Plan mensual de  50 Mpbs	1585760400000	1648746000000	35	1	f	DAY	6	36	36
\.


--
-- Data for Name: plans_to_filters; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.plans_to_filters (id, filters_id, plans_id) FROM stdin;
3	15	2
5	16	4
9	16	3
14	17	1
\.


--
-- Data for Name: profiles; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.profiles (id, name, description) FROM stdin;
1	ROLE_ADMIN	Usuario Administrador del Sistema
2	ROLE_OPERARIO	El Operario del Sistema es el usuario que gestionara toda la información referente al almacen de dispositivos.
3	ROLE_VISOR	Visualiza la Información del sistema
4	ROLE_API	ACCESSO AL API
5	ROLE_SUSCRIPTOR	Usuario suscriptor del Sistema el cual puede observar sus datos de Navegación
\.


--
-- Data for Name: profiles_to_menus; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.profiles_to_menus (id, menus_id, profiles_id) FROM stdin;
307	1	3
308	4	3
309	2	3
310	8	3
311	22	3
312	56	3
313	3	3
314	26	3
315	30	3
316	10	3
317	40	3
318	44	3
319	48	3
337	1	2
338	4	2
339	2	2
340	8	2
341	9	2
342	18	2
343	22	2
344	23	2
345	20	2
346	21	2
347	56	2
1	1	1
2	4	1
3	5	1
4	6	1
5	7	1
6	24	1
7	25	1
8	2	1
9	8	1
10	9	1
11	18	1
12	19	1
13	20	1
14	21	1
15	22	1
16	23	1
17	56	1
18	59	1
19	63	1
20	64	1
21	3	1
22	26	1
23	27	1
24	28	1
25	29	1
26	30	1
27	31	1
28	10	1
29	32	1
30	33	1
31	11	1
32	34	1
33	35	1
34	12	1
35	36	1
36	37	1
37	13	1
38	38	1
39	39	1
40	14	1
41	40	1
42	41	1
43	42	1
44	43	1
45	15	1
46	44	1
47	45	1
48	46	1
49	47	1
50	16	1
51	48	1
52	49	1
53	50	1
54	51	1
55	17	1
56	52	1
57	53	1
58	54	1
59	55	1
60	57	1
61	58	1
62	60	1
63	61	1
64	62	1
\.


--
-- Data for Name: recharges; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.recharges (id, is_finished, created_at, is_deleted, deleted_at, start_date, end_date, devices_id, plans_id, subscribers_id) FROM stdin;
8454b760-bb4b-4eaf-9f53-68c28146e9fa	f	2020-03-30 05:17:48-05	f	\N	2020-03-29 19:00:00-05	2020-04-29 18:59:59-05	811111bd-6eff-407f-b32a-658e4cd72996	1	987654321
b294379f-7778-4e08-874d-06320f44db5d	f	2020-04-14 23:41:01-05	f	\N	2020-04-29 19:00:00-05	2020-05-29 18:59:59-05	811111bd-6eff-407f-b32a-658e4cd72996	1	987654321
6622facb-c5fa-4d19-86a4-eb9ac3f0306f	f	2020-04-14 23:43:38-05	f	\N	2020-05-29 19:00:00-05	2020-05-30 18:59:59-05	811111bd-6eff-407f-b32a-658e4cd72996	1	987654321
ac68d92c-7044-43f1-9626-953e63ad20bd	f	2020-04-14 18:50:06-05	f	\N	2020-04-18 00:00:00-05	42573-09-23 11:59:59-05	811111bd-6eff-407f-b32a-658e4cd72996	2	987654321
fe65e4cb-1f30-45ee-bfcf-1911b65afa77	f	2020-04-15 14:47:26-05	t	2020-04-15 10:01:26-05	2003-09-21 12:00:00-05	2019-12-03 03:59:59-05	811111bd-6eff-407f-b32a-658e4cd72996	2	987654321
f28680c4-0ff2-4930-b2f4-405369ce926b	f	2020-04-15 09:14:45-05	t	2020-04-15 10:02:09-05	2020-04-16 00:00:00-05	42573-09-21 11:59:59-05	811111bd-6eff-407f-b32a-658e4cd72996	2	987654321
5c3b9531-3303-43da-a9b1-e7264bbe65fd	f	2020-04-15 14:17:04-05	f	\N	2020-04-26 00:00:00-05	42573-10-01 11:59:59-05	811111bd-6eff-407f-b32a-658e4cd72996	4	987654321
6dd3fd82-c53b-49a2-9d95-e27df3bb05a1	f	2020-04-15 14:19:35-05	f	\N	2020-04-26 00:00:00-05	42573-10-01 11:59:59-05	811111bd-6eff-407f-b32a-658e4cd72996	4	987654321
1670f5b1-8a1b-49de-ab92-25c0cb595295	f	2020-04-15 19:21:42-05	f	\N	2003-09-22 12:00:00-05	2172-07-24 03:59:59-05	811111bd-6eff-407f-b32a-658e4cd72996	2	987654321
a1916d3b-91c5-4b5a-92cc-3f006344d8f6	f	2020-04-15 19:23:25-05	f	\N	2003-09-22 12:00:00-05	2172-07-24 03:59:59-05	811111bd-6eff-407f-b32a-658e4cd72996	2	987654321
ee252686-99af-410a-9be0-c1a6a3666968	f	2020-04-15 09:58:57-05	t	2020-04-15 14:25:02-05	2020-04-17 00:00:00-05	42573-09-22 11:59:59-05	811111bd-6eff-407f-b32a-658e4cd72996	2	987654321
d9d90edf-192e-482c-996f-46fcd2f25f0e	f	2020-04-15 09:59:12-05	t	2020-04-15 14:29:36-05	2020-04-19 00:00:00-05	2020-05-03 23:59:59-05	811111bd-6eff-407f-b32a-658e4cd72996	1	987654321
fa0e4e82-1be3-43df-a759-b9ffd2c69134	f	2020-04-24 15:17:24-05	t	2020-04-27 16:51:38-05	2020-04-24 00:00:00-05	2020-06-23 23:59:59-05	74f0eef9-7b4a-4e45-8e7c-e8803b0f2c5e	2	20518158741
8c9b5263-a2a8-4b32-9149-8028a2bf4d23	f	2020-04-27 16:52:05-05	f	\N	2020-04-27 00:00:00-05	2020-04-29 23:59:59-05	74f0eef9-7b4a-4e45-8e7c-e8803b0f2c5e	9	20518158741
240ba7a4-2782-49e6-898c-5e08b98ffc98	f	2020-04-24 15:15:21-05	t	2020-04-27 19:16:01-05	2020-04-24 00:00:00-05	42573-09-29 11:59:59-05	f0ce92b8-fa63-4f42-af30-adb6c9144968	2	20518158741
5516e367-f0b8-49e0-9060-b861a7aaad7a	f	2020-04-27 19:16:14-05	f	\N	2020-04-27 00:00:00-05	2020-04-29 23:59:59-05	f0ce92b8-fa63-4f42-af30-adb6c9144968	9	20518158741
a47ab57b-2999-4a34-8f71-482db9a23180	f	2020-04-29 04:44:52-05	f	\N	2020-04-30 00:00:00-05	2020-05-02 23:59:59-05	f0ce92b8-fa63-4f42-af30-adb6c9144968	9	20518158741
e96a35a6-67bc-48d4-b26f-21a0f90bd75d	f	2020-05-04 12:44:27-05	t	2020-05-04 17:44:57-05	2020-05-04 00:00:00-05	2020-06-07 23:59:59-05	f0ce92b8-fa63-4f42-af30-adb6c9144968	9	20518158741
39b2dea6-8300-4dff-b199-38e666f8d259	f	2020-05-04 17:45:20-05	t	2020-05-04 17:58:42-05	2020-05-04 00:00:00-05	2020-05-04 01:59:59-05	f0ce92b8-fa63-4f42-af30-adb6c9144968	11	20518158741
d96eae5e-5d4a-4d8d-a1f4-b6e9d86bb718	f	2020-05-04 17:58:56-05	t	2020-05-05 11:28:03-05	2020-05-04 00:00:00-05	2020-05-27 23:59:59-05	f0ce92b8-fa63-4f42-af30-adb6c9144968	11	20518158741
658f7047-78e0-46b8-b842-0edfb8192e03	f	2020-05-05 11:28:22-05	f	\N	2020-05-05 00:00:00-05	2020-05-06 05:59:59-05	f0ce92b8-fa63-4f42-af30-adb6c9144968	10	20518158741
06fccef3-4b01-4100-a648-361e913eace7	f	2020-05-04 17:43:53-05	t	2020-05-05 11:29:45-05	2020-04-30 00:00:00-05	2020-05-29 23:59:59-05	74f0eef9-7b4a-4e45-8e7c-e8803b0f2c5e	9	20518158741
a516dd48-2ead-41af-8496-99b4768adeed	f	2020-05-05 11:30:01-05	f	\N	2020-05-05 00:00:00-05	2020-05-06 10:59:59-05	74f0eef9-7b4a-4e45-8e7c-e8803b0f2c5e	6	20518158741
9458fa3e-6c18-41fa-bfcd-53dcee65d053	f	2020-05-06 12:16:23-05	f	\N	2020-05-06 00:00:00-05	2020-05-07 10:59:59-05	f0ce92b8-fa63-4f42-af30-adb6c9144968	7	20518158741
f25eef73-1364-4cf5-9408-5f2b3ef333e8	f	2020-05-06 12:16:45-05	f	\N	2020-05-06 00:00:00-05	2020-05-07 10:59:59-05	74f0eef9-7b4a-4e45-8e7c-e8803b0f2c5e	6	20518158741
adb16861-d5ac-41f6-82b8-f865a374599f	f	2020-05-07 09:59:29-05	f	\N	2020-05-07 00:00:00-05	2020-05-11 23:59:59-05	f0ce92b8-fa63-4f42-af30-adb6c9144968	8	20518158741
55394e9d-7a84-4ad6-a65b-4b20489972fc	f	2020-05-07 10:00:10-05	f	\N	2020-05-07 00:00:00-05	2020-05-11 23:59:59-05	74f0eef9-7b4a-4e45-8e7c-e8803b0f2c5e	7	20518158741
e02b8cb3-b748-44d1-b807-fecd51c1759e	f	2020-05-07 11:11:56-05	f	\N	2020-05-07 00:00:00-05	2020-05-07 23:59:59-05	f0ce92b8-fa63-4f42-af30-adb6c9144968	10	20518158741
9ca680d5-824c-45ad-8b1d-ff78309240e6	f	2020-05-07 11:16:15-05	f	\N	2020-05-07 00:00:00-05	2020-05-07 23:59:59-05	f0ce92b8-fa63-4f42-af30-adb6c9144968	11	20518158741
d9214bf1-0081-4801-9d3e-3e83ae348baa	f	2020-05-07 11:49:41-05	f	\N	2020-05-07 00:00:00-05	2020-05-07 23:59:59-05	f0ce92b8-fa63-4f42-af30-adb6c9144968	6	20518158741
dc4ff461-7482-42d7-8c95-c4a12ca17c43	f	2020-05-07 12:07:16-05	f	\N	2020-05-07 00:00:00-05	2020-05-07 23:59:59-05	f0ce92b8-fa63-4f42-af30-adb6c9144968	7	20518158741
78e074ea-963b-43ba-a46e-dac5b79de271	f	2020-05-07 12:33:36-05	f	\N	2020-05-07 00:00:00-05	2020-05-07 23:59:59-05	f0ce92b8-fa63-4f42-af30-adb6c9144968	8	20518158741
dba66e34-3c8e-41d5-8c28-71b6143a36a9	f	2020-05-07 13:08:16-05	f	\N	2020-05-07 00:00:00-05	2020-05-07 23:59:59-05	f0ce92b8-fa63-4f42-af30-adb6c9144968	5	20518158741
5b05da04-49a8-4bb6-bb47-6502a9f7bb82	f	2020-05-07 14:52:28-05	f	\N	2020-05-07 00:00:00-05	2020-05-07 23:59:59-05	f0ce92b8-fa63-4f42-af30-adb6c9144968	9	20518158741
affeba49-0376-4bd5-b788-b81c0c3f52ae	f	2020-05-11 13:32:02-05	f	\N	2020-05-11 00:00:00-05	2020-05-14 23:59:59-05	f0ce92b8-fa63-4f42-af30-adb6c9144968	6	20518158741
bb4e089d-3356-47c1-9680-49dd37a3346a	f	2020-05-11 21:13:43-05	f	\N	2020-05-07 11:00:00-05	2020-05-14 10:59:59-05	74f0eef9-7b4a-4e45-8e7c-e8803b0f2c5e	6	20518158741
fda51db1-7cb3-4f9a-9099-c554c569b07a	f	2020-05-12 10:18:34-05	f	\N	2020-05-12 00:00:00-05	2020-05-12 23:59:59-05	7b9f1b77-36d7-41ab-bb47-7c7ab7e41c2d	10	48590372
ea1ac11b-5c31-4a2c-a42f-06b1db6de617	f	2020-05-12 10:19:04-05	f	\N	2020-05-12 00:00:00-05	2020-05-12 23:59:59-05	4b7bb1dd-2343-4915-b106-5061bbf6b667	10	48590372
353341f6-6333-4b37-bc33-3824f66c9916	f	2020-05-12 12:04:43-05	f	\N	2020-05-13 00:00:00-05	2020-05-15 23:59:59-05	2afca071-d389-4c42-855c-391c523c4d80	4	15352015-1
5251a0ac-1d1f-4cd1-9040-5d36464731ab	f	2020-05-12 15:25:42-05	f	\N	2020-05-12 00:00:00-05	2020-05-13 05:59:59-05	4b7bb1dd-2343-4915-b106-5061bbf6b667	11	48590372
f01accc2-b3fc-483b-a7cc-5978b5bf52e2	f	2020-05-12 17:55:35-05	f	\N	2020-05-12 17:00:00-05	2020-05-14 03:59:59-05	7b9f1b77-36d7-41ab-bb47-7c7ab7e41c2d	6	48590372
3cb529f3-7216-4567-b815-d926dad4305a	f	2020-05-12 17:55:57-05	f	\N	2020-05-12 17:00:00-05	2020-05-14 03:59:59-05	4b7bb1dd-2343-4915-b106-5061bbf6b667	7	48590372
58854b2e-b90e-445d-87c5-68648414cf1e	f	2020-05-12 18:06:11-05	f	\N	2020-05-12 18:00:00-05	2020-05-14 04:59:59-05	7b9f1b77-36d7-41ab-bb47-7c7ab7e41c2d	7	48590372
1b360877-463c-44e8-afa1-f474351409eb	f	2020-05-13 10:18:45-05	f	\N	2020-05-13 00:00:00-05	2020-05-13 23:59:59-05	7b9f1b77-36d7-41ab-bb47-7c7ab7e41c2d	8	48590372
3fac0a5c-cddb-4dcd-9473-53626894cf24	f	2020-05-13 10:19:02-05	f	\N	2020-05-13 00:00:00-05	2020-05-13 23:59:59-05	4b7bb1dd-2343-4915-b106-5061bbf6b667	8	48590372
de183d47-2e3e-4b5f-90d2-6b6425971635	f	2020-05-13 11:05:34-05	f	\N	2020-05-13 00:00:00-05	2020-05-13 23:59:59-05	7b9f1b77-36d7-41ab-bb47-7c7ab7e41c2d	5	48590372
56ef8102-cc6f-4bfa-9088-616f197f2130	f	2020-05-13 11:05:47-05	f	\N	2020-05-13 00:00:00-05	2020-05-13 23:59:59-05	4b7bb1dd-2343-4915-b106-5061bbf6b667	5	48590372
9e6daacd-12ba-4606-8722-911424102dc5	f	2020-05-13 11:38:54-05	f	\N	2020-05-13 00:00:00-05	2020-05-13 23:59:59-05	4b7bb1dd-2343-4915-b106-5061bbf6b667	9	48590372
5d30e0d2-f5de-40ce-aa28-8550d39a5389	f	2020-05-13 11:39:12-05	f	\N	2020-05-13 00:00:00-05	2020-05-13 23:59:59-05	7b9f1b77-36d7-41ab-bb47-7c7ab7e41c2d	9	48590372
a2af9885-f765-484a-9a86-41b3da43f6fa	f	2020-05-14 10:46:53-05	f	\N	2020-05-14 00:00:00-05	2020-05-15 10:59:59-05	7b9f1b77-36d7-41ab-bb47-7c7ab7e41c2d	9	48590372
da174687-12de-443c-a987-c2572fa6b782	f	2020-05-14 10:47:24-05	f	\N	2020-05-14 00:00:00-05	2020-05-15 10:59:59-05	4b7bb1dd-2343-4915-b106-5061bbf6b667	9	48590372
340bb9d4-6d97-4014-a688-ca7ace4d2b8e	f	2020-05-14 16:06:05-05	t	2020-05-14 16:08:09-05	2020-05-14 16:00:00-05	2020-05-16 02:59:59-05	7b9f1b77-36d7-41ab-bb47-7c7ab7e41c2d	6	48590372
3c0d4e7f-ca7c-4c09-b055-f3fb119d8b04	f	2020-05-14 16:08:19-05	f	\N	2020-05-14 00:00:00-05	2020-05-15 10:59:59-05	7b9f1b77-36d7-41ab-bb47-7c7ab7e41c2d	6	48590372
845de07a-7589-45a7-953d-18680cb5e74c	f	2020-05-14 17:06:34-05	f	\N	2020-05-14 00:00:00-05	2020-05-15 10:59:59-05	74f0eef9-7b4a-4e45-8e7c-e8803b0f2c5e	7	20518158741
\.


--
-- Data for Name: speeds; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.speeds (id, code, value, is_active) FROM stdin;
4	Mbps	50	1
6	Mbps	1000	0
9	Mbps	5	1
10	Mbps	25	1
1	Mbps	10	1
7	Mbps	200	0
12	Mbps	125	0
28	Mbps	999	0
24	Mbps	190	0
22	Mbps	111	0
11	Mbps	150	1
8	Mbps	300	1
5	Mbps	100	1
32	Mbps	250	1
33	Mbps	500	1
34	Mbps	1	1
2	Mbps	20	1
3	Mbps	30	0
35	Mbps	2	1
36	Mbps	55	1
38	Mbps	130	1
\.


--
-- Data for Name: subscribers; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.subscribers (first_name, last_name, phone, email, type_ciu, ciu, is_deleted, account_types_id) FROM stdin;
\N	\N	\N	\N	RUC	111222333	t	1
\N	\N	\N	\N	RUC	123	t	1
\N	\N	\N	\N	RUC	1234	t	1
Angel	Perez	891765234	aperez@pe.pe	DNI	12345	t	1
Juan	Meza	123654987	jmeza@pe.pe	RUC	123456	t	1
\N	\N	\N	\N	RUC	1234567	t	1
\N	\N	\N	\N	RUC	123456700	t	1
Julio	Yanez	112233	jya@pe.pe	RUC	12345678	t	1
\N	\N	\N	\N	RUC	123456780	t	1
Carlos David	Moron Vegas	111222333	cmoron@pe.pe	RUC	123456789	t	1
\N	\N	\N	\N	DNI	123546789	t	1
Eduard	Colmenares	584732159	rcolme@pe.pe	RUC	135792468	t	1
Ramon	Barboza	951357741	rbarboza@pe.ve	RUC	246813579	t	2
\N	\N	\N	\N	DNI	43433845	t	1
Ruben Carlos	Villegas	321654987	rubven@pe.ve	DNI	654987321	t	1
Luis Vicente	Arevalo Rios	975864756	uno.dos@gmail.com	DNI	75168230	t	2
Empresa	Test	9994553588	info@test.com	RUC	20518158741	f	1
Jorge	Peralta	321654987	jperalta@pe.pe	CARNET	987654321	t	2
Ocho	Ocho	999999999	ocho@ocho.com	RUC	787878	t	1
Juan	Avila	12345	esd4556@gfsrt.co	DNI	19660068	t	1
Ocho	Ocho	999999999	ocho@ocho.com	RUC	777777	t	1
Pedro	Cabrera	912100123	pmcabrera@gmail.com	DNI	12323441	t	1
Raul	Sierra	123456789	rsierra@pe.pe	CARNET	1234567890	t	1
Lamolina	PruebaTest	\N	\N	DNI	48590372	f	2
\N	\N	\N	prueba@prueba.com	DNI	15352015-1	f	1
\.


--
-- Data for Name: users_subscribers; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.users_subscribers (id, users_id, subscribers_id) FROM stdin;
\.


--
-- Data for Name: users_to_profiles; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.users_to_profiles (id, profiles_id, users_id) FROM stdin;
1	1	f9f63da2-5305-440b-8bbd-2e52b637bc90
2	4	f9f63da2-5305-440b-8bbd-2e52b637bc90
7	1	b6bc0013-36c3-437a-8db5-6bbf8625b0f2
8	4	b6bc0013-36c3-437a-8db5-6bbf8625b0f2
15	1	f828b5a5-b0ed-418b-8914-2b3f562622fb
16	4	f828b5a5-b0ed-418b-8914-2b3f562622fb
17	4	915c03da-e4ee-4f1a-80bf-f9fdb0b8e11b
18	1	fe465b37-3f0b-48fa-a82e-a35d78c5c885
19	4	fe465b37-3f0b-48fa-a82e-a35d78c5c885
\.



--
-- Name: account_types account_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.account_types
    ADD CONSTRAINT account_types_pkey PRIMARY KEY (id);


--
-- Name: brands brands_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.brands
    ADD CONSTRAINT brands_pkey PRIMARY KEY (id);


--
-- Name: campaigns campaigns_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.campaigns
    ADD CONSTRAINT campaigns_pkey PRIMARY KEY (id);


--
-- Name: campaigns_to_plans campaigns_to_plans_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.campaigns_to_plans
    ADD CONSTRAINT campaigns_to_plans_pkey PRIMARY KEY (id);


--
-- Name: combinations combinations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.combinations
    ADD CONSTRAINT combinations_pkey PRIMARY KEY (id);


--
-- Name: devices devices_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.devices
    ADD CONSTRAINT devices_pkey PRIMARY KEY (id);


--
-- Name: download_limits download_limits_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.download_limits
    ADD CONSTRAINT download_limits_pkey PRIMARY KEY (id);


--
-- Name: filter_types filter_types_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.filter_types
    ADD CONSTRAINT filter_types_pkey PRIMARY KEY (id);


--
-- Name: filters filters_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.filters
    ADD CONSTRAINT filters_pkey PRIMARY KEY (id);


--
-- Name: menus menus_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.menus
    ADD CONSTRAINT menus_pkey PRIMARY KEY (id);


--
-- Name: migration_versions migration_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.migration_versions
    ADD CONSTRAINT migration_versions_pkey PRIMARY KEY (version);


--
-- Name: models models_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.models
    ADD CONSTRAINT models_pkey PRIMARY KEY (id);


--
-- Name: plans plans_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.plans
    ADD CONSTRAINT plans_pkey PRIMARY KEY (id);


--
-- Name: plans_to_filters plans_to_filters_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.plans_to_filters
    ADD CONSTRAINT plans_to_filters_pkey PRIMARY KEY (id);


--
-- Name: profiles profiles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.profiles
    ADD CONSTRAINT profiles_pkey PRIMARY KEY (id);


--
-- Name: profiles_to_menus profiles_to_menus_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.profiles_to_menus
    ADD CONSTRAINT profiles_to_menus_pkey PRIMARY KEY (id);


--
-- Name: recharges recharges_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recharges
    ADD CONSTRAINT recharges_pkey PRIMARY KEY (id);


--
-- Name: speeds speeds_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.speeds
    ADD CONSTRAINT speeds_pkey PRIMARY KEY (id);


--
-- Name: subscribers subscribers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.subscribers
    ADD CONSTRAINT subscribers_pkey PRIMARY KEY (ciu);


--
-- Name: users_subscribers users_suscribers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.users_subscribers
    ADD CONSTRAINT users_suscribers_pkey PRIMARY KEY (id);


--
-- Name: users_to_profiles users_to_profiles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.users_to_profiles
    ADD CONSTRAINT users_to_profiles_pkey PRIMARY KEY (id);


--
-- Name: campaigns_to_plans_campaigns_id_07a3b649; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX campaigns_to_plans_campaigns_id_07a3b649 ON public.campaigns_to_plans USING btree (campaigns_id);


--
-- Name: campaigns_to_plans_plans_id_9c584c29; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX campaigns_to_plans_plans_id_9c584c29 ON public.campaigns_to_plans USING btree (plans_id);


--
-- Name: combinations_filter_types_id_8f35de4f; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX combinations_filter_types_id_8f35de4f ON public.combinations USING btree (filter_types_id);


--
-- Name: combinations_filters_id_789344b1; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX combinations_filters_id_789344b1 ON public.combinations USING btree (filters_id);


--
-- Name: devices_models_id_567aa6d9; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX devices_models_id_567aa6d9 ON public.devices USING btree (models_id);


--
-- Name: devices_subscribers_id_69b8cf0d; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX devices_subscribers_id_69b8cf0d ON public.devices USING btree (subscribers_id);


--
-- Name: devices_subscribers_id_69b8cf0d_like; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX devices_subscribers_id_69b8cf0d_like ON public.devices USING btree (subscribers_id varchar_pattern_ops);


--
-- Name: menus_menus_id_2c7c8bb7; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX menus_menus_id_2c7c8bb7 ON public.menus USING btree (menus_id);


--
-- Name: models_brands_id_f0439c2d; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX models_brands_id_f0439c2d ON public.models USING btree (brands_id);


--
-- Name: plans_download_limits_id_b884985e; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX plans_download_limits_id_b884985e ON public.plans USING btree (download_limits_id);


--
-- Name: plans_speed_down_6dee07ae; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX plans_speed_down_6dee07ae ON public.plans USING btree (speed_down);


--
-- Name: plans_speed_up_74e75268; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX plans_speed_up_74e75268 ON public.plans USING btree (speed_up);


--
-- Name: plans_to_filters_filters_id_3c60415b; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX plans_to_filters_filters_id_3c60415b ON public.plans_to_filters USING btree (filters_id);


--
-- Name: plans_to_filters_plans_id_777031f7; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX plans_to_filters_plans_id_777031f7 ON public.plans_to_filters USING btree (plans_id);


--
-- Name: profiles_to_menus_menus_id_825c6c43; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX profiles_to_menus_menus_id_825c6c43 ON public.profiles_to_menus USING btree (menus_id);


--
-- Name: profiles_to_menus_profiles_id_87357a4e; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX profiles_to_menus_profiles_id_87357a4e ON public.profiles_to_menus USING btree (profiles_id);


--
-- Name: recharges_devices_id_f32864d4; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX recharges_devices_id_f32864d4 ON public.recharges USING btree (devices_id);


--
-- Name: recharges_plans_id_20b3d4f0; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX recharges_plans_id_20b3d4f0 ON public.recharges USING btree (plans_id);


--
-- Name: recharges_subscribers_id_0e3d802e; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX recharges_subscribers_id_0e3d802e ON public.recharges USING btree (subscribers_id);


--
-- Name: recharges_subscribers_id_0e3d802e_like; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX recharges_subscribers_id_0e3d802e_like ON public.recharges USING btree (subscribers_id varchar_pattern_ops);


--
-- Name: subscribers_account_types_id_c98b123d; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX subscribers_account_types_id_c98b123d ON public.subscribers USING btree (account_types_id);


--
-- Name: subscribers_ciu_70813fa2_like; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX subscribers_ciu_70813fa2_like ON public.subscribers USING btree (ciu varchar_pattern_ops);


--
-- Name: users_to_profiles_profiles_id_0cf3ae29; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX users_to_profiles_profiles_id_0cf3ae29 ON public.users_to_profiles USING btree (profiles_id);


--
-- Name: users_to_profiles_users_id_bd9001a4; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX users_to_profiles_users_id_bd9001a4 ON public.users_to_profiles USING btree (users_id);


--
-- Name: campaigns_to_plans campaigns_to_plans_campaigns_id_07a3b649_fk_campaigns_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.campaigns_to_plans
    ADD CONSTRAINT campaigns_to_plans_campaigns_id_07a3b649_fk_campaigns_id FOREIGN KEY (campaigns_id) REFERENCES public.campaigns(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: campaigns_to_plans campaigns_to_plans_plans_id_9c584c29_fk_plans_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.campaigns_to_plans
    ADD CONSTRAINT campaigns_to_plans_plans_id_9c584c29_fk_plans_id FOREIGN KEY (plans_id) REFERENCES public.plans(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: combinations combinations_filter_types_id_8f35de4f_fk_filter_types_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.combinations
    ADD CONSTRAINT combinations_filter_types_id_8f35de4f_fk_filter_types_id FOREIGN KEY (filter_types_id) REFERENCES public.filter_types(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: combinations combinations_filters_id_789344b1_fk_filters_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.combinations
    ADD CONSTRAINT combinations_filters_id_789344b1_fk_filters_id FOREIGN KEY (filters_id) REFERENCES public.filters(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: devices devices_models_id_567aa6d9_fk_models_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.devices
    ADD CONSTRAINT devices_models_id_567aa6d9_fk_models_id FOREIGN KEY (models_id) REFERENCES public.models(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: devices devices_subscribers_id_69b8cf0d_fk_subscribers_ciu; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.devices
    ADD CONSTRAINT devices_subscribers_id_69b8cf0d_fk_subscribers_ciu FOREIGN KEY (subscribers_id) REFERENCES public.subscribers(ciu) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: menus menus_menus_id_2c7c8bb7_fk_menus_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.menus
    ADD CONSTRAINT menus_menus_id_2c7c8bb7_fk_menus_id FOREIGN KEY (menus_id) REFERENCES public.menus(id) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;


--
-- Name: models models_brands_id_f0439c2d_fk_brands_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.models
    ADD CONSTRAINT models_brands_id_f0439c2d_fk_brands_id FOREIGN KEY (brands_id) REFERENCES public.brands(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: plans plans_download_limits_id_b884985e_fk_download_limits_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.plans
    ADD CONSTRAINT plans_download_limits_id_b884985e_fk_download_limits_id FOREIGN KEY (download_limits_id) REFERENCES public.download_limits(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: plans plans_speed_down_6dee07ae_fk_speeds_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.plans
    ADD CONSTRAINT plans_speed_down_6dee07ae_fk_speeds_id FOREIGN KEY (speed_down) REFERENCES public.speeds(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: plans plans_speed_up_74e75268_fk_speeds_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.plans
    ADD CONSTRAINT plans_speed_up_74e75268_fk_speeds_id FOREIGN KEY (speed_up) REFERENCES public.speeds(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: plans_to_filters plans_to_filters_filters_id_3c60415b_fk_filters_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.plans_to_filters
    ADD CONSTRAINT plans_to_filters_filters_id_3c60415b_fk_filters_id FOREIGN KEY (filters_id) REFERENCES public.filters(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: plans_to_filters plans_to_filters_plans_id_777031f7_fk_plans_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.plans_to_filters
    ADD CONSTRAINT plans_to_filters_plans_id_777031f7_fk_plans_id FOREIGN KEY (plans_id) REFERENCES public.plans(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: profiles_to_menus profiles_to_menus_menus_id_825c6c43_fk_menus_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.profiles_to_menus
    ADD CONSTRAINT profiles_to_menus_menus_id_825c6c43_fk_menus_id FOREIGN KEY (menus_id) REFERENCES public.menus(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: profiles_to_menus profiles_to_menus_profiles_id_87357a4e_fk_profiles_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.profiles_to_menus
    ADD CONSTRAINT profiles_to_menus_profiles_id_87357a4e_fk_profiles_id FOREIGN KEY (profiles_id) REFERENCES public.profiles(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: recharges recharges_devices_id_f32864d4_fk_devices_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recharges
    ADD CONSTRAINT recharges_devices_id_f32864d4_fk_devices_id FOREIGN KEY (devices_id) REFERENCES public.devices(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: recharges recharges_plans_id_20b3d4f0_fk_plans_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recharges
    ADD CONSTRAINT recharges_plans_id_20b3d4f0_fk_plans_id FOREIGN KEY (plans_id) REFERENCES public.plans(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: recharges recharges_subscribers_id_0e3d802e_fk_subscribers_ciu; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.recharges
    ADD CONSTRAINT recharges_subscribers_id_0e3d802e_fk_subscribers_ciu FOREIGN KEY (subscribers_id) REFERENCES public.subscribers(ciu) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: subscribers subscribers_account_types_id_c98b123d_fk_account_types_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.subscribers
    ADD CONSTRAINT subscribers_account_types_id_c98b123d_fk_account_types_id FOREIGN KEY (account_types_id) REFERENCES public.account_types(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: users_subscribers users_subscribers_subscribers_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.users_subscribers
    ADD CONSTRAINT users_subscribers_subscribers_id_fkey FOREIGN KEY (subscribers_id) REFERENCES public.subscribers(ciu) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: users_subscribers users_subscribers_users_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.users_subscribers
    ADD CONSTRAINT users_subscribers_users_id_fkey FOREIGN KEY (users_id) REFERENCES public.users(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: users_to_profiles users_to_profiles_profiles_id_0cf3ae29_fk_profiles_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.users_to_profiles
    ADD CONSTRAINT users_to_profiles_profiles_id_0cf3ae29_fk_profiles_id FOREIGN KEY (profiles_id) REFERENCES public.profiles(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: users_to_profiles users_to_profiles_users_id_bd9001a4_fk_users_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.users_to_profiles
    ADD CONSTRAINT users_to_profiles_users_id_bd9001a4_fk_users_id FOREIGN KEY (users_id) REFERENCES public.users(id) DEFERRABLE INITIALLY DEFERRED;


--
-- Name: TABLE account_types; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.account_types TO radman;


--
-- Name: TABLE brands; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.brands TO radman;


--
-- Name: TABLE campaigns; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.campaigns TO radman;


--
-- Name: TABLE campaigns_to_plans; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.campaigns_to_plans TO radman;


--
-- Name: TABLE combinations; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.combinations TO radman;


--
-- Name: TABLE devices; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.devices TO radman;


--
-- Name: TABLE download_limits; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.download_limits TO radman;


--
-- Name: TABLE filter_types; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.filter_types TO radman;


--
-- Name: TABLE filters; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.filters TO radman;


--
-- Name: TABLE menus; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.menus TO radman;


--
-- Name: TABLE migration_versions; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.migration_versions TO radman;


--
-- Name: TABLE models; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.models TO radman;


--
-- Name: TABLE plans; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.plans TO radman;


--
-- Name: TABLE plans_to_filters; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.plans_to_filters TO radman;


--
-- Name: TABLE profiles; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.profiles TO radman;


--
-- Name: TABLE profiles_to_menus; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.profiles_to_menus TO radman;


--
-- Name: TABLE recharges; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.recharges TO radman;


--
-- Name: TABLE speeds; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.speeds TO radman;


--
-- Name: TABLE subscribers; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.subscribers TO radman;


--
-- Name: TABLE users; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.users TO radman;


--
-- Name: TABLE users_subscribers; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.users_subscribers TO radman;


--
-- Name: TABLE users_to_profiles; Type: ACL; Schema: public; Owner: postgres
--

GRANT ALL ON TABLE public.users_to_profiles TO radman;


--
-- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: public; Owner: postgres
--

ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public REVOKE ALL ON TABLES  FROM postgres;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON TABLES  TO radman;


--
--

