text:
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;

--
-- TOC entry 1 (class 3079 OID 12355)
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--

CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;

--
-- TOC entry 2220 (class 0 OID 0)
-- Dependencies: 1
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--

COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';

SET search_path = public, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- TOC entry 197 (class 1259 OID 16588)
-- Name: ms_area; Type: TABLE; Schema: public; Owner: msdev
--

CREATE TABLE ms_area (
    id integer NOT NULL,
    name character varying(100) NOT NULL,
    id_city smallint NOT NULL
);

ALTER TABLE ms_area OWNER TO msdev;

--
-- TOC entry 196 (class 1259 OID 16586)
-- Name: ms_area_id_seq; Type: SEQUENCE; Schema: public; Owner: msdev
--

CREATE SEQUENCE ms_area_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER TABLE ms_area_id_seq OWNER TO msdev;

--
-- TOC entry 2221 (class 0 OID 0)
-- Dependencies: 196
-- Name: ms_area_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: msdev
--

ALTER SEQUENCE ms_area_id_seq OWNED BY ms_area.id;

--
-- TOC entry 187 (class 1259 OID 16448)
-- Name: ms_city; Type: TABLE; Schema: public; Owner: msdev
--

CREATE TABLE ms_city (
    id integer NOT NULL,
    name character varying(100) NOT NULL,
    id_province smallint NOT NULL
);

ALTER TABLE ms_city OWNER TO msdev;

--
-- TOC entry 186 (class 1259 OID 16446)
-- Name: ms_city_id_seq; Type: SEQUENCE; Schema: public; Owner: msdev
--

CREATE SEQUENCE ms_city_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER TABLE ms_city_id_seq OWNER TO msdev;

--
-- TOC entry 2222 (class 0 OID 0)
-- Dependencies: 186
-- Name: ms_city_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: msdev
--

ALTER SEQUENCE ms_city_id_seq OWNED BY ms_city.id;

--
-- TOC entry 182 (class 1259 OID 16392)
-- Name: ms_customer; Type: TABLE; Schema: public; Owner: msdev
--

CREATE TABLE ms_customer (
    id integer NOT NULL,
    email character varying(100) NOT NULL,
    password_hash character varying(100) NOT NULL,
    name_first character varying(100) NOT NULL,
    name_last character varying(100) NOT NULL,
    telephone character varying(32),
    created_dtm timestamp without time zone NOT NULL,
    updated_dtm timestamp without time zone NOT NULL,
    created_by integer NOT NULL,
    updated_by integer NOT NULL,
    image_path character varying(100),
    image_type character varying(100),
    access_token character varying(256),
    status smallint
);

ALTER TABLE ms_customer OWNER TO msdev;

--
-- TOC entry 181 (class 1259 OID 16390)
-- Name: ms_customer_id_seq; Type: SEQUENCE; Schema: public; Owner: msdev
--

CREATE SEQUENCE ms_customer_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER TABLE ms_customer_id_seq OWNER TO msdev;

--
-- TOC entry 2223 (class 0 OID 0)
-- Dependencies: 181
-- Name: ms_customer_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: msdev
--

ALTER SEQUENCE ms_customer_id_seq OWNED BY ms_customer.id;

--
-- TOC entry 193 (class 1259 OID 16511)
-- Name: ms_menu; Type: TABLE; Schema: public; Owner: msdev
--

CREATE TABLE ms_menu (
    id integer NOT NULL,
    id_restaurant integer,
    id_menu_group integer,
    name character varying(100) NOT NULL,
    description text NOT NULL,
    image_path character varying(100),
    created_dtm timestamp without time zone NOT NULL,
    updated_dtm timestamp without time zone,
    created_by integer NOT NULL,
    updated_by integer NOT NULL,
    image_type character varying(100),
    price numeric(18,2)
);

ALTER TABLE ms_menu OWNER TO msdev;

--
-- TOC entry 190 (class 1259 OID 16495)
-- Name: ms_menu_group; Type: TABLE; Schema: public; Owner: msdev
--

CREATE TABLE ms_menu_group (
    id integer NOT NULL,
    id_restaurant integer,
    name character varying(100) NOT NULL,
    image_path character varying(100),
    created_dtm timestamp without time zone NOT NULL,
    updated_dtm timestamp without time zone,
    created_by integer NOT NULL,
    updated_by integer NOT NULL,
    image_type character varying(100)
);

ALTER TABLE ms_menu_group OWNER TO msdev;

--
-- TOC entry 191 (class 1259 OID 16498)
-- Name: ms_menu_group_id_seq; Type: SEQUENCE; Schema: public; Owner: msdev
--

CREATE SEQUENCE ms_menu_group_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER TABLE ms_menu_group_id_seq OWNER TO msdev;

--
-- TOC entry 2224 (class 0 OID 0)
-- Dependencies: 191
-- Name: ms_menu_group_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: msdev
--

ALTER SEQUENCE ms_menu_group_id_seq OWNED BY ms_menu_group.id;

--
-- TOC entry 192 (class 1259 OID 16509)
-- Name: ms_menu_id_seq; Type: SEQUENCE; Schema: public; Owner: msdev
--

CREATE SEQUENCE ms_menu_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER TABLE ms_menu_id_seq OWNER TO msdev;

--
-- TOC entry 2225 (class 0 OID 0)
-- Dependencies: 192
-- Name: ms_menu_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: msdev
--

ALTER SEQUENCE ms_menu_id_seq OWNED BY ms_menu.id;

--
-- TOC entry 198 (class 1259 OID 16633)
-- Name: ms_province_id_seq; Type: SEQUENCE; Schema: public; Owner: msdev
--

CREATE SEQUENCE ms_province_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER TABLE ms_province_id_seq OWNER TO msdev;

--
-- TOC entry 185 (class 1259 OID 16430)
-- Name: ms_province; Type: TABLE; Schema: public; Owner: msdev
--

CREATE TABLE ms_province (
    id integer DEFAULT nextval('ms_province_id_seq'::regclass) NOT NULL,
    name character varying(100) NOT NULL
);

ALTER TABLE ms_province OWNER TO msdev;

--
-- TOC entry 195 (class 1259 OID 16538)
-- Name: ms_restaurant; Type: TABLE; Schema: public; Owner: msdev
--

CREATE TABLE ms_restaurant (
    id integer NOT NULL,
    name character varying(255) NOT NULL,
    description text,
    address character varying(255) NOT NULL,
    province integer NOT NULL,
    city integer NOT NULL,
    area integer,
    image_path character varying(100),
    image_type character varying(100),
    created_dtm timestamp without time zone NOT NULL,
    updated_dtm timestamp without time zone NOT NULL,
    created_by integer NOT NULL,
    updated_by integer NOT NULL,
    map_location character varying(50)
);

ALTER TABLE ms_restaurant OWNER TO msdev;

--
-- TOC entry 194 (class 1259 OID 16536)
-- Name: ms_restaurant_id_seq; Type: SEQUENCE; Schema: public; Owner: msdev
--

CREATE SEQUENCE ms_restaurant_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER TABLE ms_restaurant_id_seq OWNER TO msdev;

--
-- TOC entry 2226 (class 0 OID 0)
-- Dependencies: 194
-- Name: ms_restaurant_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: msdev
--

ALTER SEQUENCE ms_restaurant_id_seq OWNED BY ms_restaurant.id;

--
-- TOC entry 188 (class 1259 OID 16460)
-- Name: ms_review_restaurant; Type: TABLE; Schema: public; Owner: msdev
--

CREATE TABLE ms_review_restaurant (
    id integer NOT NULL,
    id_restaurant integer NOT NULL,
    id_customer integer NOT NULL,
    rate smallint NOT NULL,
    description text,
    created_dtm timestamp without time zone NOT NULL,
    updated_dtm timestamp without time zone
);

ALTER TABLE ms_review_restaurant OWNER TO msdev;

--
-- TOC entry 189 (class 1259 OID 16463)
-- Name: ms_review_restaurant_id_seq; Type: SEQUENCE; Schema: public; Owner: msdev
--

CREATE SEQUENCE ms_review_restaurant_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER TABLE ms_review_restaurant_id_seq OWNER TO msdev;

--
-- TOC entry 2227 (class 0 OID 0)
-- Dependencies: 189
-- Name: ms_review_restaurant_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: msdev
--

ALTER SEQUENCE ms_review_restaurant_id_seq OWNED BY ms_review_restaurant.id;

--
-- TOC entry 184 (class 1259 OID 16400)
-- Name: ms_user; Type: TABLE; Schema: public; Owner: msdev
--

CREATE TABLE ms_user (
    id integer NOT NULL,
    email character varying(100) NOT NULL,
    password character varying(100) NOT NULL,
    name_first character varying(100) NOT NULL,
    name_last character varying(100) NOT NULL,
    created_dtm timestamp without time zone NOT NULL,
    updated_dtm timestamp without time zone NOT NULL,
    created_by integer NOT NULL,
    updated_by integer NOT NULL,
    access_token character varying(50)
);

ALTER TABLE ms_user OWNER TO msdev;

--
-- TOC entry 183 (class 1259 OID 16398)
-- Name: ms_user_id_seq; Type: SEQUENCE; Schema: public; Owner: msdev
--

CREATE SEQUENCE ms_user_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER TABLE ms_user_id_seq OWNER TO msdev;

--
-- TOC entry 2228 (class 0 OID 0)
-- Dependencies: 183
-- Name: ms_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: msdev
--

ALTER SEQUENCE ms_user_id_seq OWNED BY ms_user.id;

--
-- TOC entry 2041 (class 2604 OID 16591)
-- Name: id; Type: DEFAULT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_area ALTER COLUMN id SET DEFAULT nextval('ms_area_id_seq'::regclass);

--
-- TOC entry 2036 (class 2604 OID 16451)
-- Name: id; Type: DEFAULT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_city ALTER COLUMN id SET DEFAULT nextval('ms_city_id_seq'::regclass);

--
-- TOC entry 2033 (class 2604 OID 16395)
-- Name: id; Type: DEFAULT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_customer ALTER COLUMN id SET DEFAULT nextval('ms_customer_id_seq'::regclass);

--
-- TOC entry 2039 (class 2604 OID 16514)
-- Name: id; Type: DEFAULT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_menu ALTER COLUMN id SET DEFAULT nextval('ms_menu_id_seq'::regclass);

--
-- TOC entry 2038 (class 2604 OID 16500)
-- Name: id; Type: DEFAULT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_menu_group ALTER COLUMN id SET DEFAULT nextval('ms_menu_group_id_seq'::regclass);

--
-- TOC entry 2040 (class 2604 OID 16541)
-- Name: id; Type: DEFAULT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_restaurant ALTER COLUMN id SET DEFAULT nextval('ms_restaurant_id_seq'::regclass);

--
-- TOC entry 2037 (class 2604 OID 16465)
-- Name: id; Type: DEFAULT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_review_restaurant ALTER COLUMN id SET DEFAULT nextval('ms_review_restaurant_id_seq'::regclass);

--
-- TOC entry 2034 (class 2604 OID 16403)
-- Name: id; Type: DEFAULT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_user ALTER COLUMN id SET DEFAULT nextval('ms_user_id_seq'::regclass);

--
-- TOC entry 2211 (class 0 OID 16588)
-- Dependencies: 197
-- Data for Name: ms_area; Type: TABLE DATA; Schema: public; Owner: msdev
--

COPY ms_area (id, name, id_city) FROM stdin;
1	Beji Timur	1
3	Sukmajaya	1
4	TEGAL TIMUR	5
\.

--
-- TOC entry 2229 (class 0 OID 0)
-- Dependencies: 196
-- Name: ms_area_id_seq; Type: SEQUENCE SET; Schema: public; Owner: msdev
--

SELECT pg_catalog.setval('ms_area_id_seq', 4, true);

--
-- TOC entry 2201 (class 0 OID 16448)
-- Dependencies: 187
-- Data for Name: ms_city; Type: TABLE DATA; Schema: public; Owner: msdev
--

COPY ms_city (id, name, id_province) FROM stdin;
1	DEPOK	2
2	BANDUNG	2
3	JAKARTA SELATAN	1
5	TEGAL	3
\.

--
-- TOC entry 2230 (class 0 OID 0)
-- Dependencies: 186
-- Name: ms_city_id_seq; Type: SEQUENCE SET; Schema: public; Owner: msdev
--

SELECT pg_catalog.setval('ms_city_id_seq', 5, true);

--
-- TOC entry 2196 (class 0 OID 16392)
-- Dependencies: 182
-- Data for Name: ms_customer; Type: TABLE DATA; Schema: public; Owner: msdev
--

COPY ms_customer (id, email, password_hash, name_first, name_last, telephone, created_dtm, updated_dtm, created_by, updated_by, image_path, image_type, access_token, status) FROM stdin;
3	saptoridroid@gmail.com	$2y$13$chIS2CSSBDfXw2O.R.pUCuDUBomvK/XDio/VpphAFPFVYW2Pp35em	saptori	droid	08561819245	2016-08-11 17:07:01	2016-08-11 17:07:01	4	4	\N	\N	NXzcn1MbpC8NFyTCCUntyCuGOWw6wlXj	1
\.

--
-- TOC entry 2231 (class 0 OID 0)
-- Dependencies: 181
-- Name: ms_customer_id_seq; Type: SEQUENCE SET; Schema: public; Owner: msdev
--

SELECT pg_catalog.setval('ms_customer_id_seq', 3, true);

--
-- TOC entry 2207 (class 0 OID 16511)
-- Dependencies: 193
-- Data for Name: ms_menu; Type: TABLE DATA; Schema: public; Owner: msdev
--

COPY ms_menu (id, id_restaurant, id_menu_group, name, description, image_path, created_dtm, updated_dtm, created_by, updated_by, image_type, price) FROM stdin;
1	1	2	Express A	Fry Mix (marumi, spicy chicken, egg roll), salad package, rice	D:/myimg/menugroup/1_439476_1432458571_ma.jpg	2016-08-09 17:54:20	2016-08-09 17:54:20	4	4	image/jpeg	18182.00
2	1	4	Chicken Ebimaki	Chicken teriyaki (1/2 portion), ebimaki, Mix vegetables, salad, rice	D:/myimg/menugroup/2_439478_1432700826_ma.jpg	2016-08-14 06:42:29	2016-08-14 06:42:29	4	4	image/jpeg	22727.00
3	1	4	Egg Roll	Egg roll (5 pcs), salad package	D:/myimg/menugroup/3_439499_1432700919_ma.jpg	2016-08-14 06:58:10	2016-08-14 06:58:10	4	4	image/jpeg	19091.00
4	1	2	Express B	Ebi maki, salad package, rice	D:/myimg/menugroup/4_439477_1432458571_ma.jpg	2016-08-14 07:01:48	2016-08-14 07:01:48	4	4	image/jpeg	18182.00
5	1	2	Gokana 1	Chicken teriyaki, fry mix (marumi, spicy chicken, egg roll), mix vegetables, salad, rice	D:/myimg/menugroup/5_439467_1432460493_ma.jpg	2016-08-16 20:33:22	2016-08-16 20:33:22	4	4	image/jpeg	31818.00
6	3	6	Ayam Presto Goreng Crispy	Deep Fried Chicken Presto With Crunchy Crumb	\N	2016-08-19 09:07:43	2016-08-19 09:07:43	4	4	\N	21500.00
7	3	6	Ayam Presto Goreng Crispy	Deep Fried Chicken Presto With Crunchy Crumb	\N	2016-08-19 09:17:43	2016-08-19 09:17:43	4	4	\N	21500.00
11	2	5	Kids Meal	1 Mini Pizza, 1 Chicken Wings (3 pcs) and 1 Milo	D:/myimg/menugroup/11_541489_1442224577_ma.jpg	2016-08-19 09:52:20	2016-08-19 09:52:20	4	4	image/jpeg	55000.00
16	2	5	Valentine Combo 1	2 Mini Pizza, 1 Chicken Wings (3 pcs), 1 Mini Lasagna or Mini Baked Spaghetti and 2 Soft Drink	D:/myimg/menugroup/16_541490_1442224577_ma.jpg	2016-08-19 10:00:57	2016-08-19 10:00:57	4	4	image/jpeg	134900.00
18	2	7	Garlic Bread	Baked bread topped with garlic	D:/myimg/menugroup/18_541516_1442215782_ma.jpg	2016-08-19 10:02:54	2016-08-19 10:02:54	4	4	image/jpeg	27900.00
19	2	7	Cheese Bread	Crispy special bread topped with cheese\r\n	D:/myimg/menugroup/19_541511_1442215783_ma.jpg	2016-08-19 10:03:44	2016-08-19 10:03:44	4	4	image/jpeg	34900.00
\.

--
-- TOC entry 2204 (class 0 OID 16495)
-- Dependencies: 190
-- Data for Name: ms_menu_group; Type: TABLE DATA; Schema: public; Owner: msdev
--

COPY ms_menu_group (id, id_restaurant, name, image_path, created_dtm, updated_dtm, created_by, updated_by, image_type) FROM stdin;
2	1	Gokana Special	D:/myimg/menugroup/2_44196_menu.png	2016-08-09 17:13:45	2016-08-09 17:13:45	4	4	image/png
4	1	Gokana Bento	D:/myimg/menugroup/4_44197_menu.png	2016-08-13 21:04:59	2016-08-13 21:04:59	4	4	image/png
5	2	Pizza Packages	D:/myimg/menugroup/5_52938_menu.jpg	2016-08-14 07:14:15	2016-08-14 07:14:15	4	4	image/jpeg
6	3	Chicken	D:/myimg/menugroup/6_20231_menu.png	2016-08-19 09:07:03	2016-08-19 09:07:03	4	4	image/png
7	2	Side Dishes	D:/myimg/menugroup/7_52940_menu.jpg	2016-08-19 10:02:15	2016-08-19 10:02:15	4	4	image/jpeg
8	1	Fresh Drinks	D:/myimg/menugroup/8_52940_menu.jpg	2016-08-21 09:19:56	2016-08-21 09:43:41	4	4	image/jpeg
\.

--
-- TOC entry 2232 (class 0 OID 0)
-- Dependencies: 191
-- Name: ms_menu_group_id_seq; Type: SEQUENCE SET; Schema: public; Owner: msdev
--

SELECT pg_catalog.setval('ms_menu_group_id_seq', 8, true);

--
-- TOC entry 2233 (class 0 OID 0)
-- Dependencies: 192
-- Name: ms_menu_id_seq; Type: SEQUENCE SET; Schema: public; Owner: msdev
--

SELECT pg_catalog.setval('ms_menu_id_seq', 19, true);

--
-- TOC entry 2199 (class 0 OID 16430)
-- Dependencies: 185
-- Data for Name: ms_province; Type: TABLE DATA; Schema: public; Owner: msdev
--

COPY ms_province (id, name) FROM stdin;
1	DKI JAKARTA
2	JAWA BARAT
3	JAWA TENGAH
\.

--
-- TOC entry 2234 (class 0 OID 0)
-- Dependencies: 198
-- Name: ms_province_id_seq; Type: SEQUENCE SET; Schema: public; Owner: msdev
--

SELECT pg_catalog.setval('ms_province_id_seq', 3, true);

--
-- TOC entry 2209 (class 0 OID 16538)
-- Dependencies: 195
-- Data for Name: ms_restaurant; Type: TABLE DATA; Schema: public; Owner: msdev
--

COPY ms_restaurant (id, name, description, address, province, city, area, image_path, image_type, created_dtm, updated_dtm, created_by, updated_by, map_location) FROM stdin;
1	Gokana - Depok Mall	Indonesian food in DepokSushi & Japanese food in DepokWestern food in Depok	Mall Depok Ma No.G-8 Lantai. GF, Jalan. Margonda Raya Kav. 88, Depok., Depok, 16423	2	1	\N	1_i4nq_sqp.jpg	image/jpeg	2016-08-06 23:40:44	2016-08-06 23:40:44	4	4	\N
2	Gian Pizza - Depok	Pizza in DepokWestern food in Depok	Jl Arif Rahman Hakim No 3A Depok, Depok, 16431	2	1	\N	2_i0lg_sqp.png	image/png	2016-08-14 07:13:00	2016-08-14 07:13:00	4	4	\N
3	Ayam Tulang Lunak Hayam Wuruk - Depok	Indonesian food in Jakarta	Jl. Margonda Raya No. 32 A Beiji, Jakarta	2	1	\N	3_i8rt_sqp.jpg	image/jpeg	2016-08-17 15:38:08	2016-08-17 15:38:08	4	4	\N
6	Solaria - D'Mall	Indonesian food in Depok	D'mall Depok Jl. Margonda Raya No.88 Beji Kota Depok, Jawa Barat, Depok, 16423	2	1	\N	\N	\N	2016-08-21 15:41:11	2016-08-21 15:41:11	4	4	\N
\.

--
-- TOC entry 2235 (class 0 OID 0)
-- Dependencies: 194
-- Name: ms_restaurant_id_seq; Type: SEQUENCE SET; Schema: public; Owner: msdev
--

SELECT pg_catalog.setval('ms_restaurant_id_seq', 6, true);

--
-- TOC entry 2202 (class 0 OID 16460)
-- Dependencies: 188
-- Data for Name: ms_review_restaurant; Type: TABLE DATA; Schema: public; Owner: msdev
--

COPY ms_review_restaurant (id, id_restaurant, id_customer, rate, description, created_dtm, updated_dtm) FROM stdin;
1	1	3	5	bagus ini restoran	2016-08-17 15:23:37.039121	\N
2	1	3	5	hebat	2016-08-17 15:23:46.295805	\N
\.

--
-- TOC entry 2236 (class 0 OID 0)
-- Dependencies: 189
-- Name: ms_review_restaurant_id_seq; Type: SEQUENCE SET; Schema: public; Owner: msdev
--

SELECT pg_catalog.setval('ms_review_restaurant_id_seq', 2, true);

--
-- TOC entry 2198 (class 0 OID 16400)
-- Dependencies: 184
-- Data for Name: ms_user; Type: TABLE DATA; Schema: public; Owner: msdev
--

COPY ms_user (id, email, password, name_first, name_last, created_dtm, updated_dtm, created_by, updated_by, access_token) FROM stdin;
4	sapii@gmail.com	123456	sapii	tobari	2016-08-07 10:52:46.736429	2016-08-07 10:52:46.736429	1	1	\N
\.

--
-- TOC entry 2237 (class 0 OID 0)
-- Dependencies: 183
-- Name: ms_user_id_seq; Type: SEQUENCE SET; Schema: public; Owner: msdev
--

SELECT pg_catalog.setval('ms_user_id_seq', 4, true);

--
-- TOC entry 2070 (class 2606 OID 16593)
-- Name: pk_ms_area; Type: CONSTRAINT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_area
    ADD CONSTRAINT pk_ms_area PRIMARY KEY (id);

--
-- TOC entry 2052 (class 2606 OID 16453)
-- Name: pk_ms_city; Type: CONSTRAINT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_city
    ADD CONSTRAINT pk_ms_city PRIMARY KEY (id);

--
-- TOC entry 2043 (class 2606 OID 16397)
-- Name: pk_ms_customer; Type: CONSTRAINT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_customer
    ADD CONSTRAINT pk_ms_customer PRIMARY KEY (id);

--
-- TOC entry 2063 (class 2606 OID 16519)
-- Name: pk_ms_menu; Type: CONSTRAINT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_menu
    ADD CONSTRAINT pk_ms_menu PRIMARY KEY (id);

--
-- TOC entry 2059 (class 2606 OID 16505)
-- Name: pk_ms_menu_group; Type: CONSTRAINT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_menu_group
    ADD CONSTRAINT pk_ms_menu_group PRIMARY KEY (id);

--
-- TOC entry 2049 (class 2606 OID 16618)
-- Name: pk_ms_province; Type: CONSTRAINT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_province
    ADD CONSTRAINT pk_ms_province PRIMARY KEY (id);

--
-- TOC entry 2068 (class 2606 OID 16546)
-- Name: pk_ms_restaurant; Type: CONSTRAINT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_restaurant
    ADD CONSTRAINT pk_ms_restaurant PRIMARY KEY (id);

--
-- TOC entry 2056 (class 2606 OID 16470)
-- Name: pk_ms_review_restaurant; Type: CONSTRAINT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_review_restaurant
    ADD CONSTRAINT pk_ms_review_restaurant PRIMARY KEY (id);

--
-- TOC entry 2047 (class 2606 OID 16405)
-- Name: pk_ms_user; Type: CONSTRAINT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_user
    ADD CONSTRAINT pk_ms_user PRIMARY KEY (id);

--
-- TOC entry 2050 (class 1259 OID 16459)
-- Name: fki_ms_city_1; Type: INDEX; Schema: public; Owner: msdev
--

CREATE INDEX fki_ms_city_1 ON ms_city USING btree (id_province);

--
-- TOC entry 2060 (class 1259 OID 16559)
-- Name: fki_ms_menu_1; Type: INDEX; Schema: public; Owner: msdev
--

CREATE INDEX fki_ms_menu_1 ON ms_menu USING btree (id_restaurant);

--
-- TOC entry 2061 (class 1259 OID 16565)
-- Name: fki_ms_menu_2; Type: INDEX; Schema: public; Owner: msdev
--

CREATE INDEX fki_ms_menu_2 ON ms_menu USING btree (id_menu_group);

--
-- TOC entry 2057 (class 1259 OID 16553)
-- Name: fki_ms_menu_group_1; Type: INDEX; Schema: public; Owner: msdev
--

CREATE INDEX fki_ms_menu_group_1 ON ms_menu_group USING btree (id_restaurant);

--
-- TOC entry 2064 (class 1259 OID 16604)
-- Name: fki_ms_restaurant_1; Type: INDEX; Schema: public; Owner: msdev
--

CREATE INDEX fki_ms_restaurant_1 ON ms_restaurant USING btree (province);

--
-- TOC entry 2065 (class 1259 OID 16610)
-- Name: fki_ms_restaurant_2; Type: INDEX; Schema: public; Owner: msdev
--

CREATE INDEX fki_ms_restaurant_2 ON ms_restaurant USING btree (city);

--
-- TOC entry 2066 (class 1259 OID 16616)
-- Name: fki_ms_restaurant_3; Type: INDEX; Schema: public; Owner: msdev
--

CREATE INDEX fki_ms_restaurant_3 ON ms_restaurant USING btree (area);

--
-- TOC entry 2053 (class 1259 OID 16571)
-- Name: fki_ms_review_restaurant_1; Type: INDEX; Schema: public; Owner: msdev
--

CREATE INDEX fki_ms_review_restaurant_1 ON ms_review_restaurant USING btree (id_restaurant);

--
-- TOC entry 2054 (class 1259 OID 16577)
-- Name: fki_ms_review_restaurant_2; Type: INDEX; Schema: public; Owner: msdev
--

CREATE INDEX fki_ms_review_restaurant_2 ON ms_review_restaurant USING btree (id_customer);

--
-- TOC entry 2044 (class 1259 OID 16636)
-- Name: idx_ms_user_1; Type: INDEX; Schema: public; Owner: msdev
--

CREATE INDEX idx_ms_user_1 ON ms_user USING btree (email);

--
-- TOC entry 2045 (class 1259 OID 16637)
-- Name: idx_ms_user_2; Type: INDEX; Schema: public; Owner: msdev
--

CREATE INDEX idx_ms_user_2 ON ms_user USING btree (access_token);

--
-- TOC entry 2080 (class 2606 OID 16594)
-- Name: fk_ms_area_1; Type: FK CONSTRAINT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_area
    ADD CONSTRAINT fk_ms_area_1 FOREIGN KEY (id_city) REFERENCES ms_city(id);

--
-- TOC entry 2071 (class 2606 OID 16619)
-- Name: fk_ms_city_1; Type: FK CONSTRAINT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_city
    ADD CONSTRAINT fk_ms_city_1 FOREIGN KEY (id_province) REFERENCES ms_province(id);

--
-- TOC entry 2075 (class 2606 OID 16554)
-- Name: fk_ms_menu_1; Type: FK CONSTRAINT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_menu
    ADD CONSTRAINT fk_ms_menu_1 FOREIGN KEY (id_restaurant) REFERENCES ms_restaurant(id);

--
-- TOC entry 2076 (class 2606 OID 16560)
-- Name: fk_ms_menu_2; Type: FK CONSTRAINT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_menu
    ADD CONSTRAINT fk_ms_menu_2 FOREIGN KEY (id_menu_group) REFERENCES ms_menu_group(id);

--
-- TOC entry 2074 (class 2606 OID 16548)
-- Name: fk_ms_menu_group_1; Type: FK CONSTRAINT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_menu_group
    ADD CONSTRAINT fk_ms_menu_group_1 FOREIGN KEY (id_restaurant) REFERENCES ms_restaurant(id);

--
-- TOC entry 2079 (class 2606 OID 16624)
-- Name: fk_ms_restaurant_1; Type: FK CONSTRAINT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_restaurant
    ADD CONSTRAINT fk_ms_restaurant_1 FOREIGN KEY (province) REFERENCES ms_province(id);

--
-- TOC entry 2077 (class 2606 OID 16605)
-- Name: fk_ms_restaurant_2; Type: FK CONSTRAINT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_restaurant
    ADD CONSTRAINT fk_ms_restaurant_2 FOREIGN KEY (city) REFERENCES ms_city(id);

--
-- TOC entry 2078 (class 2606 OID 16611)
-- Name: fk_ms_restaurant_3; Type: FK CONSTRAINT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_restaurant
    ADD CONSTRAINT fk_ms_restaurant_3 FOREIGN KEY (area) REFERENCES ms_area(id);

--
-- TOC entry 2072 (class 2606 OID 16566)
-- Name: fk_ms_review_restaurant_1; Type: FK CONSTRAINT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_review_restaurant
    ADD CONSTRAINT fk_ms_review_restaurant_1 FOREIGN KEY (id_restaurant) REFERENCES ms_restaurant(id);

--
-- TOC entry 2073 (class 2606 OID 16572)
-- Name: fk_ms_review_restaurant_2; Type: FK CONSTRAINT; Schema: public; Owner: msdev
--

ALTER TABLE ONLY ms_review_restaurant
    ADD CONSTRAINT fk_ms_review_restaurant_2 FOREIGN KEY (id_customer) REFERENCES ms_customer(id);

--
-- TOC entry 2219 (class 0 OID 0)
-- Dependencies: 6
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;

-- Completed on 2016-09-22 08:35:21

--
-- PostgreSQL database dump complete
--