auth-api/db/schema.sql

100 lines
2.2 KiB
MySQL
Raw Normal View History

2020-12-29 13:46:58 +01:00
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;
--
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.schema_migrations (
version character varying(255) NOT NULL
);
--
-- Name: users; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.users (
id uuid NOT NULL,
created timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
username text NOT NULL,
password text NOT NULL
);
--
-- Name: usersFields; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public."usersFields" (
id uuid NOT NULL,
created timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
"userId" uuid NOT NULL,
name text NOT NULL,
value text[] NOT NULL
);
--
-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.schema_migrations
ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version);
--
-- Name: usersFields usersFields_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."usersFields"
ADD CONSTRAINT "usersFields_pkey" PRIMARY KEY (id);
--
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
--
-- Name: idx_usersfields; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX idx_usersfields ON public."usersFields" USING btree ("userId", name);
--
-- Name: usersFields usersFields_userId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."usersFields"
ADD CONSTRAINT "usersFields_userId_fkey" FOREIGN KEY ("userId") REFERENCES public.users(id) ON UPDATE RESTRICT ON DELETE RESTRICT;
--
-- PostgreSQL database dump complete
--
--
-- Dbmate schema migrations
--
INSERT INTO public.schema_migrations (version) VALUES
('20201207191913');