/*
Navicat PGSQL Data Transfer

Source Server         : IWAY-Server:5432
Source Server Version : 90223
Source Host           : 10.50.1.28:5432
Source Database       : appv7
Source Schema         : public

Target Server Type    : PGSQL
Target Server Version : 90223
File Encoding         : 65001

Date: 2018-07-10 14:49:08
*/


-- ----------------------------
-- Sequence structure for "public"."account_types_id_seq"
-- ----------------------------
DROP SEQUENCE "public"."account_types_id_seq";
CREATE SEQUENCE "public"."account_types_id_seq"
 INCREMENT 1
 MINVALUE 1
 MAXVALUE 9223372036854775807
 START 4
 CACHE 1;

-- ----------------------------
-- Sequence structure for "public"."brands_id_seq"
-- ----------------------------
DROP SEQUENCE "public"."brands_id_seq";
CREATE SEQUENCE "public"."brands_id_seq"
 INCREMENT 1
 MINVALUE 1
 MAXVALUE 9223372036854775807
 START 2
 CACHE 1;

-- ----------------------------
-- Sequence structure for "public"."campaigns_id_seq"
-- ----------------------------
DROP SEQUENCE "public"."campaigns_id_seq";
CREATE SEQUENCE "public"."campaigns_id_seq"
 INCREMENT 1
 MINVALUE 1
 MAXVALUE 9223372036854775807
 START 1
 CACHE 1;

-- ----------------------------
-- Sequence structure for "public"."campaigns_to_plans_id_seq"
-- ----------------------------
DROP SEQUENCE "public"."campaigns_to_plans_id_seq";
CREATE SEQUENCE "public"."campaigns_to_plans_id_seq"
 INCREMENT 1
 MINVALUE 1
 MAXVALUE 9223372036854775807
 START 1
 CACHE 1;

-- ----------------------------
-- Sequence structure for "public"."combinations_id_seq"
-- ----------------------------
DROP SEQUENCE "public"."combinations_id_seq";
CREATE SEQUENCE "public"."combinations_id_seq"
 INCREMENT 1
 MINVALUE 1
 MAXVALUE 9223372036854775807
 START 50
 CACHE 1;

-- ----------------------------
-- Sequence structure for "public"."devices_id_seq"
-- ----------------------------
DROP SEQUENCE "public"."devices_id_seq";
CREATE SEQUENCE "public"."devices_id_seq"
 INCREMENT 1
 MINVALUE 1
 MAXVALUE 9223372036854775807
 START 21
 CACHE 1;

-- ----------------------------
-- Sequence structure for "public"."download_limits_id_seq"
-- ----------------------------
DROP SEQUENCE "public"."download_limits_id_seq";
CREATE SEQUENCE "public"."download_limits_id_seq"
 INCREMENT 1
 MINVALUE 1
 MAXVALUE 9223372036854775807
 START 5
 CACHE 1;

-- ----------------------------
-- Sequence structure for "public"."filter_types_id_seq"
-- ----------------------------
DROP SEQUENCE "public"."filter_types_id_seq";
CREATE SEQUENCE "public"."filter_types_id_seq"
 INCREMENT 1
 MINVALUE 1
 MAXVALUE 9223372036854775807
 START 5
 CACHE 1;

-- ----------------------------
-- Sequence structure for "public"."filters_id_seq"
-- ----------------------------
DROP SEQUENCE "public"."filters_id_seq";
CREATE SEQUENCE "public"."filters_id_seq"
 INCREMENT 1
 MINVALUE 1
 MAXVALUE 9223372036854775807
 START 17
 CACHE 1;

-- ----------------------------
-- Sequence structure for "public"."menus_id_seq"
-- ----------------------------
DROP SEQUENCE "public"."menus_id_seq";
CREATE SEQUENCE "public"."menus_id_seq"
 INCREMENT 1
 MINVALUE 1
 MAXVALUE 9223372036854775807
 START 1
 CACHE 1;

-- ----------------------------
-- Sequence structure for "public"."models_id_seq"
-- ----------------------------
DROP SEQUENCE "public"."models_id_seq";
CREATE SEQUENCE "public"."models_id_seq"
 INCREMENT 1
 MINVALUE 1
 MAXVALUE 9223372036854775807
 START 3
 CACHE 1;

-- ----------------------------
-- Sequence structure for "public"."plans_id_seq"
-- ----------------------------
DROP SEQUENCE "public"."plans_id_seq";
CREATE SEQUENCE "public"."plans_id_seq"
 INCREMENT 1
 MINVALUE 1
 MAXVALUE 9223372036854775807
 START 39
 CACHE 1;

-- ----------------------------
-- Sequence structure for "public"."plans_to_filters_id_seq"
-- ----------------------------
DROP SEQUENCE "public"."plans_to_filters_id_seq";
CREATE SEQUENCE "public"."plans_to_filters_id_seq"
 INCREMENT 1
 MINVALUE 1
 MAXVALUE 9223372036854775807
 START 46
 CACHE 1;

-- ----------------------------
-- Sequence structure for "public"."profiles_id_seq"
-- ----------------------------
DROP SEQUENCE "public"."profiles_id_seq";
CREATE SEQUENCE "public"."profiles_id_seq"
 INCREMENT 1
 MINVALUE 1
 MAXVALUE 9223372036854775807
 START 12
 CACHE 1;

-- ----------------------------
-- Sequence structure for "public"."profiles_to_menus_id_seq"
-- ----------------------------
DROP SEQUENCE "public"."profiles_to_menus_id_seq";
CREATE SEQUENCE "public"."profiles_to_menus_id_seq"
 INCREMENT 1
 MINVALUE 1
 MAXVALUE 9223372036854775807
 START 362
 CACHE 1;

-- ----------------------------
-- Sequence structure for "public"."recharges_id_seq"
-- ----------------------------
DROP SEQUENCE "public"."recharges_id_seq";
CREATE SEQUENCE "public"."recharges_id_seq"
 INCREMENT 1
 MINVALUE 1
 MAXVALUE 9223372036854775807
 START 28
 CACHE 1;

-- ----------------------------
-- Sequence structure for "public"."speeds_id_seq"
-- ----------------------------
DROP SEQUENCE "public"."speeds_id_seq";
CREATE SEQUENCE "public"."speeds_id_seq"
 INCREMENT 1
 MINVALUE 1
 MAXVALUE 9223372036854775807
 START 11
 CACHE 1;

-- ----------------------------
-- Sequence structure for "public"."users_id_seq"
-- ----------------------------
DROP SEQUENCE "public"."users_id_seq";
CREATE SEQUENCE "public"."users_id_seq"
 INCREMENT 1
 MINVALUE 1
 MAXVALUE 9223372036854775807
 START 9
 CACHE 1;

-- ----------------------------
-- Sequence structure for "public"."users_to_profiles_id_seq"
-- ----------------------------
DROP SEQUENCE "public"."users_to_profiles_id_seq";
CREATE SEQUENCE "public"."users_to_profiles_id_seq"
 INCREMENT 1
 MINVALUE 1
 MAXVALUE 9223372036854775807
 START 56
 CACHE 1;

-- ----------------------------
-- Table structure for "public"."account_types"
-- ----------------------------
DROP TABLE "public"."account_types";
CREATE TABLE "public"."account_types" (
"id" int4 DEFAULT nextval('account_types_id_seq'::regclass) NOT NULL,
"name" varchar(200) NOT NULL,
"is_active" char(1) DEFAULT '1'::bpchar NOT NULL
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of account_types
-- ----------------------------
INSERT INTO "public"."account_types" VALUES ('1', 'Pre - Pago', '1');
INSERT INTO "public"."account_types" VALUES ('2', 'Post - Pago', '1');
INSERT INTO "public"."account_types" VALUES ('3', 'Otro', '1');
INSERT INTO "public"."account_types" VALUES ('4', 'Test', '1');

-- ----------------------------
-- Table structure for "public"."brands"
-- ----------------------------
DROP TABLE "public"."brands";
CREATE TABLE "public"."brands" (
"id" int4 DEFAULT nextval('brands_id_seq'::regclass) NOT NULL,
"name" varchar(200) NOT NULL,
"is_deleted" bool DEFAULT false NOT NULL
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of brands
-- ----------------------------
INSERT INTO "public"."brands" VALUES ('1', 'HUAWEI', 'f');
INSERT INTO "public"."brands" VALUES ('2', 'OPTICTIMES', 'f');

-- ----------------------------
-- Table structure for "public"."campaigns"
-- ----------------------------
DROP TABLE "public"."campaigns";
CREATE TABLE "public"."campaigns" (
"id" int4 DEFAULT nextval('campaigns_id_seq'::regclass) NOT NULL,
"name" varchar(2044) NOT NULL,
"start_date" int8 NOT NULL,
"end_date" int8 NOT NULL
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of campaigns
-- ----------------------------

-- ----------------------------
-- Table structure for "public"."campaigns_to_plans"
-- ----------------------------
DROP TABLE "public"."campaigns_to_plans";
CREATE TABLE "public"."campaigns_to_plans" (
"campaigns_id" int4 NOT NULL,
"plans_id" int4 NOT NULL,
"id" int4 DEFAULT nextval('campaigns_to_plans_id_seq'::regclass) NOT NULL
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of campaigns_to_plans
-- ----------------------------

-- ----------------------------
-- Table structure for "public"."combinations"
-- ----------------------------
DROP TABLE "public"."combinations";
CREATE TABLE "public"."combinations" (
"filter_types_id" int4 NOT NULL,
"filters_id" int4 NOT NULL,
"id" int4 DEFAULT nextval('combinations_id_seq'::regclass) NOT NULL
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of combinations
-- ----------------------------
INSERT INTO "public"."combinations" VALUES ('1', '4', '12');
INSERT INTO "public"."combinations" VALUES ('4', '7', '18');
INSERT INTO "public"."combinations" VALUES ('2', '7', '19');
INSERT INTO "public"."combinations" VALUES ('1', '8', '20');
INSERT INTO "public"."combinations" VALUES ('2', '8', '24');
INSERT INTO "public"."combinations" VALUES ('2', '3', '25');
INSERT INTO "public"."combinations" VALUES ('3', '2', '26');
INSERT INTO "public"."combinations" VALUES ('4', '1', '27');
INSERT INTO "public"."combinations" VALUES ('1', '9', '28');
INSERT INTO "public"."combinations" VALUES ('3', '9', '29');
INSERT INTO "public"."combinations" VALUES ('1', '10', '30');
INSERT INTO "public"."combinations" VALUES ('4', '10', '31');
INSERT INTO "public"."combinations" VALUES ('2', '11', '32');
INSERT INTO "public"."combinations" VALUES ('3', '11', '33');
INSERT INTO "public"."combinations" VALUES ('2', '12', '34');
INSERT INTO "public"."combinations" VALUES ('4', '12', '35');
INSERT INTO "public"."combinations" VALUES ('3', '13', '36');
INSERT INTO "public"."combinations" VALUES ('4', '13', '37');
INSERT INTO "public"."combinations" VALUES ('1', '14', '38');
INSERT INTO "public"."combinations" VALUES ('2', '14', '39');
INSERT INTO "public"."combinations" VALUES ('3', '14', '40');
INSERT INTO "public"."combinations" VALUES ('1', '15', '41');
INSERT INTO "public"."combinations" VALUES ('3', '15', '42');
INSERT INTO "public"."combinations" VALUES ('4', '15', '43');
INSERT INTO "public"."combinations" VALUES ('2', '16', '44');
INSERT INTO "public"."combinations" VALUES ('3', '16', '45');
INSERT INTO "public"."combinations" VALUES ('4', '16', '46');
INSERT INTO "public"."combinations" VALUES ('1', '17', '47');
INSERT INTO "public"."combinations" VALUES ('2', '17', '48');
INSERT INTO "public"."combinations" VALUES ('3', '17', '49');
INSERT INTO "public"."combinations" VALUES ('4', '17', '50');

-- ----------------------------
-- Table structure for "public"."devices"
-- ----------------------------
DROP TABLE "public"."devices";
CREATE TABLE "public"."devices" (
"id" int4 DEFAULT nextval('devices_id_seq'::regclass) NOT NULL,
"mac" varchar(12) NOT NULL,
"is_deleted" bool DEFAULT false NOT NULL,
"subscribers_id" varchar(20) NOT NULL,
"pon" varchar(200),
"models_id" int4,
"serie" varchar(200),
"mac_wan" varchar(12),
"created_at" timestamp(6),
"updated_at" timestamp(6),
"deleted_at" timestamp(6)
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of devices
-- ----------------------------
INSERT INTO "public"."devices" VALUES ('1', 'AAAEEE111333', 't', '123456789', 'QWERTYPOIUY', '1', '11111AAAAA55555', 'AAAEEE111344', null, null, '2018-06-27 15:54:44');
INSERT INTO "public"."devices" VALUES ('2', 'AABBCCDDFF22', 't', '123456789', 'ASDFGHÑLKJHG', '1', '11223344', 'AABBCCDDFF33', null, null, '2018-06-27 15:54:44');
INSERT INTO "public"."devices" VALUES ('3', '11AAEEFFCCBB', 't', '123456789', 'CDEXSWZAQ', '1', 'qazwsxedc', '11AAEEFFCCCC', null, null, '2018-06-27 15:54:44');
INSERT INTO "public"."devices" VALUES ('4', 'ABCDEF123456', 'f', '43433845', '2323', '1', '23213132', 'ABCDEF123467', null, null, null);
INSERT INTO "public"."devices" VALUES ('5', 'FFCCEEBB0000', 'f', '123456', 'QAZWSXEDCVFR', '1', 'QWERTYPOIUY', 'FFCCEEBB0001', null, null, null);
INSERT INTO "public"."devices" VALUES ('6', 'AAEE1122BB10', 't', '654987321', 'MNBV1234ÑLJ567823456', '1', 'MNBV1234ÑLJ5678', 'AAEE1122BB11', '2018-06-26 10:08:42', null, '2018-06-27 15:54:48');
INSERT INTO "public"."devices" VALUES ('7', '345345345345', 't', '12345678', '345345345', '2', '32534534', '34534534534A', '2018-06-26 13:19:43', null, '2018-06-27 15:54:39');
INSERT INTO "public"."devices" VALUES ('8', '234234234234', 't', '12345678', '32434234', '1', '23423423', '234234234235', '2018-06-26 13:23:02', null, '2018-06-27 15:54:39');
INSERT INTO "public"."devices" VALUES ('9', 'CCBBAA112233', 't', '135792468', 'OKMIJNUHB', '1', 'qazwsxvfrcde', 'CCBBAA112234', '2018-06-27 10:38:45', null, '2018-06-27 15:54:52');
INSERT INTO "public"."devices" VALUES ('10', '00DDB3AAEEFF', 't', '246813579', 'OKMNBVGFRDAS465', '2', 'EDCUHBRFVYGV', 'DDB3AAEF04', '2018-06-27 11:26:02', null, '2018-06-27 12:23:26');
INSERT INTO "public"."devices" VALUES ('11', '11223344EEFF', 't', '246813579', 'DFHSRTHSRFTHST', '1', 'ASXASDAEGFVA', '11223344EF00', '2018-06-27 12:00:10', null, '2018-06-27 12:23:26');
INSERT INTO "public"."devices" VALUES ('12', '22223344EEFF', 't', '246813579', 'DTHSFTHJSRTJ', '2', 'DRSHASDRHNINL', '22223344EF04', '2018-06-27 12:01:34', null, '2018-06-27 12:23:26');
INSERT INTO "public"."devices" VALUES ('13', '00DD4455EEFF', 't', '246813579', 'DSRHASWERYH', '1', 'OJUBGSIYVBFLUS', 'DD4455EF00', '2018-06-27 12:02:23', null, '2018-06-27 12:23:26');
INSERT INTO "public"."devices" VALUES ('14', '00113355EEFF', 't', '246813579', 'XSRGADRH', '2', 'ADRGHFTHJSGDH', '113355EF04', '2018-06-27 12:06:39', null, '2018-06-27 12:23:26');
INSERT INTO "public"."devices" VALUES ('15', '00224466EEFF', 't', '246813579', 'DTYJUIRTYKI', '1', 'SERGSRTH', '224466EF00', '2018-06-27 12:06:56', null, '2018-06-27 12:23:26');
INSERT INTO "public"."devices" VALUES ('16', 'CCBBAA112233', 't', '135792468', 'SEDGFLIHSA', '2', 'QEÑOHJASEGÑNº', 'CCBBAA112238', '2018-06-27 15:46:55', null, '2018-06-27 15:54:52');
INSERT INTO "public"."devices" VALUES ('17', '00112233EEFF', 't', '12345678', 'DRHRB5YRG', '2', 'RFVTGBYHNUJM', '00112233EF04', '2018-06-27 15:49:29', null, '2018-06-27 15:54:39');
INSERT INTO "public"."devices" VALUES ('18', '00112233EEFF', 'f', '1234567890', 'EDCRFVTGB', '2', 'QWERTYPOIUYT', '00112233EF04', '2018-06-27 15:56:53', null, null);
INSERT INTO "public"."devices" VALUES ('19', '01020303AABB', 'f', '987654321', 'QWER1234', '1', 'Q1W2E3R4T5Y6', '01020303AABC', '2018-06-28 12:57:47', null, null);
INSERT INTO "public"."devices" VALUES ('20', 'C4FF1F55773A', 'f', '19660068', '48575443FC0E469A', '3', '2150083099EGHA005737', 'C4FF1F55773B', '2018-06-28 15:54:55', null, null);
INSERT INTO "public"."devices" VALUES ('21', '0011AABBEEFF', 't', '12345', 'QAZOKMWSXIJN', '1', 'QAZCDETGB', '0011AABBEF00', '2018-07-03 12:16:05', null, '2018-07-03 12:28:27');

-- ----------------------------
-- Table structure for "public"."download_limits"
-- ----------------------------
DROP TABLE "public"."download_limits";
CREATE TABLE "public"."download_limits" (
"id" int4 DEFAULT nextval('download_limits_id_seq'::regclass) NOT NULL,
"code" char(2) NOT NULL,
"value" int4 NOT NULL,
"is_active" char(1) DEFAULT '0'::bpchar NOT NULL
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of download_limits
-- ----------------------------
INSERT INTO "public"."download_limits" VALUES ('1', 'GB', '3', '1');
INSERT INTO "public"."download_limits" VALUES ('2', 'GB', '4', '1');
INSERT INTO "public"."download_limits" VALUES ('3', 'GB', '5', '1');
INSERT INTO "public"."download_limits" VALUES ('4', 'GB', '10', '1');
INSERT INTO "public"."download_limits" VALUES ('5', 'GB', '1', '1');
INSERT INTO "public"."download_limits" VALUES ('6', '0 ', '0', '1');

-- ----------------------------
-- Table structure for "public"."filter_types"
-- ----------------------------
DROP TABLE "public"."filter_types";
CREATE TABLE "public"."filter_types" (
"id" int4 DEFAULT nextval('filter_types_id_seq'::regclass) NOT NULL,
"name" varchar(200) NOT NULL,
"is_active" char(1) DEFAULT '1'::bpchar NOT NULL
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of filter_types
-- ----------------------------
INSERT INTO "public"."filter_types" VALUES ('0', 'Sin Filtros', '0');
INSERT INTO "public"."filter_types" VALUES ('1', 'XXX', '1');
INSERT INTO "public"."filter_types" VALUES ('2', 'RS', '1');
INSERT INTO "public"."filter_types" VALUES ('3', 'GM', '1');
INSERT INTO "public"."filter_types" VALUES ('4', 'VIDEO', '1');

-- ----------------------------
-- Table structure for "public"."filters"
-- ----------------------------
DROP TABLE "public"."filters";
CREATE TABLE "public"."filters" (
"id" int4 DEFAULT nextval('filters_id_seq'::regclass) NOT NULL,
"name" varchar(200) NOT NULL,
"is_deleted" bool DEFAULT false NOT NULL
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of filters
-- ----------------------------
INSERT INTO "public"."filters" VALUES ('0', 'Sin Filtros', 't');
INSERT INTO "public"."filters" VALUES ('1', 'Streaming', 'f');
INSERT INTO "public"."filters" VALUES ('2', 'Gaming', 'f');
INSERT INTO "public"."filters" VALUES ('3', 'Redes Sociales', 'f');
INSERT INTO "public"."filters" VALUES ('4', 'XXX', 'f');
INSERT INTO "public"."filters" VALUES ('7', 'Pruebas de filtro 2', 't');
INSERT INTO "public"."filters" VALUES ('8', 'XXX RS', 'f');
INSERT INTO "public"."filters" VALUES ('9', 'XXX GM', 'f');
INSERT INTO "public"."filters" VALUES ('10', 'XXX VIDEO', 'f');
INSERT INTO "public"."filters" VALUES ('11', 'RS GM', 'f');
INSERT INTO "public"."filters" VALUES ('12', 'RS VIDEO', 'f');
INSERT INTO "public"."filters" VALUES ('13', 'GM VIDEO', 'f');
INSERT INTO "public"."filters" VALUES ('14', 'XXX RS GM', 'f');
INSERT INTO "public"."filters" VALUES ('15', 'XXX GM STREAMING', 'f');
INSERT INTO "public"."filters" VALUES ('16', 'RS GM STREAMING', 'f');
INSERT INTO "public"."filters" VALUES ('17', 'XXX RS GM STREAMING', 'f');

-- ----------------------------
-- Table structure for "public"."menus"
-- ----------------------------
DROP TABLE "public"."menus";
CREATE TABLE "public"."menus" (
"id" int4 DEFAULT nextval('menus_id_seq'::regclass) NOT NULL,
"name" varchar(2044) NOT NULL,
"icon" varchar(2044),
"menus_id" int4,
"alias" varchar(100) NOT NULL,
"description" text,
"is_leaf" bool NOT NULL,
"orden" int4
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of menus
-- ----------------------------
INSERT INTO "public"."menus" VALUES ('1', 'Planes', 'fa fa-dashborard', null, 'app_plan', 'Planes', 'f', '2');
INSERT INTO "public"."menus" VALUES ('2', 'Suscriptores', 'fa fa-dashborard', null, 'app_subscriber', 'Suscriptores', 'f', '1');
INSERT INTO "public"."menus" VALUES ('3', 'Filtros', 'fa fa-dash-board', null, 'app_filter', 'Filtros', 'f', '3');
INSERT INTO "public"."menus" VALUES ('4', 'Listar Planes', '', '1', 'app_plan_list', 'Listar Planes', 't', '1');
INSERT INTO "public"."menus" VALUES ('5', 'Crear Nuevos Planes', '', '1', 'app_plan_add', 'Crear Nuevos Planes', 't', '1');
INSERT INTO "public"."menus" VALUES ('6', 'Editar Planes', '', '1', 'app_plan_update', 'Editar Planes', 't', '1');
INSERT INTO "public"."menus" VALUES ('7', 'Eliminar Planes', '', '1', 'app_plan_delete', 'Eliminar Planes', 't', '1');
INSERT INTO "public"."menus" VALUES ('8', 'Listar Suscriptores', '', '2', 'app_subscriber_list', 'Listar Suscriptores', 't', '1');
INSERT INTO "public"."menus" VALUES ('9', 'Editar Suscriptores', null, '2', 'app_subscriber_update', 'Editar Suscriptores', 't', '1');
INSERT INTO "public"."menus" VALUES ('10', 'Tipo de Cuenta', '', null, 'app_account_type', 'Tipos de Cuenta', 'f', '4');
INSERT INTO "public"."menus" VALUES ('11', 'Tipo de Filtro', '', null, 'app_filter_type', 'Tipos de Filtro', 'f', '5');
INSERT INTO "public"."menus" VALUES ('12', 'Límites de descarga', '', null, 'download_limit', 'Límites de descarga', 'f', '6');
INSERT INTO "public"."menus" VALUES ('13', 'Velocidades', '', null, 'app_speed', 'Velocidades', 'f', '7');
INSERT INTO "public"."menus" VALUES ('14', 'Marcas', '', null, 'app_brand', 'Marcas', 'f', '8');
INSERT INTO "public"."menus" VALUES ('15', 'Modelos', '', null, 'app_model', 'Modelos', 'f', '9');
INSERT INTO "public"."menus" VALUES ('16', 'Usuarios', '', null, 'app_user', 'Usuarios', 'f', '10');
INSERT INTO "public"."menus" VALUES ('17', 'Roles', '', null, 'app_profile', 'Roles', 'f', '11');
INSERT INTO "public"."menus" VALUES ('18', 'Crear Nuevos Suscriptores', '', '2', 'app_subscriber_add', 'Crear Nuevos Suscriptores', 't', '1');
INSERT INTO "public"."menus" VALUES ('19', 'Eliminar Suscriptores', '', '2', 'app_subscriber_delete', 'Eliminar Suscriptores', 't', '1');
INSERT INTO "public"."menus" VALUES ('20', 'Agregar Nuevos Dispositivos', '', '2', 'app_subscriber_adddevices', 'Agregar Nuevos Dispositivos', 't', '1');
INSERT INTO "public"."menus" VALUES ('21', 'Dar de baja a los Dispositivos', '', '2', 'app_subscriber_deletedevices', 'Dar de baja a los Dispositivos', 't', '1');
INSERT INTO "public"."menus" VALUES ('22', 'Listar Recargas', '', '2', 'app_recharge_list', 'Listar recargas', 't', '1');
INSERT INTO "public"."menus" VALUES ('23', 'Agregar Recargas', '', '2', 'app_recharge_add', 'Agregar Recargas', 't', '1');
INSERT INTO "public"."menus" VALUES ('24', 'Listar Filtros de Planes', '', '1', 'app_plan_getplanfilters', 'Listar Filtros de Planes', 't', '1');
INSERT INTO "public"."menus" VALUES ('25', 'Actualizar Filtros de Planes', '', '1', 'app_plan_updateplanfilters', 'Actualizar Filtros de Planes', 't', '1');
INSERT INTO "public"."menus" VALUES ('26', 'Listar Filtros', '', '3', 'app_filter_list', 'Listar Filtros', 't', '1');
INSERT INTO "public"."menus" VALUES ('27', 'Crear Nuevos Filtros', '', '3', 'app_filter_add', 'Crear Nuevos Filtros', 't', '1');
INSERT INTO "public"."menus" VALUES ('28', 'Editar Filtros', '', '3', 'app_filter_update', 'Editar Filtros', 't', '1');
INSERT INTO "public"."menus" VALUES ('29', 'Eliminar Filtros', '', '3', 'app_filter_delete', 'Eliminar Filtros', 't', '1');
INSERT INTO "public"."menus" VALUES ('30', 'Listar Combinaciones', '', '3', 'app_filter_listcombinations', 'Listar Combinaciones de Filtro', 't', '1');
INSERT INTO "public"."menus" VALUES ('31', 'Actualizar Combinaciones', '', '3', 'app_filter_updatecombinations', 'Actualizar Combinaciones', 't', '1');
INSERT INTO "public"."menus" VALUES ('32', 'Crear Nuevos Tipos de Cuentas', '', '10', 'app_accounttype_add', 'Crear Nuevos Tipos de Cuentas', 't', '1');
INSERT INTO "public"."menus" VALUES ('33', 'Actualizar Tipos de Cuentas', '', '10', 'app_accounttype_update', 'Actualizar Tipos de Cuentas', 't', '1');
INSERT INTO "public"."menus" VALUES ('34', 'Crear Nuevos Tipos de Filtro', '', '11', 'app_filtertype_add', 'Crear Nuevos Tipos de Filtro', 't', '1');
INSERT INTO "public"."menus" VALUES ('35', 'Editar Tipos de Filtros', '', '11', 'app_filtertype_update', 'Editar Tipos de Filtros', 't', '1');
INSERT INTO "public"."menus" VALUES ('36', 'Crear Nuevos Limites de Descargas', '', '12', 'app_downloadlimit_add', 'Crear Nuevos Limites de Descargas', 't', '1');
INSERT INTO "public"."menus" VALUES ('37', 'Editar Limites de Descargas', '', '12', 'app_downloadlimit_update', 'Editar Limites de Descargas', 't', '1');
INSERT INTO "public"."menus" VALUES ('38', 'Crear Nuevas Velocidades', '', '13', 'app_speed_add', 'Crear Nuevas Velocidades', 't', '1');
INSERT INTO "public"."menus" VALUES ('39', 'Editar Velocidades', '', '13', 'app_speed_update', 'Editar Velocidades', 't', '1');
INSERT INTO "public"."menus" VALUES ('40', 'Listar Marcas', '', '14', 'app_brand_listAll', 'Listar Marcas', 't', '1');
INSERT INTO "public"."menus" VALUES ('41', 'Crear Nuevos Marcas', '', '14', 'app_brand_add', 'Crear Nuevos Marcas', 't', '1');
INSERT INTO "public"."menus" VALUES ('42', 'Editar Marca', '', '14', 'app_brand_update', 'Editar Marca', 't', '1');
INSERT INTO "public"."menus" VALUES ('43', 'Eliminar Marca', '', '14', 'app_brand_delete', 'Eliminar Marca', 't', '1');
INSERT INTO "public"."menus" VALUES ('44', 'Listar Modelos', '', '15', 'app_model_listAll', 'Listar Modelos', 't', '1');
INSERT INTO "public"."menus" VALUES ('45', 'Crear Nuevos Modelos', '', '15', 'app_model_add', 'Crear Nuevos Modelos', 't', '1');
INSERT INTO "public"."menus" VALUES ('46', 'Editar Modelos', '', '15', 'app_model_update', 'Editar Modelos', 't', '1');
INSERT INTO "public"."menus" VALUES ('47', 'Eliminar Modelos', '', '15', 'app_model_delete', 'Eliminar Modelos', 't', '1');
INSERT INTO "public"."menus" VALUES ('48', 'Listar Usuarios', '', '16', 'app_user_list', 'Listar Usuarios', 't', '1');
INSERT INTO "public"."menus" VALUES ('49', 'Crear Nuevos Usuarios', '', '16', 'app_user_add', 'Crear Nuevos Usuarios', 't', '1');
INSERT INTO "public"."menus" VALUES ('50', 'Editar Usuarios', '', '16', 'app_user_update', 'Editar Usuarios', 't', '1');
INSERT INTO "public"."menus" VALUES ('51', 'Eliminar Usuarios', '', '16', 'app_user_delete', 'Eliminar Usuarios', 't', '1');
INSERT INTO "public"."menus" VALUES ('52', 'Listar Roles', '', '17', 'app_profile_list', 'Listar Roles', 't', '1');
INSERT INTO "public"."menus" VALUES ('53', 'Crear Nuevos Roles', '', '17', 'app_profile_add', 'Crear Nuevos Roles', 't', '1');
INSERT INTO "public"."menus" VALUES ('54', 'Editar Roles', '', '17', 'app_profile_update', 'Editar Roles', 't', '1');
INSERT INTO "public"."menus" VALUES ('55', 'Eliminar Roles', '', '17', 'app_profile_delete', 'Eliminar Roles', 't', '1');
INSERT INTO "public"."menus" VALUES ('56', 'Listar Dispositivos de Suscriptores', '', '2', 'app_subscriber_listdevices', 'Listar Dispositivos de Suscriptores', 't', '1');

-- ----------------------------
-- Table structure for "public"."models"
-- ----------------------------
DROP TABLE "public"."models";
CREATE TABLE "public"."models" (
"id" int4 DEFAULT nextval('models_id_seq'::regclass) NOT NULL,
"name" varchar(2044) NOT NULL,
"equation" varchar(2044) NOT NULL,
"brands_id" int4 NOT NULL,
"is_deleted" bool DEFAULT false NOT NULL
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of models
-- ----------------------------
INSERT INTO "public"."models" VALUES ('1', 'HG8245Q2', 'MAC+1', '1', 'f');
INSERT INTO "public"."models" VALUES ('2', 'Generico', 'MAC+5', '2', 'f');
INSERT INTO "public"."models" VALUES ('3', 'HG8245H', 'MAC+1', '1', 'f');

-- ----------------------------
-- Table structure for "public"."plans"
-- ----------------------------
DROP TABLE "public"."plans";
CREATE TABLE "public"."plans" (
"id" int4 DEFAULT nextval('plans_id_seq'::regclass) NOT NULL,
"code" varchar(50) NOT NULL,
"name" varchar(200) NOT NULL,
"description" text,
"valid_since" int8 NOT NULL,
"valid_to" int8 NOT NULL,
"duration" int8 NOT NULL,
"allow_recharges" char(1) DEFAULT '0'::bpchar NOT NULL,
"speed_up" int4 NOT NULL,
"speed_down" int4 NOT NULL,
"download_limits_id" int4 NOT NULL,
"is_deleted" bool DEFAULT false NOT NULL,
"duration_type" varchar(20)
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of plans
-- ----------------------------
INSERT INTO "public"."plans" VALUES ('1', '20Mbps_Mes_Antes', '20Mbps_Mes_Anticipado', '20Mbps_Mes_Anticipado', '1529686800000', '1624381200000', '1', '1', '1', '2', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('2', 'Plan02', 'Plan dia del nino', 'Plan dia del nino', '1529946000000', '1530378000000', '1', '1', '2', '3', '3', 't', 'HOUR');
INSERT INTO "public"."plans" VALUES ('3', 'Plan02', 'Plan dia del nino', 'Plan dia del nino', '1529946000000', '1530378000000', '24', '1', '3', '6', '4', 't', 'HOUR');
INSERT INTO "public"."plans" VALUES ('4', 'Plan03', 'Plan del nino', 'Plan del nino', '1529946000000', '1530378000000', '24', '1', '3', '6', '1', 't', 'HOUR');
INSERT INTO "public"."plans" VALUES ('5', 'Plan04', 'Notificaciones', 'Notificaciones', '1529946000000', '1530378000000', '24', '1', '3', '4', '4', 't', 'HOUR');
INSERT INTO "public"."plans" VALUES ('6', 'dsd23ds', 'dadasdasd', null, '1529488228715', '1529488228718', '2', '1', '1', '1', '1', 't', 'MONTH');
INSERT INTO "public"."plans" VALUES ('7', '1234', 'dadasdasd', null, '1529488228715', '1529488228718', '2', '1', '1', '1', '1', 't', 'MONTH');
INSERT INTO "public"."plans" VALUES ('8', '10Mbps_Mes_Antes', '10Mbps_Mes_Anticipado', '10Mbps_Mes_Anticipado', '1529686800000', '1624381200000', '1', '1', '9', '1', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('9', '50Mbps_Mes_Antes', '50Mbps_Mes_Anticipado', '50Mbps_Mes_Anticipado', '1529686800000', '1624381200000', '1', '1', '10', '4', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('10', '100Mbps_Mes_Antes', '100Mbps_Mes_Anticipado', '100Mbps_Mes_Anticipado', '1529686800000', '1750568400000', '1', '1', '4', '5', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('11', '200Mbps_Mes_Antes', '200Mbps_Mes_Anticipado', '200Mbps_Mes_Anticipado', '1529686800000', '1624381200000', '1', '1', '5', '7', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('12', '300Mbps_Mes_Antes', '300Mbps_Mes_Anticipado', '300Mbps_Mes_Anticipado', '1529686800000', '1624381200000', '1', '1', '11', '8', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('13', '10Mbps_Mes_Finan', '10Mbps_Mes_Financiado', '10Mbps_Mes_Financiado', '1529686800000', '1624381200000', '1', '1', '9', '1', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('14', '20Mbps_Mes_Finan', '20Mbps_Mes_Financiado', '20Mbps_Mes_Financiado', '1529686800000', '1624381200000', '1', '1', '1', '2', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('15', '50Mbps_Mes_Finan', '50Mbps_Mes_Financiado', '50Mbps_Mes_Financiado', '1529686800000', '1624381200000', '1', '1', '10', '4', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('16', '100Mbps_Mes_Finan', '100Mbps_Mes_Financiado', '100Mbps_Mes_Financiado', '1529686800000', '1624381200000', '1', '1', '4', '5', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('17', '200Mbps_Mes_Finan', '200Mbps_Mes_Financiado', '200Mbps_Mes_Financiado', '1529686800000', '1624381200000', '1', '1', '5', '7', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('18', '300Mbps_Mes_Finan', '300Mbps_Mes_Financiado', '300Mbps_Mes_Financiado', '1529686800000', '1624381200000', '1', '1', '11', '8', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('19', '10mbps_Trimes', '10Mbps_Trimestral', '10Mbps_Trimestral', '1529686800000', '1624381200000', '3', '1', '9', '1', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('20', '20Mbps_Trimes', '20Mbps_Trimestral', '20Mbps_Trimestral', '1529686800000', '1624381200000', '3', '1', '1', '2', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('21', '50Mbps_Trimes', '50Mbps_Trimestral', '50Mbps_Trimes', '1529686800000', '1624381200000', '3', '1', '10', '4', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('22', '100Mbps_Trimes', '100Mbps_Trimestral', '100Mbps_Trimestral', '1529686800000', '1624381200000', '3', '1', '4', '5', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('23', '200Mbps_Trimes', '200Mbps_Trimestral', '200Mbps_Trimestral', '1529686800000', '1624381200000', '3', '1', '5', '7', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('24', '300Mbps_Trimes', '300Mbps_Trimestral', '300Mbps_Trimestral', '1529686800000', '1624381200000', '3', '1', '11', '8', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('25', '10Mbps_Semes', '10Mbps_Semestral', '10Mbps_Semestral', '1529686800000', '1624381200000', '6', '1', '9', '1', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('26', '20Mbps_Semes', '20Mbps_Semestral', '20Mbps_Semestral', '1529686800000', '1624381200000', '6', '1', '1', '2', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('27', '50Mbps_Semes', '50Mbps_Semestral', '50Mbps_Semestral', '1529686800000', '1624381200000', '6', '1', '10', '4', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('28', '100Mbps_Semes', '100Mbps_Semestral', '100Mbps_Semestral', '1529686800000', '1624381200000', '6', '1', '4', '5', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('29', '200Mbps_Semes', '200Mbps_Semestral', '200Mbps_Semestral', '1529686800000', '1624381200000', '6', '1', '5', '7', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('30', '300Mbps_Semes', '300Mbps_Semestral', '300Mbps_Semestral', '1529686800000', '1624381200000', '6', '1', '11', '8', '6', 'f', 'MONTH');
INSERT INTO "public"."plans" VALUES ('31', '10Mbps_Anual', '10Mbps_Anual', '10Mbps_Anual', '1529686800000', '1624381200000', '1', '1', '1', '2', '6', 'f', 'YEAR');
INSERT INTO "public"."plans" VALUES ('32', '20Mbps_Anual', '20Mbps_Anual', '20Mbps_Anual', '1529686800000', '1624381200000', '1', '1', '10', '4', '6', 'f', 'YEAR');
INSERT INTO "public"."plans" VALUES ('33', '50Mbps_Anual', '50Mbps_Anual', '50Mbps_Anual', '1529686800000', '1624381200000', '1', '1', '4', '5', '6', 'f', 'YEAR');
INSERT INTO "public"."plans" VALUES ('34', '100Mbps_Anual', '100Mbps_Anual', '100Mbps_Anual', '1529686800000', '1624381200000', '1', '1', '5', '7', '6', 'f', 'YEAR');
INSERT INTO "public"."plans" VALUES ('35', '200Mbps_Anual', '200Mbps_Anual', '200Mbps_Anual', '1529686800000', '1624381200000', '1', '1', '11', '8', '6', 'f', 'YEAR');
INSERT INTO "public"."plans" VALUES ('36', '300Mbps_Anual', '300Mbps_Anual', '300Mbps_Anual', '1529686800000', '1624381200000', '1', '1', '11', '8', '6', 'f', 'YEAR');
INSERT INTO "public"."plans" VALUES ('37', 'test1', 'test1', 'test1', '1530032400000', '1530378000000', '3600', '1', '1', '1', '1', 't', 'HOUR');
INSERT INTO "public"."plans" VALUES ('38', '123CCS', '123CCS', 'PRUEBASDEPLANES123CCS', '1530464400000', '1546275600000', '6', '1', '1', '2', '6', 't', 'MONTH');
INSERT INTO "public"."plans" VALUES ('39', '100Mbps_Anual', '100Mbps_Anual', null, '1529686800000', '1624381200000', '1', '1', '5', '7', '6', 'f', 'YEAR');

-- ----------------------------
-- Table structure for "public"."plans_to_filters"
-- ----------------------------
DROP TABLE "public"."plans_to_filters";
CREATE TABLE "public"."plans_to_filters" (
"plans_id" int4 NOT NULL,
"filters_id" int4 NOT NULL,
"id" int4 DEFAULT nextval('plans_to_filters_id_seq'::regclass) NOT NULL
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of plans_to_filters
-- ----------------------------
INSERT INTO "public"."plans_to_filters" VALUES ('2', '4', '3');
INSERT INTO "public"."plans_to_filters" VALUES ('2', '3', '4');
INSERT INTO "public"."plans_to_filters" VALUES ('2', '2', '5');
INSERT INTO "public"."plans_to_filters" VALUES ('2', '1', '6');
INSERT INTO "public"."plans_to_filters" VALUES ('31', '0', '7');
INSERT INTO "public"."plans_to_filters" VALUES ('1', '0', '8');
INSERT INTO "public"."plans_to_filters" VALUES ('8', '0', '9');
INSERT INTO "public"."plans_to_filters" VALUES ('9', '0', '10');
INSERT INTO "public"."plans_to_filters" VALUES ('10', '0', '11');
INSERT INTO "public"."plans_to_filters" VALUES ('11', '0', '12');
INSERT INTO "public"."plans_to_filters" VALUES ('12', '0', '13');
INSERT INTO "public"."plans_to_filters" VALUES ('13', '0', '14');
INSERT INTO "public"."plans_to_filters" VALUES ('14', '0', '15');
INSERT INTO "public"."plans_to_filters" VALUES ('15', '0', '16');
INSERT INTO "public"."plans_to_filters" VALUES ('16', '0', '17');
INSERT INTO "public"."plans_to_filters" VALUES ('17', '0', '18');
INSERT INTO "public"."plans_to_filters" VALUES ('18', '0', '19');
INSERT INTO "public"."plans_to_filters" VALUES ('19', '0', '20');
INSERT INTO "public"."plans_to_filters" VALUES ('20', '0', '21');
INSERT INTO "public"."plans_to_filters" VALUES ('21', '0', '22');
INSERT INTO "public"."plans_to_filters" VALUES ('22', '0', '23');
INSERT INTO "public"."plans_to_filters" VALUES ('23', '0', '24');
INSERT INTO "public"."plans_to_filters" VALUES ('24', '0', '25');
INSERT INTO "public"."plans_to_filters" VALUES ('25', '0', '26');
INSERT INTO "public"."plans_to_filters" VALUES ('26', '0', '27');
INSERT INTO "public"."plans_to_filters" VALUES ('27', '0', '28');
INSERT INTO "public"."plans_to_filters" VALUES ('28', '0', '29');
INSERT INTO "public"."plans_to_filters" VALUES ('29', '0', '30');
INSERT INTO "public"."plans_to_filters" VALUES ('30', '0', '31');
INSERT INTO "public"."plans_to_filters" VALUES ('32', '0', '32');
INSERT INTO "public"."plans_to_filters" VALUES ('33', '0', '33');
INSERT INTO "public"."plans_to_filters" VALUES ('34', '0', '34');
INSERT INTO "public"."plans_to_filters" VALUES ('35', '0', '35');
INSERT INTO "public"."plans_to_filters" VALUES ('36', '4', '37');
INSERT INTO "public"."plans_to_filters" VALUES ('36', '3', '38');
INSERT INTO "public"."plans_to_filters" VALUES ('36', '2', '39');
INSERT INTO "public"."plans_to_filters" VALUES ('36', '1', '40');
INSERT INTO "public"."plans_to_filters" VALUES ('39', '0', '46');

-- ----------------------------
-- Table structure for "public"."profiles"
-- ----------------------------
DROP TABLE "public"."profiles";
CREATE TABLE "public"."profiles" (
"id" int4 DEFAULT nextval('profiles_id_seq'::regclass) NOT NULL,
"name" varchar(2044) NOT NULL,
"description" text
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of profiles
-- ----------------------------
INSERT INTO "public"."profiles" VALUES ('1', 'ROLE_ADMIN', 'Usuario Administrador del Sistema');
INSERT INTO "public"."profiles" VALUES ('2', 'ROLE_OPERARIO', 'El Operario del Sistema es el usuario que gestionara toda la información referente al almacen de dispositivos.');
INSERT INTO "public"."profiles" VALUES ('3', 'ROLE_VISOR', 'Visualiza la Información del sistema');
INSERT INTO "public"."profiles" VALUES ('4', 'ROLE_API', 'ACCESSO AL API');
INSERT INTO "public"."profiles" VALUES ('12', 'test', 'test');

-- ----------------------------
-- Table structure for "public"."profiles_to_menus"
-- ----------------------------
DROP TABLE "public"."profiles_to_menus";
CREATE TABLE "public"."profiles_to_menus" (
"profiles_id" int4 NOT NULL,
"menus_id" int4 NOT NULL,
"id" int4 DEFAULT nextval('profiles_to_menus_id_seq'::regclass) NOT NULL
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of profiles_to_menus
-- ----------------------------
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '1', '182');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '5', '183');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '6', '184');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '7', '185');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '4', '186');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '24', '187');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '25', '188');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '2', '189');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '8', '190');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '9', '191');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '18', '192');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '19', '193');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '22', '194');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '23', '195');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '20', '196');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '21', '197');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '56', '198');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '3', '199');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '26', '200');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '27', '201');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '28', '202');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '29', '203');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '30', '204');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '31', '205');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '10', '206');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '32', '207');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '33', '208');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '13', '209');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '38', '210');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '39', '211');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '11', '212');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '34', '213');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '35', '214');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '12', '215');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '36', '216');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '37', '217');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '14', '218');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '40', '219');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '41', '220');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '42', '221');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '43', '222');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '15', '223');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '44', '224');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '45', '225');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '46', '226');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '47', '227');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '16', '228');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '48', '229');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '49', '230');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '50', '231');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '51', '232');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '17', '233');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '52', '234');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '53', '235');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '54', '236');
INSERT INTO "public"."profiles_to_menus" VALUES ('1', '55', '237');
INSERT INTO "public"."profiles_to_menus" VALUES ('2', '1', '337');
INSERT INTO "public"."profiles_to_menus" VALUES ('2', '6', '338');
INSERT INTO "public"."profiles_to_menus" VALUES ('2', '4', '339');
INSERT INTO "public"."profiles_to_menus" VALUES ('2', '2', '340');
INSERT INTO "public"."profiles_to_menus" VALUES ('2', '8', '341');
INSERT INTO "public"."profiles_to_menus" VALUES ('2', '9', '342');
INSERT INTO "public"."profiles_to_menus" VALUES ('3', '1', '343');
INSERT INTO "public"."profiles_to_menus" VALUES ('3', '6', '344');
INSERT INTO "public"."profiles_to_menus" VALUES ('3', '4', '345');
INSERT INTO "public"."profiles_to_menus" VALUES ('3', '2', '346');
INSERT INTO "public"."profiles_to_menus" VALUES ('3', '8', '347');
INSERT INTO "public"."profiles_to_menus" VALUES ('3', '22', '348');
INSERT INTO "public"."profiles_to_menus" VALUES ('3', '56', '349');
INSERT INTO "public"."profiles_to_menus" VALUES ('3', '3', '350');
INSERT INTO "public"."profiles_to_menus" VALUES ('3', '26', '351');
INSERT INTO "public"."profiles_to_menus" VALUES ('3', '30', '352');
INSERT INTO "public"."profiles_to_menus" VALUES ('3', '10', '353');
INSERT INTO "public"."profiles_to_menus" VALUES ('3', '40', '354');
INSERT INTO "public"."profiles_to_menus" VALUES ('3', '44', '355');
INSERT INTO "public"."profiles_to_menus" VALUES ('3', '48', '356');
INSERT INTO "public"."profiles_to_menus" VALUES ('12', '1', '360');
INSERT INTO "public"."profiles_to_menus" VALUES ('12', '6', '361');
INSERT INTO "public"."profiles_to_menus" VALUES ('12', '4', '362');

-- ----------------------------
-- Table structure for "public"."recharges"
-- ----------------------------
DROP TABLE "public"."recharges";
CREATE TABLE "public"."recharges" (
"id" int4 DEFAULT nextval('recharges_id_seq'::regclass) NOT NULL,
"start_date" int8 NOT NULL,
"start_hour" char(5) DEFAULT '00:00'::bpchar NOT NULL,
"end_date" int8 NOT NULL,
"end_hour" char(5) DEFAULT '00:00'::bpchar NOT NULL,
"is_finished" char(1) DEFAULT '0'::bpchar NOT NULL,
"plans_id" int4 NOT NULL,
"subscribers_id" varchar(20) NOT NULL,
"devices_id" int4,
"created_at" timestamp(6)
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of recharges
-- ----------------------------
INSERT INTO "public"."recharges" VALUES ('1', '1529902800000', '00:00', '1542862800000', '00:00', '0', '1', '123456789', '1', null);
INSERT INTO "public"."recharges" VALUES ('2', '1529902800000', '16:00', '1529989200000', '16:00', '0', '5', '123456789', '1', null);
INSERT INTO "public"."recharges" VALUES ('3', '1530075600000', '00:00', '1543035600000', '00:00', '0', '1', '123456789', '1', null);
INSERT INTO "public"."recharges" VALUES ('4', '1529643600000', '00:00', '1529643600000', '03:00', '0', '1', '123456789', '1', null);
INSERT INTO "public"."recharges" VALUES ('5', '1529643600000', '00:00', '1532235600000', '00:00', '0', '8', '123456789', '1', null);
INSERT INTO "public"."recharges" VALUES ('6', '1529902800000', '10:00', '1532494800000', '10:00', '0', '8', '123456789', '1', null);
INSERT INTO "public"."recharges" VALUES ('7', '1529902800000', '12:00', '1532494800000', '12:00', '0', '12', '123456', '5', null);
INSERT INTO "public"."recharges" VALUES ('8', '1529730000000', '00:00', '1561266000000', '00:00', '0', '8', '43433845', '4', null);
INSERT INTO "public"."recharges" VALUES ('10', '1530334800000', '10:00', '1532926800000', '10:00', '0', '9', '123456789', '1', null);
INSERT INTO "public"."recharges" VALUES ('11', '1530334800000', '00:00', '1532926800000', '00:00', '0', '9', '123456', '5', null);
INSERT INTO "public"."recharges" VALUES ('12', '1530421200000', '10:30', '1533099600000', '10:30', '0', '10', '123456', '5', null);
INSERT INTO "public"."recharges" VALUES ('13', '1530421200000', '10:00', '1533099600000', '10:00', '0', '9', '123456789', '1', null);
INSERT INTO "public"."recharges" VALUES ('14', '1531630800000', '08:00', '1534309200000', '08:00', '0', '9', '654987321', '6', null);
INSERT INTO "public"."recharges" VALUES ('15', '1533013200000', '09:00', '1535691600000', '09:00', '0', '1', '654987321', '6', null);
INSERT INTO "public"."recharges" VALUES ('16', '1530421200000', '10:00', '1533013200000', '10:00', '0', '8', '135792468', '9', '2018-06-27 10:46:12');
INSERT INTO "public"."recharges" VALUES ('17', '1531630800000', '11:00', '1534222800000', '11:00', '0', '8', '135792468', '9', '2018-06-27 11:00:44');
INSERT INTO "public"."recharges" VALUES ('18', '1533013200000', '18:00', '1540875600000', '18:00', '0', '21', '135792468', '9', '2018-06-27 11:02:26');
INSERT INTO "public"."recharges" VALUES ('19', '1531630800000', '09:00', '1563166800000', '09:00', '0', '36', '246813579', '10', '2018-06-27 11:26:32');
INSERT INTO "public"."recharges" VALUES ('20', '1530421200000', '09:00', '1533013200000', '09:00', '0', '8', '135792468', '16', '2018-06-27 15:47:23');
INSERT INTO "public"."recharges" VALUES ('21', '1530421200000', '09:00', '1533013200000', '09:00', '1', '8', '1234567890', '18', '2018-06-27 15:57:37');
INSERT INTO "public"."recharges" VALUES ('22', '1533013200000', '10:00', '1535605200000', '10:00', '1', '1', '1234567890', '18', '2018-06-27 15:59:00');
INSERT INTO "public"."recharges" VALUES ('23', '1535605200000', '18:00', '1543467600000', '18:00', '0', '22', '1234567890', '18', '2018-06-27 15:59:48');
INSERT INTO "public"."recharges" VALUES ('24', '1530421200000', '10:00', '1538283600000', '10:00', '1', '21', '987654321', '19', '2018-06-28 12:58:15');
INSERT INTO "public"."recharges" VALUES ('25', '1538283600000', '10:00', '1546059600000', '10:00', '0', '22', '987654321', '19', '2018-06-28 12:59:04');
INSERT INTO "public"."recharges" VALUES ('26', '1530421200000', '00:00', '1561957200000', '00:00', '0', '39', '19660068', '20', '2018-06-28 15:56:46');
INSERT INTO "public"."recharges" VALUES ('27', '1533099600000', '06:00', '1535691600000', '06:00', '1', '12', '12345', '21', '2018-07-03 12:16:58');
INSERT INTO "public"."recharges" VALUES ('28', '1535691600000', '07:00', '1538283600000', '07:00', '0', '9', '12345', '21', '2018-07-03 12:19:03');

-- ----------------------------
-- Table structure for "public"."speeds"
-- ----------------------------
DROP TABLE "public"."speeds";
CREATE TABLE "public"."speeds" (
"id" int4 DEFAULT nextval('speeds_id_seq'::regclass) NOT NULL,
"code" char(4) NOT NULL,
"value" int4 NOT NULL,
"is_active" char(1) DEFAULT '0'::bpchar NOT NULL
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of speeds
-- ----------------------------
INSERT INTO "public"."speeds" VALUES ('1', 'Mbps', '10', '1');
INSERT INTO "public"."speeds" VALUES ('2', 'Mbps', '20', '1');
INSERT INTO "public"."speeds" VALUES ('3', 'Mbps', '30', '0');
INSERT INTO "public"."speeds" VALUES ('4', 'Mbps', '50', '1');
INSERT INTO "public"."speeds" VALUES ('5', 'Mbps', '100', '1');
INSERT INTO "public"."speeds" VALUES ('6', 'Mbps', '1000', '0');
INSERT INTO "public"."speeds" VALUES ('7', 'Mbps', '200', '1');
INSERT INTO "public"."speeds" VALUES ('8', 'Mbps', '300', '1');
INSERT INTO "public"."speeds" VALUES ('9', 'Mbps', '5', '1');
INSERT INTO "public"."speeds" VALUES ('10', 'Mbps', '25', '1');
INSERT INTO "public"."speeds" VALUES ('11', 'Mbps', '150', '1');

-- ----------------------------
-- Table structure for "public"."subscribers"
-- ----------------------------
DROP TABLE "public"."subscribers";
CREATE TABLE "public"."subscribers" (
"first_name" varchar(200),
"last_name" varchar(200),
"phone" varchar(50),
"email" varchar(100),
"type_ciu" varchar(10),
"ciu" varchar(20) NOT NULL,
"is_deleted" bool DEFAULT false NOT NULL,
"account_types_id" int4 NOT NULL
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of subscribers
-- ----------------------------
INSERT INTO "public"."subscribers" VALUES (null, null, null, null, 'RUC', '111222333', 't', '1');
INSERT INTO "public"."subscribers" VALUES (null, null, null, null, 'RUC', '123', 't', '1');
INSERT INTO "public"."subscribers" VALUES (null, null, null, null, 'RUC', '1234', 't', '1');
INSERT INTO "public"."subscribers" VALUES ('Angel', 'Perez', '891765234', 'aperez@pe.pe', 'DNI', '12345', 't', '1');
INSERT INTO "public"."subscribers" VALUES ('Juan', 'Meza', '123654987', 'jmeza@pe.pe', 'RUC', '123456', 't', '1');
INSERT INTO "public"."subscribers" VALUES (null, null, null, null, 'RUC', '1234567', 't', '1');
INSERT INTO "public"."subscribers" VALUES (null, null, null, null, 'RUC', '123456700', 't', '1');
INSERT INTO "public"."subscribers" VALUES ('Julio', 'Yanez', '112233', 'jya@pe.pe', 'RUC', '12345678', 't', '1');
INSERT INTO "public"."subscribers" VALUES (null, null, null, null, 'RUC', '123456780', 't', '1');
INSERT INTO "public"."subscribers" VALUES ('Carlos David', 'Moron Vegas', '111222333', 'cmoron@pe.pe', 'RUC', '123456789', 't', '1');
INSERT INTO "public"."subscribers" VALUES ('Raul', 'Sierra', '123456789', 'rsierra@pe.pe', 'CARNET', '1234567890', 'f', '1');
INSERT INTO "public"."subscribers" VALUES (null, null, null, null, 'DNI', '123546789', 't', '1');
INSERT INTO "public"."subscribers" VALUES ('Eduard', 'Colmenares', '584732159', 'rcolme@pe.pe', 'RUC', '135792468', 't', '1');
INSERT INTO "public"."subscribers" VALUES ('Juan', 'Avila', '12345', 'esd4556@gfsrt.co', 'DNI', '19660068', 'f', '1');
INSERT INTO "public"."subscribers" VALUES ('Ramon', 'Barboza', '951357741', 'rbarboza@pe.ve', 'RUC', '246813579', 't', '2');
INSERT INTO "public"."subscribers" VALUES (null, null, null, null, 'DNI', '43433845', 't', '1');
INSERT INTO "public"."subscribers" VALUES ('Ruben Carlos', 'Villegas', '321654987', 'rubven@pe.ve', 'DNI', '654987321', 't', '1');
INSERT INTO "public"."subscribers" VALUES ('Jorge', 'Peralta', '321654987', 'jperalta@pe.pe', 'CARNET', '987654321', 'f', '2');

-- ----------------------------
-- Table structure for "public"."users"
-- ----------------------------
DROP TABLE "public"."users";
CREATE TABLE "public"."users" (
"id" int4 DEFAULT nextval('users_id_seq'::regclass) NOT NULL,
"username" varchar(200) NOT NULL,
"password" varchar(200) NOT NULL,
"api_key" varchar(200)
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of users
-- ----------------------------
INSERT INTO "public"."users" VALUES ('1', 'orange', '$2y$13$cIM2euMeGIITWvUpDn.doO3vcPnLM7H5RbDa3qzKQBq.IKNgT.AmO', 'fb631bae49038d55cb0e89b7dfe0e616');
INSERT INTO "public"."users" VALUES ('4', 'usuario', '$2y$13$vAz/z22JvUOolzDopCzagO3P.wkUaDiIxWkFX3rg7wN57Yaw4QGRu', null);
INSERT INTO "public"."users" VALUES ('8', 'operador', '$2y$13$d0N76OR9c6sMvGGd2jfzBOILv2ofNe8XgmXP4aRDlsUpYGX.ceiAe', null);
INSERT INTO "public"."users" VALUES ('9', 'rvillegas', '$2y$13$iSmg5CuZkeGPUZLZzZVRXOQW4/E7jfhnkJhYOXPeYGFkOVLuGYXJW', 'a70c934f4a37dac7a059f5c74f7c6099');

-- ----------------------------
-- Table structure for "public"."users_to_profiles"
-- ----------------------------
DROP TABLE "public"."users_to_profiles";
CREATE TABLE "public"."users_to_profiles" (
"users_id" int4 NOT NULL,
"profiles_id" int4 NOT NULL,
"id" int4 DEFAULT nextval('users_to_profiles_id_seq'::regclass) NOT NULL
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of users_to_profiles
-- ----------------------------
INSERT INTO "public"."users_to_profiles" VALUES ('1', '1', '6');
INSERT INTO "public"."users_to_profiles" VALUES ('1', '4', '23');
INSERT INTO "public"."users_to_profiles" VALUES ('8', '2', '34');
INSERT INTO "public"."users_to_profiles" VALUES ('8', '4', '35');
INSERT INTO "public"."users_to_profiles" VALUES ('4', '3', '36');
INSERT INTO "public"."users_to_profiles" VALUES ('4', '4', '37');
INSERT INTO "public"."users_to_profiles" VALUES ('9', '4', '55');
INSERT INTO "public"."users_to_profiles" VALUES ('9', '12', '56');

-- ----------------------------
-- Alter Sequences Owned By 
-- ----------------------------
ALTER SEQUENCE "public"."account_types_id_seq" OWNED BY "account_types"."id";
ALTER SEQUENCE "public"."brands_id_seq" OWNED BY "brands"."id";
ALTER SEQUENCE "public"."campaigns_id_seq" OWNED BY "campaigns"."id";
ALTER SEQUENCE "public"."campaigns_to_plans_id_seq" OWNED BY "campaigns_to_plans"."id";
ALTER SEQUENCE "public"."combinations_id_seq" OWNED BY "combinations"."id";
ALTER SEQUENCE "public"."devices_id_seq" OWNED BY "devices"."id";
ALTER SEQUENCE "public"."download_limits_id_seq" OWNED BY "download_limits"."id";
ALTER SEQUENCE "public"."filter_types_id_seq" OWNED BY "filter_types"."id";
ALTER SEQUENCE "public"."filters_id_seq" OWNED BY "filters"."id";
ALTER SEQUENCE "public"."menus_id_seq" OWNED BY "menus"."id";
ALTER SEQUENCE "public"."models_id_seq" OWNED BY "models"."id";
ALTER SEQUENCE "public"."plans_id_seq" OWNED BY "plans"."id";
ALTER SEQUENCE "public"."plans_to_filters_id_seq" OWNED BY "plans_to_filters"."id";
ALTER SEQUENCE "public"."profiles_id_seq" OWNED BY "profiles"."id";
ALTER SEQUENCE "public"."profiles_to_menus_id_seq" OWNED BY "profiles_to_menus"."id";
ALTER SEQUENCE "public"."recharges_id_seq" OWNED BY "recharges"."id";
ALTER SEQUENCE "public"."speeds_id_seq" OWNED BY "speeds"."id";
ALTER SEQUENCE "public"."users_id_seq" OWNED BY "users"."id";
ALTER SEQUENCE "public"."users_to_profiles_id_seq" OWNED BY "users_to_profiles"."id";

-- ----------------------------
-- Primary Key structure for table "public"."account_types"
-- ----------------------------
ALTER TABLE "public"."account_types" ADD PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table "public"."brands"
-- ----------------------------
ALTER TABLE "public"."brands" ADD PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table "public"."campaigns"
-- ----------------------------
ALTER TABLE "public"."campaigns" ADD PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table "public"."campaigns_to_plans"
-- ----------------------------
ALTER TABLE "public"."campaigns_to_plans" ADD PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table "public"."combinations"
-- ----------------------------
ALTER TABLE "public"."combinations" ADD PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table devices
-- ----------------------------
CREATE INDEX "index_models_id" ON "public"."devices" USING btree ("models_id");
CREATE INDEX "index_subscribers_id" ON "public"."devices" USING btree ("subscribers_id");

-- ----------------------------
-- Primary Key structure for table "public"."devices"
-- ----------------------------
ALTER TABLE "public"."devices" ADD PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table "public"."download_limits"
-- ----------------------------
ALTER TABLE "public"."download_limits" ADD PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table "public"."filter_types"
-- ----------------------------
ALTER TABLE "public"."filter_types" ADD PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table "public"."filters"
-- ----------------------------
ALTER TABLE "public"."filters" ADD PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table "public"."menus"
-- ----------------------------
ALTER TABLE "public"."menus" ADD PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table models
-- ----------------------------
CREATE INDEX "index_brands_id" ON "public"."models" USING btree ("brands_id");

-- ----------------------------
-- Primary Key structure for table "public"."models"
-- ----------------------------
ALTER TABLE "public"."models" ADD PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table "public"."plans"
-- ----------------------------
ALTER TABLE "public"."plans" ADD PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table "public"."plans_to_filters"
-- ----------------------------
ALTER TABLE "public"."plans_to_filters" ADD PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table "public"."profiles"
-- ----------------------------
ALTER TABLE "public"."profiles" ADD PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table "public"."profiles_to_menus"
-- ----------------------------
ALTER TABLE "public"."profiles_to_menus" ADD PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table recharges
-- ----------------------------
CREATE INDEX "index_devices_id" ON "public"."recharges" USING btree ("devices_id");
CREATE INDEX "index_subscribers_id1" ON "public"."recharges" USING btree ("subscribers_id");

-- ----------------------------
-- Primary Key structure for table "public"."recharges"
-- ----------------------------
ALTER TABLE "public"."recharges" ADD PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table "public"."speeds"
-- ----------------------------
ALTER TABLE "public"."speeds" ADD PRIMARY KEY ("id");

-- ----------------------------
-- Indexes structure for table subscribers
-- ----------------------------
CREATE INDEX "index_account_types_id" ON "public"."subscribers" USING btree ("account_types_id");

-- ----------------------------
-- Primary Key structure for table "public"."subscribers"
-- ----------------------------
ALTER TABLE "public"."subscribers" ADD PRIMARY KEY ("ciu");

-- ----------------------------
-- Primary Key structure for table "public"."users"
-- ----------------------------
ALTER TABLE "public"."users" ADD PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table "public"."users_to_profiles"
-- ----------------------------
ALTER TABLE "public"."users_to_profiles" ADD PRIMARY KEY ("id");

-- ----------------------------
-- Foreign Key structure for table "public"."campaigns_to_plans"
-- ----------------------------
ALTER TABLE "public"."campaigns_to_plans" ADD FOREIGN KEY ("plans_id") REFERENCES "public"."plans" ("id") ON DELETE NO ACTION ON UPDATE CASCADE;
ALTER TABLE "public"."campaigns_to_plans" ADD FOREIGN KEY ("campaigns_id") REFERENCES "public"."campaigns" ("id") ON DELETE NO ACTION ON UPDATE CASCADE;

-- ----------------------------
-- Foreign Key structure for table "public"."combinations"
-- ----------------------------
ALTER TABLE "public"."combinations" ADD FOREIGN KEY ("filter_types_id") REFERENCES "public"."filter_types" ("id") ON DELETE NO ACTION ON UPDATE CASCADE;
ALTER TABLE "public"."combinations" ADD FOREIGN KEY ("filters_id") REFERENCES "public"."filters" ("id") ON DELETE NO ACTION ON UPDATE CASCADE;

-- ----------------------------
-- Foreign Key structure for table "public"."devices"
-- ----------------------------
ALTER TABLE "public"."devices" ADD FOREIGN KEY ("subscribers_id") REFERENCES "public"."subscribers" ("ciu") ON DELETE NO ACTION ON UPDATE CASCADE;
ALTER TABLE "public"."devices" ADD FOREIGN KEY ("models_id") REFERENCES "public"."models" ("id") ON DELETE NO ACTION ON UPDATE CASCADE;

-- ----------------------------
-- Foreign Key structure for table "public"."menus"
-- ----------------------------
ALTER TABLE "public"."menus" ADD FOREIGN KEY ("menus_id") REFERENCES "public"."menus" ("id") ON DELETE NO ACTION ON UPDATE CASCADE;

-- ----------------------------
-- Foreign Key structure for table "public"."models"
-- ----------------------------
ALTER TABLE "public"."models" ADD FOREIGN KEY ("brands_id") REFERENCES "public"."brands" ("id") ON DELETE NO ACTION ON UPDATE CASCADE;

-- ----------------------------
-- Foreign Key structure for table "public"."plans"
-- ----------------------------
ALTER TABLE "public"."plans" ADD FOREIGN KEY ("download_limits_id") REFERENCES "public"."download_limits" ("id") ON DELETE NO ACTION ON UPDATE CASCADE;
ALTER TABLE "public"."plans" ADD FOREIGN KEY ("speed_up") REFERENCES "public"."speeds" ("id") ON DELETE NO ACTION ON UPDATE CASCADE;
ALTER TABLE "public"."plans" ADD FOREIGN KEY ("speed_down") REFERENCES "public"."speeds" ("id") ON DELETE NO ACTION ON UPDATE CASCADE;

-- ----------------------------
-- Foreign Key structure for table "public"."plans_to_filters"
-- ----------------------------
ALTER TABLE "public"."plans_to_filters" ADD FOREIGN KEY ("plans_id") REFERENCES "public"."plans" ("id") ON DELETE NO ACTION ON UPDATE CASCADE;
ALTER TABLE "public"."plans_to_filters" ADD FOREIGN KEY ("filters_id") REFERENCES "public"."filters" ("id") ON DELETE NO ACTION ON UPDATE CASCADE;

-- ----------------------------
-- Foreign Key structure for table "public"."profiles_to_menus"
-- ----------------------------
ALTER TABLE "public"."profiles_to_menus" ADD FOREIGN KEY ("profiles_id") REFERENCES "public"."profiles" ("id") ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE "public"."profiles_to_menus" ADD FOREIGN KEY ("menus_id") REFERENCES "public"."menus" ("id") ON DELETE NO ACTION ON UPDATE CASCADE;

-- ----------------------------
-- Foreign Key structure for table "public"."recharges"
-- ----------------------------
ALTER TABLE "public"."recharges" ADD FOREIGN KEY ("plans_id") REFERENCES "public"."plans" ("id") ON DELETE NO ACTION ON UPDATE CASCADE;
ALTER TABLE "public"."recharges" ADD FOREIGN KEY ("subscribers_id") REFERENCES "public"."subscribers" ("ciu") ON DELETE NO ACTION ON UPDATE CASCADE;
ALTER TABLE "public"."recharges" ADD FOREIGN KEY ("devices_id") REFERENCES "public"."devices" ("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- ----------------------------
-- Foreign Key structure for table "public"."subscribers"
-- ----------------------------
ALTER TABLE "public"."subscribers" ADD FOREIGN KEY ("account_types_id") REFERENCES "public"."account_types" ("id") ON DELETE NO ACTION ON UPDATE CASCADE;

-- ----------------------------
-- Foreign Key structure for table "public"."users_to_profiles"
-- ----------------------------
ALTER TABLE "public"."users_to_profiles" ADD FOREIGN KEY ("profiles_id") REFERENCES "public"."profiles" ("id") ON DELETE NO ACTION ON UPDATE CASCADE;
ALTER TABLE "public"."users_to_profiles" ADD FOREIGN KEY ("users_id") REFERENCES "public"."users" ("id") ON DELETE CASCADE ON UPDATE CASCADE;
