--
-- PostgreSQL database dump
--

-- Dumped from database version 9.6.1
-- Dumped by pg_dump version 9.6.1

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_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;

DROP DATABASE IF EXISTS demodb;
--
-- Name: demodb; Type: DATABASE; Schema: -; Owner: demouser
--

CREATE DATABASE demodb;


ALTER DATABASE demodb OWNER TO demouser;

\connect demodb

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_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;

--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: 
--

CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;


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

--
-- Name: institusi; Type: TABLE; Schema: public; Owner: demouser
--

CREATE TABLE institusi (
    id bigint NOT NULL,
    kode_institusi character varying(20),
    nama character varying(100),
    nama_singkat character varying(10),
    flag_aktif boolean
);


ALTER TABLE institusi OWNER TO demouser;

--
-- Name: institusi_id_seq; Type: SEQUENCE; Schema: public; Owner: demouser
--

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


ALTER TABLE institusi_id_seq OWNER TO demouser;

--
-- Name: institusi_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: demouser
--

ALTER SEQUENCE institusi_id_seq OWNED BY institusi.id;


--
-- Name: kurikulum; Type: TABLE; Schema: public; Owner: demouser
--

CREATE TABLE kurikulum (
    id bigint NOT NULL,
    id_institusi bigint,
    nama character varying(100),
    deskripsi character varying(255),
    total_sks integer,
    flag_aktif boolean
);


ALTER TABLE kurikulum OWNER TO demouser;

--
-- Name: kurikulum_id_seq; Type: SEQUENCE; Schema: public; Owner: demouser
--

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


ALTER TABLE kurikulum_id_seq OWNER TO demouser;

--
-- Name: kurikulum_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: demouser
--

ALTER SEQUENCE kurikulum_id_seq OWNED BY kurikulum.id;


--
-- Name: institusi id; Type: DEFAULT; Schema: public; Owner: demouser
--

ALTER TABLE ONLY institusi ALTER COLUMN id SET DEFAULT nextval('institusi_id_seq'::regclass);


--
-- Name: kurikulum id; Type: DEFAULT; Schema: public; Owner: demouser
--

ALTER TABLE ONLY kurikulum ALTER COLUMN id SET DEFAULT nextval('kurikulum_id_seq'::regclass);


--
-- Data for Name: institusi; Type: TABLE DATA; Schema: public; Owner: demouser
--

COPY institusi (id, kode_institusi, nama, nama_singkat, flag_aktif) FROM stdin;
11	KODE06	Nama06	NS06	t
13	K002	Nama002	NM002	t
14	K003	Nama003	NM003	t
15	K004	Nama004	NM004	f
16	K005	Nama005	NM005	f
20	K009	Nama009	NM009	f
21	K010	Nama010	NM010	t
12	K001	Nama001	NM001	t
17	K0065	Nama0065	NM0065	t
18	K0071	Nama0071	NM0071	f
23	T101	N101	K101	t
32	X001	Nama001	NS001	f
19	K008	NamaXXX	NM008	f
33	LL01	LLN01	LLNS01	t
30	ZZ001	ZZN001	ZZNS001	f
\.


--
-- Name: institusi_id_seq; Type: SEQUENCE SET; Schema: public; Owner: demouser
--

SELECT pg_catalog.setval('institusi_id_seq', 33, true);


--
-- Data for Name: kurikulum; Type: TABLE DATA; Schema: public; Owner: demouser
--

COPY kurikulum (id, id_institusi, nama, deskripsi, total_sks, flag_aktif) FROM stdin;
\.


--
-- Name: kurikulum_id_seq; Type: SEQUENCE SET; Schema: public; Owner: demouser
--

SELECT pg_catalog.setval('kurikulum_id_seq', 1, false);


--
-- Name: institusi institusi_pkey; Type: CONSTRAINT; Schema: public; Owner: demouser
--

ALTER TABLE ONLY institusi
    ADD CONSTRAINT institusi_pkey PRIMARY KEY (id);


--
-- Name: kurikulum kurikulum_pkey; Type: CONSTRAINT; Schema: public; Owner: demouser
--

ALTER TABLE ONLY kurikulum
    ADD CONSTRAINT kurikulum_pkey PRIMARY KEY (id);


--
-- Name: institusi_kode_institusi_uindex; Type: INDEX; Schema: public; Owner: demouser
--

CREATE UNIQUE INDEX institusi_kode_institusi_uindex ON institusi USING btree (kode_institusi);


--
-- Name: kurikulum kurikulum_institusi_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: demouser
--

ALTER TABLE ONLY kurikulum
    ADD CONSTRAINT kurikulum_institusi_id_fk FOREIGN KEY (id_institusi) REFERENCES institusi(id);


--
-- PostgreSQL database dump complete
--

