261 lines
5.3 KiB
SQL
261 lines
5.3 KiB
SQL
--
|
|
-- PostgreSQL database dump
|
|
--
|
|
|
|
-- Dumped from database version 17.3 (Debian 17.3-3.pgdg120+1)
|
|
-- Dumped by pg_dump version 17.3 (Debian 17.3-3.pgdg120+1)
|
|
|
|
SET statement_timeout = 0;
|
|
SET lock_timeout = 0;
|
|
SET idle_in_transaction_session_timeout = 0;
|
|
SET transaction_timeout = 0;
|
|
SET client_encoding = 'UTF8';
|
|
SET standard_conforming_strings = on;
|
|
SELECT pg_catalog.set_config('search_path', '', false);
|
|
SET check_function_bodies = false;
|
|
SET xmloption = content;
|
|
SET client_min_messages = warning;
|
|
SET row_security = off;
|
|
|
|
SET default_tablespace = '';
|
|
|
|
SET default_table_access_method = heap;
|
|
|
|
--
|
|
-- Name: alembic_version; Type: TABLE; Schema: public; Owner: postgres
|
|
--
|
|
|
|
CREATE TABLE public.alembic_version (
|
|
version_num character varying(32) NOT NULL
|
|
);
|
|
|
|
|
|
ALTER TABLE public.alembic_version OWNER TO postgres;
|
|
|
|
--
|
|
-- Name: blog; Type: TABLE; Schema: public; Owner: postgres
|
|
--
|
|
|
|
CREATE TABLE public.blog (
|
|
id integer NOT NULL,
|
|
owner_id integer NOT NULL,
|
|
name character varying NOT NULL,
|
|
description character varying NOT NULL
|
|
);
|
|
|
|
|
|
ALTER TABLE public.blog OWNER TO postgres;
|
|
|
|
--
|
|
-- Name: blog_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
|
|
--
|
|
|
|
CREATE SEQUENCE public.blog_id_seq
|
|
AS integer
|
|
START WITH 1
|
|
INCREMENT BY 1
|
|
NO MINVALUE
|
|
NO MAXVALUE
|
|
CACHE 1;
|
|
|
|
|
|
ALTER SEQUENCE public.blog_id_seq OWNER TO postgres;
|
|
|
|
--
|
|
-- Name: blog_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
|
|
--
|
|
|
|
ALTER SEQUENCE public.blog_id_seq OWNED BY public.blog.id;
|
|
|
|
|
|
--
|
|
-- Name: post; Type: TABLE; Schema: public; Owner: postgres
|
|
--
|
|
|
|
CREATE TABLE public.post (
|
|
id integer NOT NULL,
|
|
header character varying NOT NULL,
|
|
text character varying NOT NULL,
|
|
author_id integer NOT NULL
|
|
);
|
|
|
|
|
|
ALTER TABLE public.post OWNER TO postgres;
|
|
|
|
--
|
|
-- Name: post_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
|
|
--
|
|
|
|
CREATE SEQUENCE public.post_id_seq
|
|
AS integer
|
|
START WITH 1
|
|
INCREMENT BY 1
|
|
NO MINVALUE
|
|
NO MAXVALUE
|
|
CACHE 1;
|
|
|
|
|
|
ALTER SEQUENCE public.post_id_seq OWNER TO postgres;
|
|
|
|
--
|
|
-- Name: post_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
|
|
--
|
|
|
|
ALTER SEQUENCE public.post_id_seq OWNED BY public.post.id;
|
|
|
|
|
|
--
|
|
-- Name: user; Type: TABLE; Schema: public; Owner: postgres
|
|
--
|
|
|
|
CREATE TABLE public."user" (
|
|
id integer NOT NULL,
|
|
email character varying NOT NULL,
|
|
login character varying NOT NULL
|
|
);
|
|
|
|
|
|
ALTER TABLE public."user" OWNER TO postgres;
|
|
|
|
--
|
|
-- Name: user_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
|
|
--
|
|
|
|
CREATE SEQUENCE public.user_id_seq
|
|
AS integer
|
|
START WITH 1
|
|
INCREMENT BY 1
|
|
NO MINVALUE
|
|
NO MAXVALUE
|
|
CACHE 1;
|
|
|
|
|
|
ALTER SEQUENCE public.user_id_seq OWNER TO postgres;
|
|
|
|
--
|
|
-- Name: user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
|
|
--
|
|
|
|
ALTER SEQUENCE public.user_id_seq OWNED BY public."user".id;
|
|
|
|
|
|
--
|
|
-- Name: blog id; Type: DEFAULT; Schema: public; Owner: postgres
|
|
--
|
|
|
|
ALTER TABLE ONLY public.blog ALTER COLUMN id SET DEFAULT nextval('public.blog_id_seq'::regclass);
|
|
|
|
|
|
--
|
|
-- Name: post id; Type: DEFAULT; Schema: public; Owner: postgres
|
|
--
|
|
|
|
ALTER TABLE ONLY public.post ALTER COLUMN id SET DEFAULT nextval('public.post_id_seq'::regclass);
|
|
|
|
|
|
--
|
|
-- Name: user id; Type: DEFAULT; Schema: public; Owner: postgres
|
|
--
|
|
|
|
ALTER TABLE ONLY public."user" ALTER COLUMN id SET DEFAULT nextval('public.user_id_seq'::regclass);
|
|
|
|
|
|
--
|
|
-- Data for Name: alembic_version; Type: TABLE DATA; Schema: public; Owner: postgres
|
|
--
|
|
|
|
INSERT INTO public.alembic_version (version_num) VALUES ('9975c56b36b8');
|
|
|
|
|
|
--
|
|
-- Data for Name: blog; Type: TABLE DATA; Schema: public; Owner: postgres
|
|
--
|
|
|
|
|
|
|
|
--
|
|
-- Data for Name: post; Type: TABLE DATA; Schema: public; Owner: postgres
|
|
--
|
|
|
|
|
|
|
|
--
|
|
-- Data for Name: user; Type: TABLE DATA; Schema: public; Owner: postgres
|
|
--
|
|
|
|
|
|
|
|
--
|
|
-- Name: blog_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
|
|
--
|
|
|
|
SELECT pg_catalog.setval('public.blog_id_seq', 1, false);
|
|
|
|
|
|
--
|
|
-- Name: post_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
|
|
--
|
|
|
|
SELECT pg_catalog.setval('public.post_id_seq', 1, false);
|
|
|
|
|
|
--
|
|
-- Name: user_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
|
|
--
|
|
|
|
SELECT pg_catalog.setval('public.user_id_seq', 1, false);
|
|
|
|
|
|
--
|
|
-- Name: alembic_version alembic_version_pkc; Type: CONSTRAINT; Schema: public; Owner: postgres
|
|
--
|
|
|
|
ALTER TABLE ONLY public.alembic_version
|
|
ADD CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num);
|
|
|
|
|
|
--
|
|
-- Name: blog blog_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
|
|
--
|
|
|
|
ALTER TABLE ONLY public.blog
|
|
ADD CONSTRAINT blog_pkey PRIMARY KEY (id);
|
|
|
|
|
|
--
|
|
-- Name: post post_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
|
|
--
|
|
|
|
ALTER TABLE ONLY public.post
|
|
ADD CONSTRAINT post_pkey PRIMARY KEY (id);
|
|
|
|
|
|
--
|
|
-- Name: user user_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
|
|
--
|
|
|
|
ALTER TABLE ONLY public."user"
|
|
ADD CONSTRAINT user_pkey PRIMARY KEY (id);
|
|
|
|
|
|
--
|
|
-- Name: blog blog_owner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
--
|
|
|
|
ALTER TABLE ONLY public.blog
|
|
ADD CONSTRAINT blog_owner_id_fkey FOREIGN KEY (owner_id) REFERENCES public."user"(id);
|
|
|
|
|
|
--
|
|
-- Name: post post_author_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
|
|
--
|
|
|
|
ALTER TABLE ONLY public.post
|
|
ADD CONSTRAINT post_author_id_fkey FOREIGN KEY (author_id) REFERENCES public."user"(id);
|
|
|
|
|
|
--
|
|
-- PostgreSQL database dump complete
|
|
--
|
|
|