newsbox/migrations/schema.sql

183 lines
4.4 KiB
MySQL
Raw Permalink Normal View History

2023-02-15 16:56:06 +00:00
--
-- PostgreSQL database dump
--
-- Dumped from database version 15.0 (Debian 15.0-1.pgdg110+1)
-- Dumped by pg_dump version 15.0 (Ubuntu 15.0-1.pgdg20.04+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;
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;
--
2023-02-15 19:51:54 +00:00
-- Name: message_deliveries; Type: TABLE; Schema: public; Owner: postgres
2023-02-15 16:56:06 +00:00
--
CREATE TABLE public.message_deliveries (
id uuid NOT NULL,
message_id uuid,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
2023-02-15 19:51:54 +00:00
ALTER TABLE public.message_deliveries OWNER TO postgres;
2023-02-15 16:56:06 +00:00
--
2023-02-15 19:51:54 +00:00
-- Name: messages; Type: TABLE; Schema: public; Owner: postgres
2023-02-15 16:56:06 +00:00
--
CREATE TABLE public.messages (
id uuid NOT NULL,
owner_id uuid NOT NULL,
"from" text NOT NULL,
from_email text NOT NULL,
"to" text NOT NULL,
subject text NOT NULL,
body text NOT NULL,
body_html text NOT NULL,
"timestamp" integer NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
2023-02-15 19:51:54 +00:00
ALTER TABLE public.messages OWNER TO postgres;
2023-02-15 16:56:06 +00:00
--
2023-02-15 19:51:54 +00:00
-- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres
2023-02-15 16:56:06 +00:00
--
CREATE TABLE public.schema_migration (
version character varying(14) NOT NULL
);
2023-02-15 19:51:54 +00:00
ALTER TABLE public.schema_migration OWNER TO postgres;
2023-02-15 16:56:06 +00:00
--
2023-02-15 19:51:54 +00:00
-- Name: user_email_verifications; Type: TABLE; Schema: public; Owner: postgres
2023-02-15 16:56:06 +00:00
--
CREATE TABLE public.user_email_verifications (
id uuid NOT NULL,
owner_id uuid NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
2023-02-15 19:51:54 +00:00
ALTER TABLE public.user_email_verifications OWNER TO postgres;
2023-02-15 16:56:06 +00:00
--
2023-02-15 19:51:54 +00:00
-- Name: user_preferences; Type: TABLE; Schema: public; Owner: postgres
2023-02-15 16:56:06 +00:00
--
CREATE TABLE public.user_preferences (
id uuid NOT NULL,
owner_id uuid NOT NULL,
email_hour_of_day integer NOT NULL,
time_zone_utc_offset integer NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
2023-02-15 19:51:54 +00:00
ALTER TABLE public.user_preferences OWNER TO postgres;
2023-02-15 16:56:06 +00:00
--
2023-02-15 19:51:54 +00:00
-- Name: users; Type: TABLE; Schema: public; Owner: postgres
2023-02-15 16:56:06 +00:00
--
CREATE TABLE public.users (
id uuid NOT NULL,
name character varying(255) NOT NULL,
username character varying(255) NOT NULL,
email character varying(255),
password_hash character varying(255),
provider character varying(255) NOT NULL,
provider_id character varying(255) NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
2023-02-15 19:51:54 +00:00
ALTER TABLE public.users OWNER TO postgres;
2023-02-15 16:56:06 +00:00
--
2023-02-15 19:51:54 +00:00
-- Name: message_deliveries message_deliveries_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
2023-02-15 16:56:06 +00:00
--
ALTER TABLE ONLY public.message_deliveries
ADD CONSTRAINT message_deliveries_pkey PRIMARY KEY (id);
--
2023-02-15 19:51:54 +00:00
-- Name: messages messages_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
2023-02-15 16:56:06 +00:00
--
ALTER TABLE ONLY public.messages
ADD CONSTRAINT messages_pkey PRIMARY KEY (id);
--
2023-02-15 19:51:54 +00:00
-- Name: user_email_verifications user_email_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
2023-02-15 16:56:06 +00:00
--
ALTER TABLE ONLY public.user_email_verifications
ADD CONSTRAINT user_email_verifications_pkey PRIMARY KEY (id);
--
2023-02-15 19:51:54 +00:00
-- Name: user_preferences user_preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
2023-02-15 16:56:06 +00:00
--
ALTER TABLE ONLY public.user_preferences
ADD CONSTRAINT user_preferences_pkey PRIMARY KEY (id);
--
2023-02-15 19:51:54 +00:00
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
2023-02-15 16:56:06 +00:00
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
--
2023-02-15 19:51:54 +00:00
-- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres
2023-02-15 16:56:06 +00:00
--
CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version);
--
2023-02-15 19:51:54 +00:00
-- Name: users_email_idx; Type: INDEX; Schema: public; Owner: postgres
2023-02-15 16:56:06 +00:00
--
CREATE UNIQUE INDEX users_email_idx ON public.users USING btree (email);
--
2023-02-15 19:51:54 +00:00
-- Name: users_username_idx; Type: INDEX; Schema: public; Owner: postgres
2023-02-15 16:56:06 +00:00
--
CREATE UNIQUE INDEX users_username_idx ON public.users USING btree (username);
--
-- PostgreSQL database dump complete
--