/*
Navicat PGSQL Data Transfer

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

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

Date: 2018-06-16 05:23:14
*/


-- ----------------------------
-- 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 4
 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 2
 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;


-- ----------------------------
-- 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');
INSERT INTO "public"."brands" VALUES ('3', '!"·$%&/()=?', 't');
INSERT INTO "public"."brands" VALUES ('4', 'ª!"·$%&/()=?¿_:;_', 't');



-- ----------------------------
-- 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)
)
WITH (OIDS=FALSE)

;

-- ----------------------------
-- Records of devices
-- ----------------------------
INSERT INTO "public"."devices" VALUES ('1', 'ABC23456CDEE', 'f', '123456789', '839230303', '3', '8383929', 'ABC23456CDF3');
INSERT INTO "public"."devices" VALUES ('2', 'ABC000111110', 'f', '28299517', 'ABC000111110', '2', 'ABC00011111', 'ABC000111111');


-- ----------------------------
-- 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', 'RG2804WT', '8014A8992E84 + 17', '2', 't');
INSERT INTO "public"."models" VALUES ('2', 'HG8245Q2', 'MAC+1', '1', 'f');
INSERT INTO "public"."models" VALUES ('3', 'RG2804WT', 'MAC+5', '2', 'f');



-- ----------------------------
-- Records of users_to_profiles
-- ----------------------------

-- ----------------------------
-- Alter Sequences Owned By 
-- ----------------------------
ALTER SEQUENCE "public"."brands_id_seq" OWNED BY "brands"."id";
ALTER SEQUENCE "public"."devices_id_seq" OWNED BY "devices"."id";
ALTER SEQUENCE "public"."models_id_seq" OWNED BY "models"."id";


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


-- ----------------------------
-- Primary Key structure for table "public"."devices"
-- ----------------------------
ALTER TABLE "public"."devices" 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");

