Guest User

Postgres Schema

a guest
Jun 8th, 2020
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --
  2. -- PostgreSQL database dump
  3. --
  4.  
  5. -- Dumped from database version 12.2
  6. -- Dumped by pg_dump version 12.2
  7.  
  8. SET statement_timeout = 0;
  9. SET lock_timeout = 0;
  10. SET idle_in_transaction_session_timeout = 0;
  11. SET client_encoding = 'UTF8';
  12. SET standard_conforming_strings = on;
  13. SELECT pg_catalog.set_config('search_path', '', false);
  14. SET check_function_bodies = false;
  15. SET xmloption = content;
  16. SET client_min_messages = warning;
  17. SET row_security = off;
  18.  
  19. --
  20. -- Name: adminpack; Type: EXTENSION; Schema: -; Owner: -
  21. --
  22.  
  23. CREATE EXTENSION IF NOT EXISTS adminpack WITH SCHEMA pg_catalog;
  24.  
  25.  
  26. --
  27. -- Name: EXTENSION adminpack; Type: COMMENT; Schema: -; Owner:
  28. --
  29.  
  30. COMMENT ON EXTENSION adminpack IS 'administrative functions for PostgreSQL';
  31.  
  32.  
  33. SET default_tablespace = '';
  34.  
  35. SET default_table_access_method = heap;
  36.  
  37. --
  38. -- Name: users; Type: TABLE; Schema: public; Owner: postgres
  39. --
  40.  
  41. CREATE TABLE public.users (
  42.     id integer NOT NULL,
  43.     userdata_id integer,
  44.     username character varying NOT NULL,
  45.     password character varying NOT NULL
  46. );
  47.  
  48. --
  49. -- Name: Users_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
  50. --
  51.  
  52. CREATE SEQUENCE public."Users_id_seq"
  53.     AS integer
  54.     START WITH 1
  55.     INCREMENT BY 1
  56.     NO MINVALUE
  57.     NO MAXVALUE
  58.     CACHE 1;
  59.  
  60. --
  61. -- Name: Users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
  62. --
  63.  
  64. ALTER SEQUENCE public."Users_id_seq" OWNED BY public.users.id;
  65.  
  66.  
  67. --
  68. -- Name: content; Type: TABLE; Schema: public; Owner: postgres
  69. --
  70.  
  71. CREATE TABLE public.content (
  72.     id integer NOT NULL,
  73.     content_url character varying NOT NULL,
  74.     content_type character varying NOT NULL
  75. );
  76.  
  77. --
  78. -- Name: content_content_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
  79. --
  80.  
  81. CREATE SEQUENCE public.content_content_id_seq
  82.     AS integer
  83.     START WITH 1
  84.     INCREMENT BY 1
  85.     NO MINVALUE
  86.     NO MAXVALUE
  87.     CACHE 1;
  88.  
  89. --
  90. -- Name: content_content_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
  91. --
  92.  
  93. ALTER SEQUENCE public.content_content_id_seq OWNED BY public.content.id;
  94.  
  95.  
  96. --
  97. -- Name: topic; Type: TABLE; Schema: public; Owner: postgres
  98. --
  99.  
  100. CREATE TABLE public.topic (
  101.     id integer NOT NULL,
  102.     content_id integer,
  103.     topic_name character varying NOT NULL
  104. );
  105.  
  106. --
  107. -- Name: topic_topic_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
  108. --
  109.  
  110. CREATE SEQUENCE public.topic_topic_id_seq
  111.     AS integer
  112.     START WITH 1
  113.     INCREMENT BY 1
  114.     NO MINVALUE
  115.     NO MAXVALUE
  116.     CACHE 1;
  117.  
  118. --
  119. -- Name: topic_topic_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
  120. --
  121.  
  122. ALTER SEQUENCE public.topic_topic_id_seq OWNED BY public.topic.id;
  123.  
  124.  
  125. --
  126. -- Name: content id; Type: DEFAULT; Schema: public; Owner: postgres
  127. --
  128.  
  129. ALTER TABLE ONLY public.content ALTER COLUMN id SET DEFAULT nextval('public.content_content_id_seq'::regclass);
  130.  
  131.  
  132. --
  133. -- Name: topic id; Type: DEFAULT; Schema: public; Owner: postgres
  134. --
  135.  
  136. ALTER TABLE ONLY public.topic ALTER COLUMN id SET DEFAULT nextval('public.topic_topic_id_seq'::regclass);
  137.  
  138.  
  139. --
  140. -- Name: users id; Type: DEFAULT; Schema: public; Owner: postgres
  141. --
  142.  
  143. ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public."Users_id_seq"'::regclass);
  144.  
  145.  
  146. --
  147. -- Name: users Users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
  148. --
  149.  
  150. ALTER TABLE ONLY public.users
  151.     ADD CONSTRAINT "Users_pkey" PRIMARY KEY (id);
  152.  
  153.  
  154. --
  155. -- Name: content content_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
  156. --
  157.  
  158. ALTER TABLE ONLY public.content
  159.     ADD CONSTRAINT content_pkey PRIMARY KEY (id);
  160.  
  161.  
  162. --
  163. -- Name: topic topic_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
  164. --
  165.  
  166. ALTER TABLE ONLY public.topic
  167.     ADD CONSTRAINT topic_pkey PRIMARY KEY (id);
  168.  
  169.  
  170. --
  171. -- Name: topic content_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
  172. --
  173.  
  174. ALTER TABLE ONLY public.topic
  175.     ADD CONSTRAINT content_fk FOREIGN KEY (content_id) REFERENCES public.content(id);
  176.  
  177.  
  178. --
  179. -- PostgreSQL database dump complete
  180. --
Add Comment
Please, Sign In to add comment